diff --git a/src/main/drivers/system.h b/src/main/drivers/system.h index 0122eb504a..a794280795 100644 --- a/src/main/drivers/system.h +++ b/src/main/drivers/system.h @@ -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 diff --git a/src/main/fc/init.c b/src/main/fc/init.c index eee71bd7a6..900c96cdee 100644 --- a/src/main/fc/init.c +++ b/src/main/fc/init.c @@ -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();