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
+9 -1
View File
@@ -436,6 +436,14 @@ bool menuModelTelemetry(evt_t event)
lcdDrawText(TELEM_COL2, y, "---"); // TODO shortcut
}
TelemetrySensor * sensor = & g_model.telemetrySensors[index];
#ifdef MULTIMODULE
if (IS_SPEKTRUM_PROTOCOL()) {
// Spektrum does not (yet?) really support multiple sensor of the same type. But a lot of
// different sensor display the same information (e.g. voltage, capacity). Show the id
// of the sensor in the overview to ease figuring out what sensors belong together
lcdDrawHexNumber(TELEM_COL4, y, sensor->id, LEFT);
} else
#endif
if (sensor->type == TELEM_TYPE_CUSTOM && !g_model.ignoreSensorIds) {
lcdDrawNumber(TELEM_COL4, y, sensor->instance, LEFT);
}
@@ -465,7 +473,7 @@ bool menuModelTelemetry(evt_t event)
case ITEM_TELEMETRY_SENSORS_LABEL:
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_TELEMETRY_SENSORS);
lcdDrawText(TELEM_COL2, y, STR_VALUE, 0);
if (!g_model.ignoreSensorIds) {
if (!g_model.ignoreSensorIds && !IS_SPEKTRUM_PROTOCOL()) {
lcdDrawText(TELEM_COL4, y, STR_ID, 0);
}
break;
@@ -433,6 +433,14 @@ void menuModelTelemetry(uint8_t event)
lcdDrawText(TELEM_COL2, y, "---", 0); // TODO shortcut
}
TelemetrySensor * sensor = & g_model.telemetrySensors[index];
#ifdef MULTIMODULE
if (IS_SPEKTRUM_PROTOCOL()) {
// Spektrum does not (yet?) really support multiple sensor of the same type. But a lot of
// different sensor display the same information (e.g. voltage, capacity). Show the id
// of the sensor in the overview to ease figuring out what sensors belong together
lcdDrawHexNumber(TELEM_COL3, y, sensor->id, LEFT);
} else
#endif
if (sensor->type == TELEM_TYPE_CUSTOM && !g_model.ignoreSensorIds) {
lcdDrawNumber(TELEM_COL3, y, sensor->instance, LEFT);
}
@@ -461,7 +469,7 @@ void menuModelTelemetry(uint8_t event)
case ITEM_TELEMETRY_SENSORS_LABEL:
lcd_putsLeft(y, STR_TELEMETRY_SENSORS);
lcdDrawText(TELEM_COL2, y, STR_VALUE, 0);
if (!g_model.ignoreSensorIds) {
if (!g_model.ignoreSensorIds && !IS_SPEKTRUM_PROTOCOL()) {
lcdDrawText(TELEM_COL3, y, STR_ID, 0);
}
break;