Rb10 support (#4015)

* Rb10 support

* Even more thorough check

* A simpler test for the more complex scenario :) (thx Bsongis :))
This commit is contained in:
3djc
2016-11-11 19:55:53 +01:00
committed by Bertrand Songis
parent c0837a59a6
commit 5869b81e9c
+12 -1
View File
@@ -186,7 +186,18 @@ void sportProcessTelemetryPacket(uint8_t * packet)
sportProcessTelemetryPacket(id, 1, instance, data >> 16);
}
else if (id >= RBOX_STATE_FIRST_ID && id <= RBOX_STATE_LAST_ID) {
uint16_t newServosState = data & 0xffff;
bool static isRB10 = false;
uint16_t newServosState;
if (servosState == 0 && (data & 0xff00) == 0xff00) {
isRB10 = true;
}
if (isRB10) {
newServosState = data & 0x00ff; // 8ch only RB10
}
else {
newServosState = data & 0xffff;
}
if (newServosState != 0 && servosState == 0) {
audioEvent(AU_SERVO_KO);
}