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:
commit
6317355049
@ -270,11 +270,7 @@ uint8_t Sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin) {
|
|||||||
SPSR &= ~(1 << SPI2X);
|
SPSR &= ~(1 << SPI2X);
|
||||||
#else // USE_SPI_LIB
|
#else // USE_SPI_LIB
|
||||||
SPI.begin();
|
SPI.begin();
|
||||||
#ifdef ESP8266
|
|
||||||
settings = SPISettings(SPI_CLOCK_DIV64, MSBFIRST, SPI_MODE0);
|
|
||||||
#else
|
|
||||||
settings = SPISettings(250000, MSBFIRST, SPI_MODE0);
|
settings = SPISettings(250000, MSBFIRST, SPI_MODE0);
|
||||||
#endif
|
|
||||||
#endif // USE_SPI_LIB
|
#endif // USE_SPI_LIB
|
||||||
#endif // SOFTWARE_SPI
|
#endif // SOFTWARE_SPI
|
||||||
|
|
||||||
|
@ -28,9 +28,9 @@
|
|||||||
|
|
||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
#include "SPI.h"
|
#include "SPI.h"
|
||||||
uint32_t const SPI_FULL_SPEED = SPI_CLOCK_DIV2;
|
uint32_t const SPI_FULL_SPEED = 8000000;
|
||||||
uint32_t const SPI_HALF_SPEED = SPI_CLOCK_DIV4;
|
uint32_t const SPI_HALF_SPEED = 4000000;
|
||||||
uint32_t const SPI_QUARTER_SPEED = SPI_CLOCK_DIV8;
|
uint32_t const SPI_QUARTER_SPEED = 2000000;
|
||||||
#else
|
#else
|
||||||
/** Set SCK to max rate of F_CPU/2. See Sd2Card::setSckRate(). */
|
/** Set SCK to max rate of F_CPU/2. See Sd2Card::setSckRate(). */
|
||||||
uint8_t const SPI_FULL_SPEED = 0;
|
uint8_t const SPI_FULL_SPEED = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user