1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

Indicate failure when CONFIG_IN_SDCARD is used and no SD card is

inserted.
This commit is contained in:
Dominic Clifton 2021-05-05 21:22:17 +02:00
parent 2a5e457603
commit e0f2b89828
2 changed files with 5 additions and 0 deletions

View file

@ -42,6 +42,7 @@ typedef enum {
FAILURE_SDCARD_READ_FAILED,
FAILURE_SDCARD_WRITE_FAILED,
FAILURE_SDCARD_INITIALISATION_FAILED,
FAILURE_SDCARD_REQUIRED,
} failureMode_e;
#define WARNING_FLASH_DURATION_MS 50

View file

@ -374,6 +374,10 @@ void init(void)
sdCardAndFSInit();
initFlags |= SD_INIT_ATTEMPTED;
if (!sdcard_isInserted()) {
failureMode(FAILURE_SDCARD_REQUIRED);
}
while (afatfs_getFilesystemState() != AFATFS_FILESYSTEM_STATE_READY) {
afatfs_poll();