Should SPI `attachInterrupt()` and `detachInterrupt()` be removed?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Refactor
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- api, embedded-iot
Research direction
Compare the SPI declarations and implementations linked for ArduinoCore-avr, megaavr, samd, mbed, arc32, and sam. Start by checking how attachInterrupt() and detachInterrupt() are defined or omitted across those cores and whether the API contract explains their purpose. Done means reaching a documented decision on their supported status and identifying the affected core files.
Written by the indexing model from the issue text.
Description
It looks like these methos are only used in the AVR ports, and even then they indicate that they should not be used.
ArduinoCore-avr/libraries/SPI/src/SPI.h#L306-L310
ArduinoCore-megaavr/libraries/SPI/src/SPI.h#L183-L187
// These undocumented functions should not be used. SPI.transfer()
// polls the hardware flag which is automatically cleared as the
// AVR responds to SPI's interrupt
inline static void attachInterrupt() { SPCR |= _BV(SPIE); }
inline static void detachInterrupt() { SPCR &= ~_BV(SPIE); }
Other cores do nothing or even do not implement it:
- ArduinoCore-samd/libraries/SPI/SPI.cpp#L267-L273
- ArduinoCore-mbed/libraries/SPI/SPI.cpp#L90-L96
- ArduinoCore-arc32/libraries/SPI/src/SPI.h
- ArduinoCore-sam/libraries/SPI/src/SPI.cpp
When are these methods meant to be used by Arduino users or ArduinoCore developers?
- Dominant language
- C++
- Stars
- 306
- Forks
- 150
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from arduino/ArduinoCore-API
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
arduino/ArduinoCore-API#261 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 30/100
arduino/ArduinoCore-API#256 ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 48/100
arduino/ArduinoCore-API#251 · 1 comment ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
arduino/ArduinoCore-API#250 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
arduino/ArduinoCore-API#249 ·
All issues in arduino/ArduinoCore-API
Similar issues
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 88/100
QuantStack/git2cpp#187 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100