Skip to content

Commit 129db4f

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

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

RF12.cpp

+11-3
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
#define RFM_IRQ 2 // PD1, pin 19, INT1, Digital2
9292
#define SS_DDR DDRB
9393
#define SS_PORT PORTB
94-
#define SS_BIT 6 // Dig10, PB6
94+
#define SS_BIT 6 // PB6, pin 30, Digital10
9595

9696
#define SPI_SS 10 // PB6, pin 30, Digital10
9797
#define SPI_MISO 14 // PB3, pin 11, Digital14
@@ -294,7 +294,11 @@ uint16_t rf12_control(uint16_t cmd) {
294294
bitClear(PCICR, PCIE2);
295295
#endif
296296
#else
297-
bitClear(EIMSK, INT1);
297+
#if defined(__AVR_ATmega32U4__) //Arduino Leonardo, YUN
298+
bitClear(EIMSK, INT1);
299+
#else
300+
bitClear(EIMSK, INT0);
301+
#endif
298302
#endif
299303
uint16_t r = rf12_xferSlow(cmd);
300304
#if PINCHG_IRQ
@@ -306,7 +310,11 @@ uint16_t rf12_control(uint16_t cmd) {
306310
bitSet(PCICR, PCIE2);
307311
#endif
308312
#else
309-
bitSet(EIMSK, INT1);
313+
#if defined(__AVR_ATmega32U4__) //Arduino Leonardo, YUN
314+
bitSet(EIMSK, INT1);
315+
#else
316+
bitSet(EIMSK, INT0);
317+
#endif
310318
#endif
311319
#else
312320
// ATtiny

0 commit comments

Comments
 (0)