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:
parent
2a5e457603
commit
e0f2b89828
2 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue