mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 17:25:13 +03:00
RxBatt should now be displayed and played correctly
This commit is contained in:
parent
375147e4eb
commit
136cd666f7
2 changed files with 29 additions and 12 deletions
|
@ -1215,6 +1215,22 @@ void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val,
|
||||||
att &= ~NO_UNIT;
|
att &= ~NO_UNIT;
|
||||||
putsTimer(x, y, val, att, att);
|
putsTimer(x, y, val, att, att);
|
||||||
break;
|
break;
|
||||||
|
#if defined(CPUARM)
|
||||||
|
case TELEM_RX_VOLTAGE-1:
|
||||||
|
#if LCD_W >= 212
|
||||||
|
att |= PREC2;
|
||||||
|
#else
|
||||||
|
if (abs(val) < 1000) {
|
||||||
|
att |= PREC2;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
val = div10_and_round(val);
|
||||||
|
att |= PREC1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
putsTelemetryValue(x, y, val, UNIT_VOLTS, att);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
#if defined(FRSKY)
|
#if defined(FRSKY)
|
||||||
case TELEM_MIN_A1-1:
|
case TELEM_MIN_A1-1:
|
||||||
case TELEM_MIN_A2-1:
|
case TELEM_MIN_A2-1:
|
||||||
|
|
|
@ -1606,6 +1606,11 @@ PLAY_FUNCTION(playValue, uint8_t idx)
|
||||||
case MIXSRC_FIRST_TELEM+TELEM_SWR-1:
|
case MIXSRC_FIRST_TELEM+TELEM_SWR-1:
|
||||||
PLAY_NUMBER(val, 0, 0);
|
PLAY_NUMBER(val, 0, 0);
|
||||||
break;
|
break;
|
||||||
|
case MIXSRC_FIRST_TELEM+TELEM_RX_VOLTAGE-1:
|
||||||
|
if (TELEMETRY_STREAMING()) {
|
||||||
|
PLAY_NUMBER(div10_and_round(val), 1+UNIT_VOLTS, PREC1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if defined(FRSKY)
|
#if defined(FRSKY)
|
||||||
case MIXSRC_FIRST_TELEM+TELEM_RSSI_TX-1:
|
case MIXSRC_FIRST_TELEM+TELEM_RSSI_TX-1:
|
||||||
|
@ -1626,20 +1631,16 @@ PLAY_FUNCTION(playValue, uint8_t idx)
|
||||||
case MIXSRC_FIRST_TELEM+TELEM_A3-1:
|
case MIXSRC_FIRST_TELEM+TELEM_A3-1:
|
||||||
case MIXSRC_FIRST_TELEM+TELEM_A4-1:
|
case MIXSRC_FIRST_TELEM+TELEM_A4-1:
|
||||||
#endif
|
#endif
|
||||||
// A1 and A2
|
if (TELEMETRY_STREAMING()) {
|
||||||
idx -= (MIXSRC_FIRST_TELEM+TELEM_A1-1);
|
idx -= (MIXSRC_FIRST_TELEM+TELEM_A1-1);
|
||||||
{
|
uint8_t att = 0;
|
||||||
if (TELEMETRY_STREAMING()) {
|
int16_t converted_value = div10_and_round(applyChannelRatio(idx, val));;
|
||||||
uint8_t att = 0;
|
if (ANA_CHANNEL_UNIT(idx) < UNIT_RAW) {
|
||||||
int16_t converted_value = div10_and_round(applyChannelRatio(idx, val));;
|
att = PREC1;
|
||||||
if (ANA_CHANNEL_UNIT(idx) < UNIT_RAW) {
|
|
||||||
att = PREC1;
|
|
||||||
}
|
|
||||||
PLAY_NUMBER(converted_value, 1+ANA_CHANNEL_UNIT(idx), att);
|
|
||||||
}
|
}
|
||||||
break;
|
PLAY_NUMBER(converted_value, 1+ANA_CHANNEL_UNIT(idx), att);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case MIXSRC_FIRST_TELEM+TELEM_CELL-1:
|
case MIXSRC_FIRST_TELEM+TELEM_CELL-1:
|
||||||
case MIXSRC_FIRST_TELEM+TELEM_MIN_CELL-1:
|
case MIXSRC_FIRST_TELEM+TELEM_MIN_CELL-1:
|
||||||
PLAY_NUMBER(div10_and_round(val), 1+UNIT_VOLTS, PREC1);
|
PLAY_NUMBER(div10_and_round(val), 1+UNIT_VOLTS, PREC1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue