mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 21:05:35 +03:00
HOTT telemetry fix
Pull Request with the changes from @IvaAlex
This commit is contained in:
parent
a4040caebd
commit
32688fc7df
1 changed files with 13 additions and 18 deletions
|
@ -346,6 +346,8 @@ static void hottConfigurePortForTX(void)
|
|||
} else {
|
||||
serialSetMode(hottPort, MODE_TX);
|
||||
}
|
||||
hottIsSending = true;
|
||||
hottMsgCrc = 0;
|
||||
}
|
||||
|
||||
static void hottConfigurePortForRX(void)
|
||||
|
@ -356,26 +358,11 @@ static void hottConfigurePortForRX(void)
|
|||
} else {
|
||||
serialSetMode(hottPort, MODE_RX);
|
||||
}
|
||||
hottMsg = NULL;
|
||||
hottIsSending = false;
|
||||
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)
|
||||
{
|
||||
if (!portConfig) {
|
||||
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue