Browse Source

Fix bugs on Arduino Due version

main
PaulStoffregen 10 years ago
parent
commit
4416fbe4fb
2 changed files with 12 additions and 1 deletions
  1. +11
    -0
      SPI.cpp
  2. +1
    -1
      SPI.h

+ 11
- 0
SPI.cpp View File

initialized = true; initialized = true;
} }


#ifndef interruptsStatus
#define interruptsStatus() __interruptsStatus()
static inline unsigned char __interruptsStatus(void) __attribute__((always_inline, unused));
static inline unsigned char __interruptsStatus(void) {
unsigned int primask;
asm volatile ("mrs %0, primask" : "=r" (primask));
if (primask) return 0;
return 1;
}
#endif

void SPIClass::usingInterrupt(uint8_t interruptNumber) void SPIClass::usingInterrupt(uint8_t interruptNumber)
{ {
uint8_t irestore; uint8_t irestore;

+ 1
- 1
SPI.h View File

} }
*/ */
} else { } else {
for (div=2; i<255; i++) {
for (div=2; div<255; div++) {
if (clock >= F_CPU / div) break; if (clock >= F_CPU / div) break;
} }
} }

Loading…
Cancel
Save