Fixed checkCrsfTelemetryState

This commit is contained in:
Martin Budden 2016-11-15 12:39:20 +00:00
parent c987f268b7
commit e4997353c8
1 changed files with 16 additions and 7 deletions

View File

@ -391,6 +391,14 @@ void configureCrsfTelemetryPort(void)
bool checkCrsfTelemetryState(void) bool checkCrsfTelemetryState(void)
{ {
if (serialPortConfig && telemetryCheckRxPortShared(serialPortConfig)) {
if (!crsfTelemetryEnabled && telemetrySharedPort != NULL) {
serialPort = telemetrySharedPort;
crsfTelemetryEnabled = true;
return true;
}
return false;
} else {
const bool newTelemetryEnabled = telemetryDetermineEnabledState(portSharing); const bool newTelemetryEnabled = telemetryDetermineEnabledState(portSharing);
if (newTelemetryEnabled == crsfTelemetryEnabled) { if (newTelemetryEnabled == crsfTelemetryEnabled) {
return false; return false;
@ -401,6 +409,7 @@ bool checkCrsfTelemetryState(void)
freeCrsfTelemetryPort(); freeCrsfTelemetryPort();
} }
return true; return true;
}
} }
int getCrsfFrame(uint8_t *frame, crsfFrameType_e frameType) int getCrsfFrame(uint8_t *frame, crsfFrameType_e frameType)