Skip to content

Should SPI attachInterrupt() and detachInterrupt() be removed? #183

Open
@carlosperate

Description

@carlosperate

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:

When are these methods meant to be used by Arduino users or ArduinoCore developers?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions