fix(sdcard): apply the same fix as #2517 to NV14 (#2641)

This commit is contained in:
Raphael Coeffic
2022-10-31 09:17:37 +10:00
committed by GitHub
parent 58742b526e
commit e626a4e911
+4 -1
View File
@@ -313,7 +313,9 @@ DRESULT disk_ioctl (
// TODO everything here should not be in the driver layer ...
bool _g_FATFS_init = false;
FATFS g_FATFS_Obj __DMA; // initialized in boardInit()
#if defined(LOG_TELEMETRY)
FIL g_telemetryFile = {};
#endif
@@ -348,6 +350,7 @@ void sdMount()
if (f_mount(&g_FATFS_Obj, "", 1) == FR_OK) {
// call sdGetFreeSectors() now because f_getfree() takes a long time first time it's called
_g_FATFS_init = true;
sdGetFreeSectors();
#if defined(LOG_TELEMETRY)
@@ -378,7 +381,7 @@ void sdDone()
uint32_t sdMounted()
{
return g_FATFS_Obj.fs_type != 0;
return _g_FATFS_init && g_FATFS_Obj.fs_type != 0;
}
uint32_t sdIsHC()