diff --git a/SDBlockDevice.cpp b/SDBlockDevice.cpp index a86cb8f..8de7d9b 100644 --- a/SDBlockDevice.cpp +++ b/SDBlockDevice.cpp @@ -151,8 +151,16 @@ #warning "mbed-os version 5.6.1 or above required" #endif -#define SD_COMMAND_TIMEOUT 5000 /*!< Timeout in ms for response */ -#define SD_CMD0_GO_IDLE_STATE_RETRIES 5 /*!< Number of retries for sending CMDO */ +#ifndef MBED_CONF_SD_CMD_TIMEOUT +#define MBED_CONF_SD_CMD_TIMEOUT 5000 /*!< Timeout in ms for response */ +#endif + +#ifndef MBED_CONF_SD_CMD0_IDLE_STATE_RETRIES +#define MBED_CONF_SD_CMD0_IDLE_STATE_RETRIES 5 /*!< Number of retries for sending CMDO */ +#endif + +#define SD_COMMAND_TIMEOUT MBED_CONF_SD_CMD_TIMEOUT +#define SD_CMD0_GO_IDLE_STATE_RETRIES MBED_CONF_SD_CMD0_IDLE_STATE_RETRIES #define SD_DBG 0 /*!< 1 - Enable debugging */ #define SD_CMD_TRACE 0 /*!< 1 - Enable SD command tracing */ diff --git a/config/mbed_lib.json b/config/mbed_lib.json index d146d55..e4bddc9 100644 --- a/config/mbed_lib.json +++ b/config/mbed_lib.json @@ -6,7 +6,9 @@ "SPI_MISO": "D12", "SPI_CLK": "D13", "DEVICE_SPI": 1, - "FSFAT_SDCARD_INSTALLED": 1 + "FSFAT_SDCARD_INSTALLED": 1, + "CMD_TIMEOUT": 5000, + "CMD0_IDLE_STATE_RETRIES" : 5 }, "target_overrides": { "DISCO_F051R8": {