Browse Source

disable interrupts during usingInterrupt() on AVR

main
PaulStoffregen 10 years ago
parent
commit
d0eca0a3f3
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      SPI.cpp

+ 4
- 3
SPI.cpp View File



void SPIClass::usingInterrupt(uint8_t interruptNumber) void SPIClass::usingInterrupt(uint8_t interruptNumber)
{ {
uint8_t mask;
uint8_t stmp, mask;


if (interruptMode > 1) return; if (interruptMode > 1) return;


stmp = SREG;
noInterrupts(); noInterrupts();
switch (interruptNumber) { switch (interruptNumber) {
#ifdef SPI_INT0_MASK #ifdef SPI_INT0_MASK
#endif #endif
default: default:
interruptMode = 2; interruptMode = 2;
interrupts();
SREG = stmp;
return; return;
} }
interruptMode = 1; interruptMode = 1;
interruptMask |= mask; interruptMask |= mask;
interrupts();
SREG = stmp;
} }





Loading…
Cancel
Save