@@ -313,7 +313,9 @@ DRESULT disk_ioctl (
|
|||||||
|
|
||||||
// TODO everything here should not be in the driver layer ...
|
// TODO everything here should not be in the driver layer ...
|
||||||
|
|
||||||
|
bool _g_FATFS_init = false;
|
||||||
FATFS g_FATFS_Obj __DMA; // initialized in boardInit()
|
FATFS g_FATFS_Obj __DMA; // initialized in boardInit()
|
||||||
|
|
||||||
#if defined(LOG_TELEMETRY)
|
#if defined(LOG_TELEMETRY)
|
||||||
FIL g_telemetryFile = {};
|
FIL g_telemetryFile = {};
|
||||||
#endif
|
#endif
|
||||||
@@ -348,6 +350,7 @@ void sdMount()
|
|||||||
|
|
||||||
if (f_mount(&g_FATFS_Obj, "", 1) == FR_OK) {
|
if (f_mount(&g_FATFS_Obj, "", 1) == FR_OK) {
|
||||||
// call sdGetFreeSectors() now because f_getfree() takes a long time first time it's called
|
// call sdGetFreeSectors() now because f_getfree() takes a long time first time it's called
|
||||||
|
_g_FATFS_init = true;
|
||||||
sdGetFreeSectors();
|
sdGetFreeSectors();
|
||||||
|
|
||||||
#if defined(LOG_TELEMETRY)
|
#if defined(LOG_TELEMETRY)
|
||||||
@@ -378,7 +381,7 @@ void sdDone()
|
|||||||
|
|
||||||
uint32_t sdMounted()
|
uint32_t sdMounted()
|
||||||
{
|
{
|
||||||
return g_FATFS_Obj.fs_type != 0;
|
return _g_FATFS_init && g_FATFS_Obj.fs_type != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t sdIsHC()
|
uint32_t sdIsHC()
|
||||||
|
|||||||
Reference in New Issue
Block a user