Draft support internal module NV14

This commit is contained in:
Raphael Coeffic
2021-09-19 16:17:47 +02:00
parent c389000713
commit e29138f7e3
14 changed files with 1061 additions and 179 deletions
+18
View File
@@ -21,6 +21,7 @@
#include "opentx.h"
#include "multi.h"
#include "pulses/afhds3.h"
#include "pulses/flysky.h"
#include "mixer_scheduler.h"
#include "io/multi_protolist.h"
@@ -145,6 +146,18 @@ void telemetryWakeup()
#endif
#endif
#if defined(PCBNV14)
if (//!moduleUpdateActive(INTERNAL_MODULE) &&
moduleState[INTERNAL_MODULE].protocol == PROTOCOL_CHANNELS_AFHDS2A &&
intmoduleFifo.pop(data)) {
LOG_TELEMETRY_WRITE_START();
do {
processInternalFlySkyTelemetryData(data);
LOG_TELEMETRY_WRITE_BYTE(data);
} while (intmoduleFifo.pop(data));
}
#endif
#if defined(STM32)
if (telemetryGetByte(&data)) {
LOG_TELEMETRY_WRITE_START();
@@ -432,6 +445,11 @@ void ModuleSyncStatus::update(uint16_t newRefreshRate, int16_t newInputLag)
TRACE("[SYNC] update rate = %dus; lag = %dus",refreshRate,currentLag);
}
void ModuleSyncStatus::invalidate() {
//make invalid after use
currentLag = 0;
}
uint16_t ModuleSyncStatus::getAdjustedRefreshRate()
{
int16_t lag = currentLag;