1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-06 05:21:22 +03:00

Merge pull request #205 from ficeto/esp8266

Fix SPI Clocks for SD Library
This commit is contained in:
Ivan Grokhotkov 2015-05-08 22:43:55 +03:00
commit 6317355049
2 changed files with 3 additions and 7 deletions

View File

@ -270,11 +270,7 @@ uint8_t Sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin) {
SPSR &= ~(1 << SPI2X);
#else // USE_SPI_LIB
SPI.begin();
#ifdef ESP8266
settings = SPISettings(SPI_CLOCK_DIV64, MSBFIRST, SPI_MODE0);
#else
settings = SPISettings(250000, MSBFIRST, SPI_MODE0);
#endif
#endif // USE_SPI_LIB
#endif // SOFTWARE_SPI

View File

@ -28,9 +28,9 @@
#ifdef ESP8266
#include "SPI.h"
uint32_t const SPI_FULL_SPEED = SPI_CLOCK_DIV2;
uint32_t const SPI_HALF_SPEED = SPI_CLOCK_DIV4;
uint32_t const SPI_QUARTER_SPEED = SPI_CLOCK_DIV8;
uint32_t const SPI_FULL_SPEED = 8000000;
uint32_t const SPI_HALF_SPEED = 4000000;
uint32_t const SPI_QUARTER_SPEED = 2000000;
#else
/** Set SCK to max rate of F_CPU/2. See Sd2Card::setSckRate(). */
uint8_t const SPI_FULL_SPEED = 0;