1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-24 00:35:18 +03:00

Proper rounding for values that are scaled down. Displayed and spoken values affected.

Example: value 3.47V was spoken as 3.4V, new spoken value is 3.5V
This commit is contained in:
Damjan Adamic 2014-03-23 20:50:02 +01:00
parent 32090b8bbe
commit e5cbba4ee2
14 changed files with 44 additions and 18 deletions

View file

@ -1190,7 +1190,7 @@ void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val,
{
lcdint_t converted_value = applyChannelRatio(channel, val);
if (g_model.frsky.channels[channel].type >= UNIT_RAW) {
converted_value /= 10;
converted_value = div10_and_round(converted_value);
}
else {
#if !defined(PCBTARANIS)
@ -1198,7 +1198,7 @@ void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val,
att |= PREC2;
}
else {
converted_value /= 10;
converted_value = div10_and_round(converted_value);
att |= PREC1;
}
#else
@ -1255,7 +1255,7 @@ void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val,
#if defined(FRSKY_SPORT)
case TELEM_ALT-1:
putsTelemetryValue(x, y, val/10, UNIT_DIST, att|PREC1);
putsTelemetryValue(x, y, div10_and_round(val), UNIT_DIST, att|PREC1);
break;
#elif defined(WS_HOW_HIGH)
case TELEM_ALT-1: