The digitalPinToInterrupt() macro currently remaps the pin number to the GPIO number. This is not necessary, as most users will then use the returned value in attachInterrupt() or other similar API functions, which already perform the same remapping.
The first half of the macro (the condition) does indeed require the remapping to ensure the check operates on GPIO numbers.
Related links
Fixes #10367 on 2.x (legacy) cores.
See also #10373 for the same fix on 3.x (current) cores.
Description of Change
The
digitalPinToInterrupt()
macro currently remaps the pin number to the GPIO number. This is not necessary, as most users will then use the returned value inattachInterrupt()
or other similar API functions, which already perform the same remapping.The first half of the macro (the condition) does indeed require the remapping to ensure the check operates on GPIO numbers.
Related links
Fixes #10367 on 2.x (legacy) cores. See also #10373 for the same fix on 3.x (current) cores.