mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 22:35:23 +03:00
Split rx processing into three states to eliminate cycle time jitter
Allow tasks with state machines to control which state determines task duration Fix unit tests
This commit is contained in:
parent
bc4372588b
commit
25fcacf4c5
11 changed files with 89 additions and 20 deletions
|
@ -744,11 +744,6 @@ bool isAirmodeActivated()
|
|||
*/
|
||||
bool processRx(timeUs_t currentTimeUs)
|
||||
{
|
||||
static bool armedBeeperOn = false;
|
||||
#ifdef USE_TELEMETRY
|
||||
static bool sharedPortTelemetryEnabled = false;
|
||||
#endif
|
||||
|
||||
timeDelta_t frameAgeUs;
|
||||
timeDelta_t frameDeltaUs = rxGetFrameDelta(&frameAgeUs);
|
||||
|
||||
|
@ -891,6 +886,17 @@ bool processRx(timeUs_t currentTimeUs)
|
|||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void processRxModes(timeUs_t currentTimeUs)
|
||||
{
|
||||
static bool armedBeeperOn = false;
|
||||
#ifdef USE_TELEMETRY
|
||||
static bool sharedPortTelemetryEnabled = false;
|
||||
#endif
|
||||
const throttleStatus_e throttleStatus = calculateThrottleStatus();
|
||||
|
||||
// When armed and motors aren't spinning, do beeps and then disarm
|
||||
// board after delay so users without buzzer won't lose fingers.
|
||||
// mixTable constrains motor commands, so checking throttleStatus is enough
|
||||
|
@ -1082,8 +1088,6 @@ bool processRx(timeUs_t currentTimeUs)
|
|||
#endif
|
||||
|
||||
pidSetAntiGravityState(IS_RC_MODE_ACTIVE(BOXANTIGRAVITY) || featureIsEnabled(FEATURE_ANTI_GRAVITY));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static FAST_CODE void subTaskPidController(timeUs_t currentTimeUs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue