From 1a971dca3bdb4ba4dc2ec3fcca12ce16f03eb53e Mon Sep 17 00:00:00 2001 From: asi345 Date: Thu, 31 Oct 2024 11:28:52 +0100 Subject: [PATCH] sdcard: improvement on reinsertion fix Signed-off-by: asi345 --- src/sd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sd.c b/src/sd.c index 201aea368..2b281d27f 100644 --- a/src/sd.c +++ b/src/sd.c @@ -108,14 +108,14 @@ static bool _mount(void) sd_mmc_resume_clock(); #endif memset(&fs, 0, sizeof(FATFS)); - int res = f_mount(&fs, "", 1); + FRESULT res = f_mount(&fs, "", 1); if (res == FR_DISK_ERR) { #ifndef TESTING sd_mmc_start(); #endif res = f_mount(&fs, "", 1); } - if (res == FR_INVALID_DRIVE) { + if (res != FR_OK) { #ifndef TESTING sd_mmc_pause_clock(); #endif