From f95ad1729ef665f7af5cc1492e12ae50927d8106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Sat, 31 Dec 2022 20:29:22 +0100 Subject: [PATCH] Fix buf on sd mounting handling --- stm-firmware/sd.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/stm-firmware/sd.c b/stm-firmware/sd.c index a8f3220..eee16e2 100644 --- a/stm-firmware/sd.c +++ b/stm-firmware/sd.c @@ -37,7 +37,8 @@ bool mount_sd_card_if_avail(FATFS *fs) memset(fs, 0, sizeof(FATFS)); sdio_stop_clk(); inserted_counter = 0; - return false; + sd_card_mounted_state = false; + goto ret; } if (!sdio_check_inserted() && inserted_counter < 255) @@ -48,12 +49,13 @@ bool mount_sd_card_if_avail(FATFS *fs) res = f_mount(fs, "0:/", 1); if (res == FR_OK) { led_set(1, 1); - return true; + sd_card_mounted_state = true; } else { - return false; + sd_card_mounted_state = false; } } +ret: return sd_card_mounted_state; }