mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
Fix frsky telemetry which was needlessly checking for incoming data.
Maybe it needs to check that the serial port has SENT the data?
This commit is contained in:
parent
06a8d0c8cf
commit
00f04e0ea2
2 changed files with 2 additions and 10 deletions
|
@ -288,6 +288,8 @@ void closeSerialPort(serialPort_t *serialPort) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO wait until data has been transmitted.
|
||||||
|
|
||||||
serialPort->callback = NULL;
|
serialPort->callback = NULL;
|
||||||
|
|
||||||
serialPortUsage->function = FUNCTION_NONE;
|
serialPortUsage->function = FUNCTION_NONE;
|
||||||
|
|
|
@ -432,12 +432,6 @@ void configureFrSkyTelemetryPort(void)
|
||||||
frskyTelemetryEnabled = true;
|
frskyTelemetryEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool canSendFrSkyTelemetry(void)
|
|
||||||
{
|
|
||||||
return frskyPort && serialTotalBytesWaiting(frskyPort) == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool hasEnoughTimeLapsedSinceLastTelemetryTransmission(uint32_t currentMillis)
|
bool hasEnoughTimeLapsedSinceLastTelemetryTransmission(uint32_t currentMillis)
|
||||||
{
|
{
|
||||||
return currentMillis - lastCycleTime >= CYCLETIME;
|
return currentMillis - lastCycleTime >= CYCLETIME;
|
||||||
|
@ -463,10 +457,6 @@ void handleFrSkyTelemetry(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!canSendFrSkyTelemetry()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t now = millis();
|
uint32_t now = millis();
|
||||||
|
|
||||||
if (!hasEnoughTimeLapsedSinceLastTelemetryTransmission(now)) {
|
if (!hasEnoughTimeLapsedSinceLastTelemetryTransmission(now)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue