Telemetry fixes

This commit is contained in:
Bertrand Songis
2019-04-16 11:26:36 +02:00
parent 0a2d2a9b99
commit 2d26a74b18
7 changed files with 39 additions and 20 deletions
+15
View File
@@ -400,6 +400,21 @@ PACK(struct TelemetrySensor {
bool isPrecConfigurable() const;
int32_t getPrecMultiplier() const;
int32_t getPrecDivisor() const;
bool isSameInstance(TelemetryProtocol protocol, uint8_t instance)
{
if (protocol == TELEM_PROTO_FRSKY_SPORT) {
if (((this->instance ^ instance) & 0x9F) == 0) {
this->instance = instance; // update the instance in case we had telemetry switching
return true;
}
else {
return false;
}
}
else {
return this->instance == instance;
}
}
);
});