mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 08:15:30 +03:00
First cut of unit tests for reworked failsafe.
In writing these tests a bug was discovered with RX_SERIAL and RX_MSP failsafe delay timing - the configured delays are not honoured.
This commit is contained in:
parent
022d6247cb
commit
eb74735ee8
3 changed files with 290 additions and 3 deletions
|
@ -59,14 +59,14 @@ void useFailsafeConfig(failsafeConfig_t *failsafeConfigToUse)
|
|||
failsafeReset();
|
||||
}
|
||||
|
||||
failsafeState_t* failsafeInit(rxConfig_t *intialRxConfig)
|
||||
void failsafeInit(rxConfig_t *intialRxConfig)
|
||||
{
|
||||
rxConfig = intialRxConfig;
|
||||
|
||||
failsafeState.events = 0;
|
||||
failsafeState.monitoring = false;
|
||||
|
||||
return &failsafeState;
|
||||
return;
|
||||
}
|
||||
|
||||
failsafePhase_e failsafePhase()
|
||||
|
@ -101,7 +101,7 @@ static bool failsafeHasTimerElapsed(void)
|
|||
return failsafeState.counter > (5 * failsafeConfig->failsafe_delay);
|
||||
}
|
||||
|
||||
bool failsafeShouldForceLanding(bool armed)
|
||||
static bool failsafeShouldForceLanding(bool armed)
|
||||
{
|
||||
return failsafeHasTimerElapsed() && armed;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue