aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os/hal/src/sdc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/os/hal/src/sdc.c b/os/hal/src/sdc.c
index e3cf125dd..40006a6c1 100644
--- a/os/hal/src/sdc.c
+++ b/os/hal/src/sdc.c
@@ -965,18 +965,21 @@ bool sdcErase(SDCDriver *sdcp, uint32_t startblk, uint32_t endblk) {
if ((sdc_lld_send_cmd_short_crc(sdcp, MMCSD_CMD_ERASE_RW_BLK_START,
startblk, resp) != HAL_SUCCESS) ||
- MMCSD_R1_ERROR(resp[0]))
+ MMCSD_R1_ERROR(resp[0])) {
goto failed;
+ }
if ((sdc_lld_send_cmd_short_crc(sdcp, MMCSD_CMD_ERASE_RW_BLK_END,
endblk, resp) != HAL_SUCCESS) ||
- MMCSD_R1_ERROR(resp[0]))
+ MMCSD_R1_ERROR(resp[0])) {
goto failed;
+ }
if ((sdc_lld_send_cmd_short_crc(sdcp, MMCSD_CMD_ERASE,
0, resp) != HAL_SUCCESS) ||
- MMCSD_R1_ERROR(resp[0]))
+ MMCSD_R1_ERROR(resp[0])) {
goto failed;
+ }
/* Quick sleep to allow it to transition to programming or receiving state */
/* TODO: ??????????????????????????? */