Fixed checkCrsfTelemetryState
This commit is contained in:
parent
c987f268b7
commit
e4997353c8
|
@ -391,16 +391,25 @@ void configureCrsfTelemetryPort(void)
|
||||||
|
|
||||||
bool checkCrsfTelemetryState(void)
|
bool checkCrsfTelemetryState(void)
|
||||||
{
|
{
|
||||||
const bool newTelemetryEnabled = telemetryDetermineEnabledState(portSharing);
|
if (serialPortConfig && telemetryCheckRxPortShared(serialPortConfig)) {
|
||||||
if (newTelemetryEnabled == crsfTelemetryEnabled) {
|
if (!crsfTelemetryEnabled && telemetrySharedPort != NULL) {
|
||||||
|
serialPort = telemetrySharedPort;
|
||||||
|
crsfTelemetryEnabled = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
if (newTelemetryEnabled) {
|
|
||||||
configureCrsfTelemetryPort();
|
|
||||||
} else {
|
} else {
|
||||||
freeCrsfTelemetryPort();
|
const bool newTelemetryEnabled = telemetryDetermineEnabledState(portSharing);
|
||||||
|
if (newTelemetryEnabled == crsfTelemetryEnabled) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (newTelemetryEnabled) {
|
||||||
|
configureCrsfTelemetryPort();
|
||||||
|
} else {
|
||||||
|
freeCrsfTelemetryPort();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int getCrsfFrame(uint8_t *frame, crsfFrameType_e frameType)
|
int getCrsfFrame(uint8_t *frame, crsfFrameType_e frameType)
|
||||||
|
|
Loading…
Reference in New Issue