Spektrum telemetry implementation (#3659)

* Implementation of Spektrum Telemetry for the DYI Multimodule.

I can only test a subset of sensors and these look okay

* Implement conversion from Fahrenheit to Celsius

* Minor fixes for Spektrum telemetry

* Add some more sensors, show sensor ID instead of instance in the overview
This commit is contained in:
Arne Schwabe
2016-07-22 17:38:11 +02:00
committed by Bertrand Songis
parent a28cbf88f3
commit 352de89838
29 changed files with 662 additions and 48 deletions
@@ -497,6 +497,11 @@ void setTelemetryValue(TelemetryProtocol protocol, uint16_t id, uint8_t subId, u
case TELEM_PROTO_CROSSFIRE:
crossfireSetDefault(index, id, instance);
break;
#endif
#if defined(MULTIMODULE)
case TELEM_PROTO_SPEKTRUM:
spektrumSetDefault(index, id, subId, instance);
break;
#endif
default:
return;
@@ -571,6 +576,10 @@ int32_t convertTelemetryValue(int32_t value, uint8_t unit, uint8_t prec, uint8_t
// T(°F) = T(°C)×1,8 + 32
value = 32 + (value*18) / 10;
}
} else if (unit == UNIT_FAHRENHEIT) {
if (destUnit == UNIT_CELSIUS) {
value = (value - 32) * 10/18;
}
}
else {
const UnitConversionRule * p = unitConversionTable;