1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-21 15:25:36 +03:00

Report task rate/Hz based on execution of whole state machine, not individual states where appropriate

This commit is contained in:
Steve Evans 2021-03-31 22:57:04 +01:00
parent 07c32e7302
commit 3087d10f53
4 changed files with 18 additions and 13 deletions

View file

@ -170,18 +170,20 @@ bool taskUpdateRxMainInProgress()
static void taskUpdateRxMain(timeUs_t currentTimeUs)
{
// Where we are using a state machine call ignoreTaskTime() for all states bar one
if (rxState != MODES) {
ignoreTaskTime();
}
switch (rxState) {
default:
case CHECK:
ignoreTaskTime();
rxState = PROCESS;
break;
case PROCESS:
ignoreTaskTime();
if (!processRx(currentTimeUs)) {
rxState = CHECK;
break;
}
rxState = MODES;
@ -193,7 +195,6 @@ static void taskUpdateRxMain(timeUs_t currentTimeUs)
break;
case UPDATE:
ignoreTaskTime();
// updateRcCommands sets rcCommand, which is needed by updateAltHoldState and updateSonarAltHoldState
updateRcCommands();
updateArmingStatus();