arduino / arduino/ArduinoCore-samd
Changes to attachInterrupt() prevent pin set-up with NULL callback pointer
- Dominant language
- C
- Stars
- 502
- Forks
- 740
- PR merge metrics
- No merged PRs in 30d
Description
Changes to the attachInterrupt() function code prevents the pin from being set-up when a NULL pointer callback is detected.
The older attachInterrupt() code allowed for both, enabling the attachInterrupt() to be used for setting up events on the SAMD21's event system, with the callback argument being passed as NULL or 0. Unfortunately, this is now not possible.
The event system can be used to allow pin interrupts to trigger TCC timer capture, please see Arduino Zero forum thread: [https://forum.arduino.cc/index.php?topic=396804.0](https://forum.arduino.cc/index.php?topic=396804.0). The change to attachInterrupt() breaks most of the code examples on this thread.
The workaround is to use a dummy callback in place on the NULL, this solution however is rather inelegant.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the SAMD21 attachInterrupt() implementation and compare its handling of a NULL callback with the older behavior described in the issue. Trace the event-system setup path and verify that a NULL or 0 callback still permits pin setup for TCC timer capture, while normal callbacks continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100