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 { } else {
serialSetMode(hottPort, MODE_TX); serialSetMode(hottPort, MODE_TX);
} }
hottIsSending = true;
hottMsgCrc = 0;
} }
static void hottConfigurePortForRX(void) static void hottConfigurePortForRX(void)
@ -356,26 +358,11 @@ static void hottConfigurePortForRX(void)
} else { } else {
serialSetMode(hottPort, MODE_RX); serialSetMode(hottPort, MODE_RX);
} }
hottMsg = NULL;
hottIsSending = false;
flushHottRxBuffer(); flushHottRxBuffer();
} }
static void hottReconfigurePort(void)
{
if (!hottIsSending) {
hottIsSending = true;
hottMsgCrc = 0;
hottConfigurePortForTX();
return;
}
if (hottMsgRemainingBytesToSendCount == 0) {
hottMsg = NULL;
hottIsSending = false;
hottConfigurePortForRX();
return;
}
}
void configureHoTTTelemetryPort(void) void configureHoTTTelemetryPort(void)
{ {
if (!portConfig) { if (!portConfig) {
@ -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) {