Skip to content

Fix SPI Clocks for SD Library #205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from May 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions libraries/SD/src/utility/Sd2Card.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions libraries/SD/src/utility/Sd2Card.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down