Skip to content

Commit 37b6dc5

Browse files
committed
Using NOT_AN_INTERRUPT defined constant
1 parent 369b506 commit 37b6dc5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

hardware/arduino/avr/cores/arduino/Arduino.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ extern const uint8_t PROGMEM digital_pin_to_timer_PGM[];
151151
#define NOT_A_PIN 0
152152
#define NOT_A_PORT 0
153153

154+
#define NOT_AN_INTERRUPT -1
155+
154156
#ifdef ARDUINO_MAIN
155157
#define PA 1
156158
#define PB 2

hardware/arduino/avr/variants/mega/pins_arduino.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static const uint8_t A15 = 69;
8383
( (((p) >= 62) && ((p) <= 69)) ? ((p) - 62) : \
8484
0 ) ) ) ) ) )
8585

86-
#define digitalPinToInterrupt(p) ((p) == 2 ? 0 : ((p) == 3 ? 1 : ((p) >= 18 && (p) <= 21 ? 23 - (p) : -1)))
86+
#define digitalPinToInterrupt(p) ((p) == 2 ? 0 : ((p) == 3 ? 1 : ((p) >= 18 && (p) <= 21 ? 23 - (p) : NOT_AN_INTERRUPT)))
8787

8888
#ifdef ARDUINO_MAIN
8989

0 commit comments

Comments
 (0)