From 903efe535316d0ea4a007db0c594246dce3a7fe4 Mon Sep 17 00:00:00 2001 From: Mateusz Faderewski Date: Fri, 14 Jun 2024 21:46:02 +0200 Subject: [PATCH] [SC64][SW] Add missing cleanup during SD card initialization --- sw/controller/src/sd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sw/controller/src/sd.c b/sw/controller/src/sd.c index 8565d2f..f6e94b3 100644 --- a/sw/controller/src/sd.c +++ b/sw/controller/src/sd.c @@ -408,14 +408,17 @@ sd_error_t sd_card_init (void) { sd_cmd(7, 0, RSP_NONE, NULL); if (sd_cmd(9, p.rca, RSP_R2, p.csd)) { + sd_card_deinit(); return SD_ERROR_CMD9_IO; } if (sd_cmd(10, p.rca, RSP_R2, p.cid)) { + sd_card_deinit(); return SD_ERROR_CMD10_IO; } if (sd_cmd(7, p.rca, RSP_R1b, NULL)) { + sd_card_deinit(); return SD_ERROR_CMD7_IO; }