Browse Source

Fix beginTransaction call for Standard SPI library

main
Bill Greiman 8 years ago
parent
commit
d2a2f91ff0
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      SdFat/src/SdSpiCard/SdSpi.h

+ 4
- 4
SdFat/src/SdSpiCard/SdSpi.h View File

@@ -156,12 +156,11 @@ class SdSpiLib {
*/
void beginTransaction(uint8_t divisor) {
#if ENABLE_SPI_TRANSACTIONS
SPI.beginTransaction(SPISettings());
#else // #if ENABLE_SPI_TRANSACTIONS
SPISettings settings(F_CPU/(divisor ? divisor : 1), MSBFIRST, SPI_MODE0);
SPI.beginTransaction(settings);
#else // ENABLE_SPI_TRANSACTIONS
SPI.setBitOrder(MSBFIRST);
SPI.setDataMode(SPI_MODE0);
#endif // #if ENABLE_SPI_TRANSACTIONS

#ifndef SPI_CLOCK_DIV128
SPI.setClockDivider(divisor);
#else // SPI_CLOCK_DIV128
@@ -183,6 +182,7 @@ class SdSpiLib {
}
SPI.setClockDivider(v);
#endif // SPI_CLOCK_DIV128
#endif // ENABLE_SPI_TRANSACTIONS
}
/**
* End SPI transaction.

Loading…
Cancel
Save