Merge with latest 2.3

This commit is contained in:
Bertrand Songis
2020-10-07 21:01:45 +02:00
376 changed files with 10566 additions and 8633 deletions
+38 -1
View File
@@ -20,6 +20,7 @@
#include "opentx.h"
#include "multi.h"
#include "pulses/afhds3.h"
uint8_t telemetryStreaming = 0;
uint8_t telemetryRxBuffer[TELEMETRY_RX_PACKET_SIZE]; // Receive buffer. 9 bytes (full packet), worst case 18 bytes with byte-stuffing (+1)
@@ -44,6 +45,13 @@ void processTelemetryData(uint8_t data)
}
#endif
#if defined(GHOST)
if (telemetryProtocol == PROTOCOL_TELEMETRY_GHOST) {
processGhostTelemetryData(data);
return;
}
#endif
#if defined(MULTIMODULE)
if (telemetryProtocol == PROTOCOL_TELEMETRY_SPEKTRUM) {
processSpektrumTelemetryData(EXTERNAL_MODULE, data, telemetryRxBuffer, telemetryRxBufferCount);
@@ -59,6 +67,13 @@ void processTelemetryData(uint8_t data)
}
#endif
#if defined(AFHDS3)
if (telemetryProtocol == PROTOCOL_TELEMETRY_AFHDS3) {
afhds3::processTelemetryData(EXTERNAL_MODULE, data, telemetryRxBuffer, telemetryRxBufferCount, TELEMETRY_RX_PACKET_SIZE);
return;
}
#endif
processFrskyTelemetryData(data);
}
@@ -103,7 +118,7 @@ void telemetryWakeup()
#endif
#if defined(EXTMODULE_USART)
while (extmoduleFifo.getFrame(frame)) {
while (isModulePXX2(EXTERNAL_MODULE) && extmoduleFifo.getFrame(frame)) {
processPXX2Frame(EXTERNAL_MODULE, frame);
}
#endif
@@ -199,6 +214,11 @@ void telemetryWakeup()
if (TELEMETRY_STREAMING()) {
if (telemetryState == TELEMETRY_KO) {
AUDIO_TELEMETRY_BACK();
#if defined(CROSSFIRE)
if (isModuleCrossfire(EXTERNAL_MODULE)) {
moduleState[EXTERNAL_MODULE].counter = CRSF_FRAME_MODELID;
}
#endif
}
telemetryState = TELEMETRY_OK;
}
@@ -285,6 +305,16 @@ void telemetryInit(uint8_t protocol)
}
#endif
#if defined(GHOST)
else if (protocol == PROTOCOL_TELEMETRY_GHOST) {
telemetryPortInit(GHOST_BAUDRATE, TELEMETRY_SERIAL_DEFAULT);
#if defined(LUA)
outputTelemetryBuffer.reset();
#endif
telemetryPortSetDirectionOutput();
}
#endif
#if defined(AUX_SERIAL) || defined(PCBSKY9X)
else if (protocol == PROTOCOL_TELEMETRY_FRSKY_D_SECONDARY) {
telemetryPortInit(0, TELEMETRY_SERIAL_DEFAULT);
@@ -292,6 +322,13 @@ void telemetryInit(uint8_t protocol)
}
#endif
#if defined(AFHDS3) && !defined(SIMU)
else if (protocol == PROTOCOL_TELEMETRY_AFHDS3) {
telemetryPortInvertedInit(AFHDS3_BAUDRATE);
telemetryPortSetDirectionInput();
}
#endif
else {
telemetryPortInit(FRSKY_SPORT_BAUDRATE, TELEMETRY_SERIAL_WITHOUT_DMA);
#if defined(LUA)