Stop bind on bind response received

This commit is contained in:
Arne Schwabe
2016-10-16 22:24:37 +02:00
parent f12ce22ade
commit 6bec8cef5a
3 changed files with 14 additions and 0 deletions
+6
View File
@@ -257,6 +257,7 @@ bool isSpektrumValidValue(int32_t value, const SpektrumDataType type)
}
}
bool spektrumBindFinished = 0;
void processSpektrumPacket(const uint8_t *packet)
{
setTelemetryValue(TELEM_PROTO_SPEKTRUM, (I2C_PSEUDO_TX << 8) + 0, 0, 0, packet[1], UNIT_RAW, 0);
@@ -373,6 +374,11 @@ void processDSMBindPacket(const uint8_t *packet)
/* log the bind packet as telemetry for quick debugging */
setTelemetryValue(TELEM_PROTO_SPEKTRUM, (I2C_PSEUDO_TX << 8) + 4, 0, 0, debugval, UNIT_RAW, 0);
/* Finally stop binding as the rx just told us that it is bound */
if (g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_MULTIMODULE && g_model.moduleData[EXTERNAL_MODULE].getMultiProtocol(true) == MM_RF_PROTO_DSM2
&& moduleFlag[EXTERNAL_MODULE] == MODULE_BIND) {
spektrumBindFinished=true;
}
}
void processSpektrumTelemetryData(uint8_t data)