Skip to content

Commit 10aac9f

Browse files
author
Deepika
authored
Merge pull request ARMmbed#86 from ARMmbed/config_options
Config options for timeout and retries for CMD
2 parents f4ab55d + af48ce3 commit 10aac9f

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

SDBlockDevice.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,16 @@
151151
#warning "mbed-os version 5.6.1 or above required"
152152
#endif
153153

154-
#define SD_COMMAND_TIMEOUT 5000 /*!< Timeout in ms for response */
155-
#define SD_CMD0_GO_IDLE_STATE_RETRIES 5 /*!< Number of retries for sending CMDO */
154+
#ifndef MBED_CONF_SD_CMD_TIMEOUT
155+
#define MBED_CONF_SD_CMD_TIMEOUT 5000 /*!< Timeout in ms for response */
156+
#endif
157+
158+
#ifndef MBED_CONF_SD_CMD0_IDLE_STATE_RETRIES
159+
#define MBED_CONF_SD_CMD0_IDLE_STATE_RETRIES 5 /*!< Number of retries for sending CMDO */
160+
#endif
161+
162+
#define SD_COMMAND_TIMEOUT MBED_CONF_SD_CMD_TIMEOUT
163+
#define SD_CMD0_GO_IDLE_STATE_RETRIES MBED_CONF_SD_CMD0_IDLE_STATE_RETRIES
156164
#define SD_DBG 0 /*!< 1 - Enable debugging */
157165
#define SD_CMD_TRACE 0 /*!< 1 - Enable SD command tracing */
158166

config/mbed_lib.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"SPI_MISO": "D12",
77
"SPI_CLK": "D13",
88
"DEVICE_SPI": 1,
9-
"FSFAT_SDCARD_INSTALLED": 1
9+
"FSFAT_SDCARD_INSTALLED": 1,
10+
"CMD_TIMEOUT": 5000,
11+
"CMD0_IDLE_STATE_RETRIES" : 5
1012
},
1113
"target_overrides": {
1214
"DISCO_F051R8": {

0 commit comments

Comments
 (0)