Skip to content

Commit

Permalink
Merge pull request #86 from ARMmbed/config_options
Browse files Browse the repository at this point in the history
Config options for timeout and retries for CMD
  • Loading branch information
Deepika authored Mar 14, 2018
2 parents f4ab55d + af48ce3 commit 10aac9f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 10 additions & 2 deletions SDBlockDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
4 changes: 3 additions & 1 deletion config/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 10aac9f

Please sign in to comment.