diff --git a/src/main/drivers/system.c b/src/main/drivers/system.c index eee2069d21..b27a917d9d 100644 --- a/src/main/drivers/system.c +++ b/src/main/drivers/system.c @@ -164,9 +164,8 @@ void delay(uint32_t ms) #define SHORT_FLASH_DURATION 50 #define CODE_FLASH_DURATION 250 -void failureMode(failureMode_e mode) +void failureLedCode(failureMode_e mode, int codeRepeatsRemaining) { - int codeRepeatsRemaining = 10; int codeFlashesRemaining; int shortFlashesRemaining; @@ -201,6 +200,12 @@ void failureMode(failureMode_e mode) delay(1000); } +} + +void failureMode(failureMode_e mode) +{ + failureLedCode(mode, 10); + #ifdef DEBUG systemReset(); #else diff --git a/src/main/drivers/system.h b/src/main/drivers/system.h index b898c99010..4a5b83535d 100644 --- a/src/main/drivers/system.h +++ b/src/main/drivers/system.h @@ -33,6 +33,7 @@ typedef enum { } failureMode_e; // failure +void failureLedCode(failureMode_e mode, int repeatCount); void failureMode(failureMode_e mode); // bootloader/IAP diff --git a/src/main/fc/fc_init.c b/src/main/fc/fc_init.c index 06e74a50be..7a4bb09c38 100644 --- a/src/main/fc/fc_init.c +++ b/src/main/fc/fc_init.c @@ -478,7 +478,8 @@ void init(void) initBoardAlignment(boardAlignment()); if (!sensorsAutodetect()) { - // if gyro was not detected due to whatever reason, don't arm. + // if gyro was not detected due to whatever reason, notify and don't arm. + failureLedCode(FAILURE_MISSING_ACC, 2); setArmingDisabled(ARMING_DISABLED_NO_GYRO); }