You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We expect to be able to use the attachInterrupt(digitalPinToInterrupt(pin), ISR, mode) syntax, even when the use of digitalPinToInterrupt is not absolutely necessary due to the interrupts having the same numbering as the pins (e.g. SAMD). This allows code to be written that is portable across architectures.
This is not currently possible with Arduino megaAVR Boards. Arduino megaAVR Boards' attachInterrupt was written to take a pin number as the first parameter, then convert the pin number to interrupt number inside attachInterrupt using digitalPinToInterrupt, breaking from the convention established in Arduino AVR Boards.
We expect to be able to use the
attachInterrupt(digitalPinToInterrupt(pin), ISR, mode)
syntax, even when the use ofdigitalPinToInterrupt
is not absolutely necessary due to the interrupts having the same numbering as the pins (e.g. SAMD). This allows code to be written that is portable across architectures.This is not currently possible with Arduino megaAVR Boards. Arduino megaAVR Boards'
attachInterrupt
was written to take a pin number as the first parameter, then convert the pin number to interrupt number insideattachInterrupt
usingdigitalPinToInterrupt
, breaking from the convention established in Arduino AVR Boards.To make matters more confusing, the
attachInterrupt
documentation falsely claims:The
attachInterrupt
documentation also specifically says that theattachInterrupt(pin, ISR, mode)
syntax is not recommended.Originally reported at:
http://forum.arduino.cc/index.php?topic=592249
The text was updated successfully, but these errors were encountered: