diff --git a/sdcard.c b/sdcard.c index fbd7cad..10cf3c5 100644 --- a/sdcard.c +++ b/sdcard.c @@ -61,6 +61,8 @@ uint8_t SD_init() SD_readOCR(res); + SPI_init(SPI_MASTER | SPI_2X_FOSC_2 | SPI_MODE_0); + return SD_SUCCESS; } diff --git a/sdcard.h b/sdcard.h index eb6e418..3d9bcee 100644 --- a/sdcard.h +++ b/sdcard.h @@ -42,7 +42,7 @@ #define CMD55_MAX_ATTEMPTS 255 #define SD_ERROR 1 #define SD_SUCCESS 0 -#define SD_MAX_READ_ATTEMPTS 1563 +#define SD_MAX_READ_ATTEMPTS 3907 #define SD_READ_START_TOKEN 0xFE #define SD_INIT_CYCLES 80