From 11cf45d6d6e9856433dd66329522336262876a61 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 10 Sep 2014 15:21:18 +0200 Subject: [PATCH] Fix indent and small cosmetic changes --- hardware/arduino/sam/libraries/SPI/SPI.cpp | 28 +++++++++++----------- hardware/arduino/sam/libraries/SPI/SPI.h | 4 +--- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/hardware/arduino/sam/libraries/SPI/SPI.cpp b/hardware/arduino/sam/libraries/SPI/SPI.cpp index ee70e4272..8aa01c5d9 100644 --- a/hardware/arduino/sam/libraries/SPI/SPI.cpp +++ b/hardware/arduino/sam/libraries/SPI/SPI.cpp @@ -62,12 +62,12 @@ void SPIClass::init() { #define interruptsStatus() __interruptsStatus() static inline unsigned char __interruptsStatus(void) __attribute__((always_inline, unused)); static inline unsigned char __interruptsStatus(void) { - unsigned int primask, faultmask; - asm volatile ("mrs %0, primask" : "=r" (primask)); - if (primask) return 0; - asm volatile ("mrs %0, faultmask" : "=r" (faultmask)); - if (faultmask) return 0; - return 1; + unsigned int primask, faultmask; + asm volatile ("mrs %0, primask" : "=r" (primask)); + if (primask) return 0; + asm volatile ("mrs %0, faultmask" : "=r" (faultmask)); + if (faultmask) return 0; + return 1; } #endif @@ -182,18 +182,18 @@ byte SPIClass::transfer(byte _pin, uint8_t _data, SPITransferMode _mode) { d |= SPI_TDR_LASTXFER; // SPI_Write(spi, _channel, _data); - while ((spi->SPI_SR & SPI_SR_TDRE) == 0) - ; - spi->SPI_TDR = d; + while ((spi->SPI_SR & SPI_SR_TDRE) == 0) + ; + spi->SPI_TDR = d; - // return SPI_Read(spi); - while ((spi->SPI_SR & SPI_SR_RDRF) == 0) - ; - d = spi->SPI_RDR; + // return SPI_Read(spi); + while ((spi->SPI_SR & SPI_SR_RDRF) == 0) + ; + d = spi->SPI_RDR; // Reverse bit order if (bitOrder[ch] == LSBFIRST) d = __REV(__RBIT(d)); - return d & 0xFF; + return d & 0xFF; } void SPIClass::attachInterrupt(void) { diff --git a/hardware/arduino/sam/libraries/SPI/SPI.h b/hardware/arduino/sam/libraries/SPI/SPI.h index efb7afe74..58162b327 100644 --- a/hardware/arduino/sam/libraries/SPI/SPI.h +++ b/hardware/arduino/sam/libraries/SPI/SPI.h @@ -336,10 +336,8 @@ class SPIClass { // Transaction Functions void usingInterrupt(uint8_t interruptNumber); + void beginTransaction(SPISettings settings) { beginTransaction(BOARD_SPI_DEFAULT_SS, settings); } void beginTransaction(uint8_t pin, SPISettings settings); - void beginTransaction(SPISettings settings) { - beginTransaction(BOARD_SPI_DEFAULT_SS, settings); - } void endTransaction(void); // SPI Configuration methods