Bsongis/rssi from 2 different modules (#6711)

RSSI from 2 different modules
This commit is contained in:
Bertrand Songis
2019-09-05 17:24:48 +02:00
committed by GitHub
parent a2e71d43c0
commit 13dee00eed
28 changed files with 190 additions and 120 deletions
+9 -7
View File
@@ -319,6 +319,9 @@ PACK(struct VarioData {
* Telemetry Sensor structure
*/
#define TELEMETRY_ENDPOINT_NONE 0xFF
#define TELEMETRY_ENDPOINT_SPORT 0x07
PACK(struct TelemetrySensor {
union {
uint16_t id; // data identifier, for FrSky we can reuse existing ones. Source unit is derived from type.
@@ -379,18 +382,17 @@ PACK(struct TelemetrySensor {
int32_t getPrecDivisor() const;
bool isSameInstance(TelemetryProtocol protocol, uint8_t instance)
{
if (this->instance == instance)
return true;
if (protocol == PROTOCOL_TELEMETRY_FRSKY_SPORT) {
if (((this->instance ^ instance) & 0x9F) == 0) {
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;
}
else {
return false;
}
}
else {
return this->instance == instance;
}
return false;
}
);
});