Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

digitalPinToInterrupt: fix double pin remapping on 2.x cores #10372

Merged

Conversation

pillo79
Copy link
Contributor

@pillo79 pillo79 commented Sep 25, 2024

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 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.

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.

Fixes espressif#10367.
@pillo79 pillo79 marked this pull request as ready for review September 25, 2024 10:48
@me-no-dev me-no-dev merged commit f23914e into espressif:release/v2.x Sep 25, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants