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
{{ message }}
Repository navigation
Should SPI attachInterrupt() and detachInterrupt() be removed? #183
// These undocumented functions should not be used. SPI.transfer()// polls the hardware flag which is automatically cleared as the// AVR responds to SPI's interruptinlinestaticvoidattachInterrupt() { SPCR |= _BV(SPIE); }
inlinestaticvoiddetachInterrupt() { SPCR &= ~_BV(SPIE); }
Other cores do nothing or even do not implement it:
From a quick glance at the AVR SPI library, the actual ISR is not implement anywhere, which I think means that calling attachInterrupt() will cause the system to lock up the next time an SPI interrupt is triggered (since the default ISR just has an infinite loop IIRC). Sounds like removing these would indeed make sense - the only case these methods could be "useful" is when a sketch also implements the ISR itself, but those are very specific and advanced sketches that can also just modify SPCR directly.
Activity
matthijskooijman commentedon Feb 27, 2023
From a quick glance at the AVR SPI library, the actual ISR is not implement anywhere, which I think means that calling
attachInterrupt()will cause the system to lock up the next time an SPI interrupt is triggered (since the default ISR just has an infinite loop IIRC). Sounds like removing these would indeed make sense - the only case these methods could be "useful" is when a sketch also implements the ISR itself, but those are very specific and advanced sketches that can also just modifySPCRdirectly.