mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
Prevent the system from booting when EEPROM_IN_FLASH is used and the
flash chip is not detected. This will ensure that the flash config partition will always be present when requested.
This commit is contained in:
parent
720132b2af
commit
45f8168b60
2 changed files with 7 additions and 2 deletions
|
@ -33,7 +33,8 @@ typedef enum {
|
|||
FAILURE_INVALID_EEPROM_CONTENTS,
|
||||
FAILURE_FLASH_WRITE_FAILED,
|
||||
FAILURE_GYRO_INIT_FAILED,
|
||||
FAILURE_FLASH_READ_FAILED
|
||||
FAILURE_FLASH_READ_FAILED,
|
||||
FAILURE_EXTERNAL_FLASH_INIT_FAILED
|
||||
} failureMode_e;
|
||||
|
||||
#define WARNING_FLASH_DURATION_MS 50
|
||||
|
|
|
@ -324,7 +324,11 @@ void init(void)
|
|||
#error "EEPROM_IN_EXTERNAL_FLASH requires USE_FLASH_CHIP to be defined."
|
||||
#endif
|
||||
|
||||
flashInit(flashConfig());
|
||||
bool haveFlash = flashInit(flashConfig());
|
||||
|
||||
if (!haveFlash) {
|
||||
failureMode(FAILURE_EXTERNAL_FLASH_INIT_FAILED);
|
||||
}
|
||||
|
||||
#endif // EEPROM_IN_EXTERNAL_FLASH
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue