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

Improved VTX update scheduling to reduce update delays (#5340)

This commit is contained in:
codecae 2018-03-05 14:27:50 -05:00 committed by Michael Keller
parent a24daa78d0
commit d004cf5fb7

View file

@ -218,7 +218,9 @@ void vtxUpdate(timeUs_t currentTimeUs)
// Check input sources for config updates
vtxControlInputPoll();
const uint8_t startingSchedule = currentSchedule;
bool vtxUpdatePending = false;
do {
switch (currentSchedule) {
case VTX_PARAM_POWER:
vtxUpdatePending = vtxProcessPower(vtxDevice);
@ -242,6 +244,8 @@ void vtxUpdate(timeUs_t currentTimeUs)
break;
}
currentSchedule = (currentSchedule + 1) % VTX_PARAM_COUNT;
} while (!vtxUpdatePending && currentSchedule != startingSchedule);
if (!ARMING_FLAG(ARMED) || vtxUpdatePending) {
vtxCommonProcess(vtxDevice, currentTimeUs);
}