From 4948bf5650ec9a5a3638c57167ba8212e8c46242 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 21 Oct 2014 13:12:25 +0200 Subject: [avr] Added SPI.notUsingInterrupt() (Andrew Kroll) --- libraries/SPI/SPI.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libraries/SPI/SPI.h') diff --git a/libraries/SPI/SPI.h b/libraries/SPI/SPI.h index c8d4ce3..2f9b565 100644 --- a/libraries/SPI/SPI.h +++ b/libraries/SPI/SPI.h @@ -20,6 +20,9 @@ // usingInterrupt(), and SPISetting(clock, bitOrder, dataMode) #define SPI_HAS_TRANSACTION 1 +// SPI_HAS_NOTUSINGINTERRUPT means that SPI has notUsingInterrupt() method +#define SPI_HAS_NOTUSINGINTERRUPT 1 + // Uncomment this line to add detection of mismatched begin/end transactions. // A mismatch occurs if other libraries fail to use SPI.endTransaction() for // each SPI.beginTransaction(). Connect an LED to this pin. The LED will turn @@ -154,6 +157,13 @@ public: // with attachInterrupt. If SPI is used from a different interrupt // (eg, a timer), interruptNumber should be 255. static void usingInterrupt(uint8_t interruptNumber); + // And this does the opposite. + static void notUsingInterrupt(uint8_t interruptNumber); + // Note: the usingInterrupt and notUsingInterrupt functions should + // not to be called from ISR context or inside a transaction. + // For details see: + // https://github.com/arduino/Arduino/pull/2381 + // https://github.com/arduino/Arduino/pull/2449 // Before using SPI.transfer() or asserting chip select pins, // this function is used to gain exclusive access to the SPI bus -- cgit v1.2.3-18-g5258