mirror of
https://github.com/opentx/opentx.git
synced 2025-07-22 07:45:14 +03:00
[SPORT] Sensor switches + Telemetry switch
This commit is contained in:
parent
0341b9ffce
commit
64cd872055
2 changed files with 14 additions and 4 deletions
|
@ -424,10 +424,10 @@ bool menuModelTelemetry(evt_t event)
|
||||||
int index = k-ITEM_TELEMETRY_SENSOR1;
|
int index = k-ITEM_TELEMETRY_SENSOR1;
|
||||||
lcdDrawNumber(MENUS_MARGIN_LEFT+INDENT_WIDTH, y, index+1, LEFT|attr, 0, NULL, ":");
|
lcdDrawNumber(MENUS_MARGIN_LEFT+INDENT_WIDTH, y, index+1, LEFT|attr, 0, NULL, ":");
|
||||||
lcdDrawSizedText(60, y, g_model.telemetrySensors[index].label, TELEM_LABEL_LEN, ZCHAR);
|
lcdDrawSizedText(60, y, g_model.telemetrySensors[index].label, TELEM_LABEL_LEN, ZCHAR);
|
||||||
if (telemetryItems[index].isFresh()) {
|
TelemetryItem & telemetryItem = telemetryItems[index];
|
||||||
|
if (telemetryItem.isFresh()) {
|
||||||
lcdDrawText(100, y, "*");
|
lcdDrawText(100, y, "*");
|
||||||
}
|
}
|
||||||
TelemetryItem & telemetryItem = telemetryItems[index];
|
|
||||||
if (telemetryItem.isAvailable()) {
|
if (telemetryItem.isAvailable()) {
|
||||||
LcdFlags color = telemetryItem.isOld() ? ALARM_COLOR : TEXT_COLOR;
|
LcdFlags color = telemetryItem.isOld() ? ALARM_COLOR : TEXT_COLOR;
|
||||||
putsTelemetryChannelValue(TELEM_COL2, y, index, getValue(MIXSRC_FIRST_TELEM+3*index), LEFT|color);
|
putsTelemetryChannelValue(TELEM_COL2, y, index, getValue(MIXSRC_FIRST_TELEM+3*index), LEFT|color);
|
||||||
|
|
|
@ -615,13 +615,23 @@ bool getSwitch(swsrc_t swtch)
|
||||||
result = REB_DOWN();
|
result = REB_DOWN();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(CPUARM) && defined(FLIGHT_MODES)
|
#if defined(CPUARM)
|
||||||
|
else if (cs_idx >= SWSRC_FIRST_SENSOR) {
|
||||||
|
result = !telemetryItems[cs_idx-SWSRC_FIRST_SENSOR].isOld();
|
||||||
|
}
|
||||||
|
else if (cs_idx == SWSRC_TELEMETRY_STREAMING) {
|
||||||
|
result = TELEMETRY_STREAMING();
|
||||||
|
}
|
||||||
else if (cs_idx >= SWSRC_FIRST_FLIGHT_MODE) {
|
else if (cs_idx >= SWSRC_FIRST_FLIGHT_MODE) {
|
||||||
|
#if defined(FLIGHT_MODES)
|
||||||
uint8_t idx = cs_idx - SWSRC_FIRST_FLIGHT_MODE;
|
uint8_t idx = cs_idx - SWSRC_FIRST_FLIGHT_MODE;
|
||||||
if (flags & GETSWITCH_MIDPOS_DELAY)
|
if (flags & GETSWITCH_MIDPOS_DELAY)
|
||||||
result = (idx == flightModeTransitionLast);
|
result = (idx == flightModeTransitionLast);
|
||||||
else
|
else
|
||||||
result = (idx == mixerCurrentFlightMode);
|
result = (idx == mixerCurrentFlightMode);
|
||||||
|
#else
|
||||||
|
result = false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue