mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Adapted RX suspend & resume on EEPROM read & write
Modified to make mechanism use time instead of counters for call frequency independency. Skipping RC samples uses a counter for time independency. Also LED and beeper patterns were changed by previous implementation. Corrected with RX supend/resume feedback to failsafe system.
This commit is contained in:
parent
9208b8701a
commit
5ca5c2d161
3 changed files with 27 additions and 4 deletions
|
@ -132,6 +132,17 @@ bool failsafeIsReceivingRxData(void)
|
|||
return (failsafeState.rxLinkState == FAILSAFE_RXLINK_UP);
|
||||
}
|
||||
|
||||
void failsafeOnRxSuspend(uint32_t usSuspendPeriod)
|
||||
{
|
||||
failsafeState.validRxDataReceivedAt += (usSuspendPeriod / 1000); // / 1000 to convert micros to millis
|
||||
}
|
||||
|
||||
void failsafeOnRxResume(void)
|
||||
{
|
||||
failsafeState.validRxDataReceivedAt = millis(); // prevent RX link down trigger, restart rx link up
|
||||
failsafeState.rxLinkState = FAILSAFE_RXLINK_UP; // do so while rx link is up
|
||||
}
|
||||
|
||||
void failsafeOnValidDataReceived(void)
|
||||
{
|
||||
failsafeState.validRxDataReceivedAt = millis();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue