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:
parent
a24daa78d0
commit
d004cf5fb7
1 changed files with 24 additions and 20 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue