VC++ compilation fix

This commit is contained in:
Bertrand Songis
2020-06-08 21:25:39 +02:00
parent 5276a4d42a
commit 62bcb1dbad
2 changed files with 21 additions and 19 deletions
+1 -19
View File
@@ -381,25 +381,7 @@ PACK(struct TelemetrySensor {
bool isPrecConfigurable() const;
int32_t getPrecMultiplier() const;
int32_t getPrecDivisor() const;
bool isSameInstance(TelemetryProtocol protocol, uint8_t instance)
{
if (this->instance == instance)
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;
}
bool isSameInstance(TelemetryProtocol protocol, uint8_t instance);
);
});
+20
View File
@@ -720,3 +720,23 @@ int32_t TelemetrySensor::getPrecDivisor() const
if (prec == 1) return 10;
return 1;
}
bool TelemetrySensor::isSameInstance(TelemetryProtocol protocol, uint8_t instance)
{
if (this->instance == instance)
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;
}