Radio init / masstorage start / massstorage end / shutdown sequences … (#3674)
* Radio init / masstorage start / massstorage end / shutdown sequences reordering: - More traces - Fixes #3642 - Reuses idea of #3662 Still not finished and completely untested * More traces * Compilation fix * Reuses the idea of #3652 * Alarms were checked 2 times on massstorage end
This commit is contained in:
@@ -292,14 +292,22 @@ FATFS g_FATFS_Obj __DMA;
|
||||
FIL g_telemetryFile = {0};
|
||||
#endif
|
||||
|
||||
void sdInit(void)
|
||||
void sdInit()
|
||||
{
|
||||
TRACE("sdInit");
|
||||
|
||||
ioMutex = CoCreateMutex();
|
||||
if (ioMutex >= CFG_MAX_MUTEX ) {
|
||||
if (ioMutex >= CFG_MAX_MUTEX) {
|
||||
// sd error
|
||||
return;
|
||||
}
|
||||
sdMount();
|
||||
}
|
||||
|
||||
void sdMount()
|
||||
{
|
||||
TRACE("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
|
||||
sdGetFreeSectors();
|
||||
@@ -320,6 +328,8 @@ void sdInit(void)
|
||||
|
||||
void sdDone()
|
||||
{
|
||||
TRACE("sdDone");
|
||||
|
||||
if (sdMounted()) {
|
||||
audioQueue.stopSD();
|
||||
#if defined(LOG_TELEMETRY)
|
||||
|
||||
Reference in New Issue
Block a user