1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 13:25:30 +03:00

HOTT telemetry fix

Pull Request with the changes from @IvaAlex
This commit is contained in:
croghostrider 2017-10-10 22:02:31 +02:00 committed by Vinko Varkas
parent a4040caebd
commit 32688fc7df

View file

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