1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 21:35:44 +03:00

Merge pull request #4325 from croghostrider/HOTT-telemetry-fix-from-IvaAlex

HOTT telemetry fix #3145
This commit is contained in:
Michael Keller 2017-10-19 17:19:49 +13:00 committed by GitHub
commit a9b97f0ccd

View file

@ -346,6 +346,8 @@ static void hottConfigurePortForTX(void)
} else { } else {
serialSetMode(hottPort, MODE_TX); serialSetMode(hottPort, MODE_TX);
} }
hottIsSending = true;
hottMsgCrc = 0;
} }
static void hottConfigurePortForRX(void) static void hottConfigurePortForRX(void)
@ -356,24 +358,9 @@ static void hottConfigurePortForRX(void)
} else { } else {
serialSetMode(hottPort, MODE_RX); serialSetMode(hottPort, MODE_RX);
} }
flushHottRxBuffer();
}
static void hottReconfigurePort(void)
{
if (!hottIsSending) {
hottIsSending = true;
hottMsgCrc = 0;
hottConfigurePortForTX();
return;
}
if (hottMsgRemainingBytesToSendCount == 0) {
hottMsg = NULL; hottMsg = NULL;
hottIsSending = false; hottIsSending = false;
hottConfigurePortForRX(); flushHottRxBuffer();
return;
}
} }
void configureHoTTTelemetryPort(void) void configureHoTTTelemetryPort(void)
@ -510,7 +497,15 @@ static void hottCheckSerialData(uint32_t currentMicros)
static void hottSendTelemetryData(void) { static void hottSendTelemetryData(void) {
hottReconfigurePort(); if (!hottIsSending) {
hottConfigurePortForTX();
return;
}
if (hottMsgRemainingBytesToSendCount == 0) {
hottConfigurePortForRX();
return;
}
--hottMsgRemainingBytesToSendCount; --hottMsgRemainingBytesToSendCount;
if (hottMsgRemainingBytesToSendCount == 0) { if (hottMsgRemainingBytesToSendCount == 0) {