mirror of
https://github.com/opentx/opentx.git
synced 2025-07-17 13:25:20 +03:00
PXX synchro using Hearbeat (#6482)
* [PXX] Latency using heartbeat sync optimized for X7 (stable @ 12ms) * [PXX] Latency using heartbeat sync optimized for XLite Pro (stable @ 9ms)
This commit is contained in:
parent
56a31f20d3
commit
aff6c3fd1d
37 changed files with 383 additions and 189 deletions
|
@ -134,17 +134,28 @@ TASK_FUNCTION(mixerTask)
|
|||
|
||||
uint32_t now = RTOS_GET_MS();
|
||||
bool run = false;
|
||||
if ((now - lastRunTime) >= 10) { // run at least every 10ms
|
||||
|
||||
if ((now - lastRunTime) >= 10) {
|
||||
// run at least every 10ms
|
||||
run = true;
|
||||
}
|
||||
else if (now == nextMixerTime[0]) {
|
||||
run = true;
|
||||
}
|
||||
#if NUM_MODULES >= 2
|
||||
else if (now == nextMixerTime[1]) {
|
||||
|
||||
#if defined(PXX2) && defined(INTMDULE_HEARTBEAT)
|
||||
if (moduleState[0].protocol == PROTOCOL_CHANNELS_PXX2 && heartbeatCapture.valid && heartbeatCapture.timestamp > lastRunTime) {
|
||||
run = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (now == nextMixerTime[0]) {
|
||||
run = true;
|
||||
}
|
||||
|
||||
#if NUM_MODULES >= 2
|
||||
if (now == nextMixerTime[1]) {
|
||||
run = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!run) {
|
||||
continue; // go back to sleep
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue