mirror of
https://github.com/opentx/opentx.git
synced 2025-07-26 01:35:21 +03:00
crossfire computes its own estimate of a safe delay
This commit is contained in:
parent
a4ac99252b
commit
e08fe8e3ad
3 changed files with 7 additions and 6 deletions
|
@ -191,8 +191,8 @@ void processCrossfireTelemetryFrame()
|
||||||
update_interval /= 10;
|
update_interval /= 10;
|
||||||
offset /= 10;
|
offset /= 10;
|
||||||
|
|
||||||
serialPrint("[XF] Rate: %d, Lag: %d", update_interval, offset);
|
TRACE("[XF] Rate: %d, Lag: %d", update_interval, offset);
|
||||||
getModuleSyncStatus(EXTERNAL_MODULE).update(update_interval, offset);
|
getModuleSyncStatus(EXTERNAL_MODULE).update(update_interval, offset + SAFE_SYNC_LAG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -338,10 +338,6 @@ OutputTelemetryBuffer outputTelemetryBuffer __DMA;
|
||||||
Fifo<uint8_t, LUA_TELEMETRY_INPUT_FIFO_SIZE> * luaInputTelemetryFifo = NULL;
|
Fifo<uint8_t, LUA_TELEMETRY_INPUT_FIFO_SIZE> * luaInputTelemetryFifo = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MIN_REFRESH_RATE 4000 /* us */
|
|
||||||
#define MAX_REFRESH_RATE 25000 /* us */
|
|
||||||
#define SAFE_SYNC_LAG 800 /* us */
|
|
||||||
|
|
||||||
#if defined(HARDWARE_INTERNAL_MODULE)
|
#if defined(HARDWARE_INTERNAL_MODULE)
|
||||||
|
|
||||||
static ModuleSyncStatus moduleSyncStatus[NUM_MODULES];
|
static ModuleSyncStatus moduleSyncStatus[NUM_MODULES];
|
||||||
|
|
|
@ -258,6 +258,11 @@ extern Fifo<uint8_t, LUA_TELEMETRY_INPUT_FIFO_SIZE> * luaInputTelemetryFifo;
|
||||||
void processPXX2Frame(uint8_t module, const uint8_t *frame);
|
void processPXX2Frame(uint8_t module, const uint8_t *frame);
|
||||||
|
|
||||||
// Module pulse synchronization
|
// Module pulse synchronization
|
||||||
|
|
||||||
|
#define MIN_REFRESH_RATE 4000 /* us */
|
||||||
|
#define MAX_REFRESH_RATE 25000 /* us */
|
||||||
|
#define SAFE_SYNC_LAG 800 /* us */
|
||||||
|
|
||||||
struct ModuleSyncStatus
|
struct ModuleSyncStatus
|
||||||
{
|
{
|
||||||
// feedback input: last received values
|
// feedback input: last received values
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue