1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 04:45:24 +03:00

Still update duration of next anticipated state even is current execution time is ignored

This commit is contained in:
Steve Evans 2022-01-14 03:22:52 +00:00
parent 4e47a792d8
commit e7b61a928f
2 changed files with 27 additions and 25 deletions

View file

@ -225,10 +225,7 @@ static void taskUpdateRxMain(timeUs_t currentTimeUs)
break;
}
if (schedulerGetIgnoreTaskExecTime()) {
return;
}
if (!schedulerGetIgnoreTaskExecTime()) {
executeTimeUs = micros() - currentTimeUs + RX_TASK_MARGIN;
// If the scheduler has reduced the anticipatedExecutionTime due to task aging, pick that up
@ -243,6 +240,7 @@ static void taskUpdateRxMain(timeUs_t currentTimeUs)
// Slowly decay the max time
rxStateDurationFracUs[oldRxState]--;
}
}
if (debugMode == DEBUG_RX_STATE_TIME) {
debug[oldRxState] = rxStateDurationFracUs[oldRxState] >> RX_TASK_DECAY_SHIFT;

View file

@ -1006,6 +1006,8 @@ void osdDrawStats2(timeUs_t currentTimeUs)
osdStatsEnabled = false;
stats.armed_time = 0;
}
schedulerIgnoreTaskExecTime();
}
#ifdef USE_ESC_SENSOR
if (featureIsEnabled(FEATURE_ESC_SENSOR)) {
@ -1305,6 +1307,7 @@ void osdUpdate(timeUs_t currentTimeUs)
break;
}
if (!schedulerGetIgnoreTaskExecTime()) {
executeTimeUs = micros() - currentTimeUs;
@ -1321,6 +1324,7 @@ void osdUpdate(timeUs_t currentTimeUs)
osdStateDurationUs[osdCurState] = executeTimeUs;
}
}
}
if (osdState == OSD_STATE_UPDATE_ELEMENTS) {
schedulerSetNextStateTime(osdElementGroupDurationUs[osdElementGroup] + OSD_ELEMENT_RENDER_MARGIN);