2nd attempt to fix #7613 (#7670)

This commit is contained in:
Bertrand Songis
2020-06-04 15:13:32 +02:00
committed by GitHub
parent f34b5216a7
commit a468005ada
3 changed files with 12 additions and 14 deletions
+7 -2
View File
@@ -387,10 +387,15 @@ PACK(struct TelemetrySensor {
return true;
if (protocol == PROTOCOL_TELEMETRY_FRSKY_SPORT) {
#if defined(SIMU)
if (((this->instance ^ instance) & 0x1F) == 0)
return true;
#else
if (((this->instance ^ instance) & 0x9F) == 0 && (this->instance >> 5) != TELEMETRY_ENDPOINT_SPORT && (instance >> 5) != TELEMETRY_ENDPOINT_SPORT) {
this->instance = instance; // update the instance in case we had telemetry switching
return true;
}
#endif
}
return false;
@@ -471,11 +476,11 @@ PACK(struct ModuleData {
// Helper functions to set both of the rfProto protocol at the same time
NOBACKUP(inline uint8_t getMultiProtocol() {
return ((uint8_t) (rfProtocol & 0x0f)) + (multi.rfProtocolExtra << 4);
return ((uint8_t) (rfProtocol & 0x0F)) + (multi.rfProtocolExtra << 4);
})
NOBACKUP(inline void setMultiProtocol(uint8_t proto) {
rfProtocol = (uint8_t) (proto & 0x0f);
rfProtocol = (uint8_t) (proto & 0x0F);
multi.rfProtocolExtra = (proto & 0x70) >> 4;
})
});