1
0
Fork 0
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:
Bertrand Songis 2019-06-08 10:44:31 +02:00 committed by GitHub
parent 56a31f20d3
commit aff6c3fd1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 383 additions and 189 deletions

View file

@ -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
}