[SC64][SW] Add missing cleanup during SD card initialization

This commit is contained in:
Mateusz Faderewski 2024-06-14 21:46:02 +02:00
parent e4af127e55
commit 903efe5353

View File

@ -408,14 +408,17 @@ sd_error_t sd_card_init (void) {
sd_cmd(7, 0, RSP_NONE, NULL); sd_cmd(7, 0, RSP_NONE, NULL);
if (sd_cmd(9, p.rca, RSP_R2, p.csd)) { if (sd_cmd(9, p.rca, RSP_R2, p.csd)) {
sd_card_deinit();
return SD_ERROR_CMD9_IO; return SD_ERROR_CMD9_IO;
} }
if (sd_cmd(10, p.rca, RSP_R2, p.cid)) { if (sd_cmd(10, p.rca, RSP_R2, p.cid)) {
sd_card_deinit();
return SD_ERROR_CMD10_IO; return SD_ERROR_CMD10_IO;
} }
if (sd_cmd(7, p.rca, RSP_R1b, NULL)) { if (sd_cmd(7, p.rca, RSP_R1b, NULL)) {
sd_card_deinit();
return SD_ERROR_CMD7_IO; return SD_ERROR_CMD7_IO;
} }