1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-14 11:59:58 +03:00

Revive visual indication of gyro detection failure

This commit is contained in:
jflyper 2017-06-30 14:33:35 +09:00
parent 02e0d2e1c4
commit 2c7970a9ed
3 changed files with 10 additions and 3 deletions

View file

@ -164,9 +164,8 @@ void delay(uint32_t ms)
#define SHORT_FLASH_DURATION 50 #define SHORT_FLASH_DURATION 50
#define CODE_FLASH_DURATION 250 #define CODE_FLASH_DURATION 250
void failureMode(failureMode_e mode) void failureLedCode(failureMode_e mode, int codeRepeatsRemaining)
{ {
int codeRepeatsRemaining = 10;
int codeFlashesRemaining; int codeFlashesRemaining;
int shortFlashesRemaining; int shortFlashesRemaining;
@ -201,6 +200,12 @@ void failureMode(failureMode_e mode)
delay(1000); delay(1000);
} }
}
void failureMode(failureMode_e mode)
{
failureLedCode(mode, 10);
#ifdef DEBUG #ifdef DEBUG
systemReset(); systemReset();
#else #else

View file

@ -33,6 +33,7 @@ typedef enum {
} failureMode_e; } failureMode_e;
// failure // failure
void failureLedCode(failureMode_e mode, int repeatCount);
void failureMode(failureMode_e mode); void failureMode(failureMode_e mode);
// bootloader/IAP // bootloader/IAP

View file

@ -478,7 +478,8 @@ void init(void)
initBoardAlignment(boardAlignment()); initBoardAlignment(boardAlignment());
if (!sensorsAutodetect()) { 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); setArmingDisabled(ARMING_DISABLED_NO_GYRO);
} }