Bug when displaying Max GPS speed in Custom Telemetry View. Also should fix a bug when WSHH used with IMPERIAL option.

This commit is contained in:
bsongis
2012-05-19 10:32:44 +00:00
parent a4be1f9177
commit 1e8219e110
+13 -2
View File
@@ -977,7 +977,9 @@ void putsTelemetryChannel(uint8_t x, uint8_t y, uint8_t channel, int16_t val, ui
break;
#if defined(IMPERIAL_UNITS)
case TELEM_ALT:
case TELEM_ALT-1:
case TELEM_MIN_ALT-1:
case TELEM_MAX_ALT-1:
if (g_model.frsky.usrProto == PROTO_WS_HOW_HIGH) {
putsTelemetryValue(x, y, val, UNIT_FEET, att);
break;
@@ -986,8 +988,17 @@ void putsTelemetryChannel(uint8_t x, uint8_t y, uint8_t channel, int16_t val, ui
#endif
default:
putsTelemetryValue(x, y, val, pgm_read_byte(bchunit_ar+channel-6), att);
{
uint8_t unit;
if (channel <= TELEM_GPSALT-1)
unit = channel - 6;
else if (channel >= TELEM_MAX_T1-1 && channel <= TELEM_MAX_DIST-1)
unit = channel - 22;
else
unit = 1;
putsTelemetryValue(x, y, val, pgm_read_byte(bchunit_ar+unit), att);
break;
}
}
}