Skip to content

Commit 11605ee

Browse files
Only Arduino Leonardo use INT1 as RFM_IRQ on the same pin shield as the other Arduino boards
1 parent dc696bd commit 11605ee

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

RF12.cpp

+12-3
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@
8888

8989
#elif defined(__AVR_ATmega32U4__) //Arduino Leonardo, YUN
9090

91+
//#define RFM_IRQ 7 // PE6, INT4, Digital7 - Adafruit Feather M0 RFM96
9192
#define RFM_IRQ 2 // PD1, pin 19, INT1, Digital2
9293
#define SS_DDR DDRB
9394
#define SS_PORT PORTB
94-
#define SS_BIT 6 // Dig10, PB6
95+
#define SS_BIT 6 // PB6, pin 30, Digital10
9596

9697
#define SPI_SS 10 // PB6, pin 30, Digital10
9798
#define SPI_MISO 14 // PB3, pin 11, Digital14
@@ -294,7 +295,11 @@ uint16_t rf12_control(uint16_t cmd) {
294295
bitClear(PCICR, PCIE2);
295296
#endif
296297
#else
297-
bitClear(EIMSK, INT1);
298+
#if defined(__AVR_ATmega32U4__) //Arduino Leonardo, YUN
299+
bitClear(EIMSK, INT1);
300+
#else
301+
bitClear(EIMSK, INT0);
302+
#endif
298303
#endif
299304
uint16_t r = rf12_xferSlow(cmd);
300305
#if PINCHG_IRQ
@@ -306,7 +311,11 @@ uint16_t rf12_control(uint16_t cmd) {
306311
bitSet(PCICR, PCIE2);
307312
#endif
308313
#else
309-
bitSet(EIMSK, INT1);
314+
#if defined(__AVR_ATmega32U4__) //Arduino Leonardo, YUN
315+
bitSet(EIMSK, INT1);
316+
#else
317+
bitSet(EIMSK, INT0);
318+
#endif
310319
#endif
311320
#else
312321
// ATtiny

0 commit comments

Comments
 (0)