mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 20:35:33 +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
|
// Check input sources for config updates
|
||||||
vtxControlInputPoll();
|
vtxControlInputPoll();
|
||||||
|
|
||||||
|
const uint8_t startingSchedule = currentSchedule;
|
||||||
bool vtxUpdatePending = false;
|
bool vtxUpdatePending = false;
|
||||||
|
do {
|
||||||
switch (currentSchedule) {
|
switch (currentSchedule) {
|
||||||
case VTX_PARAM_POWER:
|
case VTX_PARAM_POWER:
|
||||||
vtxUpdatePending = vtxProcessPower(vtxDevice);
|
vtxUpdatePending = vtxProcessPower(vtxDevice);
|
||||||
|
@ -242,6 +244,8 @@ void vtxUpdate(timeUs_t currentTimeUs)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
currentSchedule = (currentSchedule + 1) % VTX_PARAM_COUNT;
|
currentSchedule = (currentSchedule + 1) % VTX_PARAM_COUNT;
|
||||||
|
} while (!vtxUpdatePending && currentSchedule != startingSchedule);
|
||||||
|
|
||||||
if (!ARMING_FLAG(ARMED) || vtxUpdatePending) {
|
if (!ARMING_FLAG(ARMED) || vtxUpdatePending) {
|
||||||
vtxCommonProcess(vtxDevice, currentTimeUs);
|
vtxCommonProcess(vtxDevice, currentTimeUs);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue