1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-16 21:05:26 +03:00

Fix problem with GPS speed unit used with voice

This commit is contained in:
bsongis 2014-02-25 18:05:54 +01:00
parent 590a58a6e9
commit 2e58969aa1
17 changed files with 93 additions and 57 deletions

View file

@ -270,7 +270,7 @@ void displayTopBar()
/* Altitude */
if (g_model.frsky.altitudeDisplayed && TELEMETRY_BARO_ALT_AVAILABLE()) {
LCD_ICON(altitude_icon_x, BAR_Y, ICON_ALTITUDE);
putsTelemetryValue(altitude_icon_x+2*FW-1, BAR_Y+1, TELEMETRY_RELATIVE_BARO_ALT_BP, UNIT_METERS, LEFT);
putsTelemetryValue(altitude_icon_x+2*FW-1, BAR_Y+1, TELEMETRY_RELATIVE_BARO_ALT_BP, UNIT_SPEED, LEFT);
}
}

View file

@ -1185,14 +1185,14 @@ void putsTelemetryValue(xcoord_t x, uint8_t y, lcdint_t val, uint8_t unit, uint8
}
const pm_uint8_t bchunit_ar[] PROGMEM = {
UNIT_METERS, // Alt
UNIT_DIST, // Alt
UNIT_RAW, // Rpm
UNIT_PERCENT, // Fuel
UNIT_DEGREES, // T1
UNIT_DEGREES, // T2
UNIT_KTS, // Speed
UNIT_METERS, // Dist
UNIT_METERS, // GPS Alt
UNIT_DIST, // Dist
UNIT_DIST, // GPS Alt
};
void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val, uint8_t att)
@ -1276,7 +1276,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_METERS, att|PREC1);
putsTelemetryValue(x, y, val/10, UNIT_DIST, att|PREC1);
break;
#elif defined(WS_HOW_HIGH)
case TELEM_ALT-1:

View file

@ -88,6 +88,7 @@ void getGpsDistance()
result += dist*dist;
frskyData.hub.gpsDistance = isqrt32(result);
TRACE("distance = %d", frskyData.hub.gpsDistance);
if (frskyData.hub.gpsDistance > frskyData.hub.maxGpsDistance)
frskyData.hub.maxGpsDistance = frskyData.hub.gpsDistance;
}

View file

@ -901,8 +901,8 @@ enum TelemetryUnit {
UNIT_AMPS,
UNIT_METERS_PER_SECOND,
UNIT_RAW,
UNIT_KMH,
UNIT_METERS,
UNIT_SPEED,
UNIT_DIST,
UNIT_DEGREES,
UNIT_PERCENT,
UNIT_MILLIAMPS,

View file

@ -2112,22 +2112,24 @@ FORCEINLINE void convertUnit(getvalue_t & val, uint8_t & unit)
val *= 115;
val >>= 6;
}
if (unit == UNIT_METERS) {
if (unit == UNIT_DIST) {
// m to ft *105/32
val = val * 3 + (val >> 2) + (val >> 5);
}
if (unit == UNIT_FEET) {
unit = UNIT_METERS;
unit = UNIT_DIST;
}
if (unit == UNIT_KTS) {
unit = UNIT_KMH;
// kts to mph
unit = UNIT_SPEED;
val = (val * 31) / 27;
}
}
else {
if (unit == UNIT_KTS) {
// kts to km/h
unit = UNIT_KMH;
val = (val * 46) / 25;
unit = UNIT_SPEED;
val = (val * 50) / 27;
}
}
}
@ -3238,7 +3240,7 @@ PLAY_FUNCTION(playValue, uint8_t idx)
case MIXSRC_FIRST_TELEM+TELEM_ALT-1:
#if defined(PCBTARANIS)
PLAY_NUMBER(val/10, 1+UNIT_METERS, PREC1);
PLAY_NUMBER(val/10, 1+UNIT_DIST, PREC1);
break;
#endif
case MIXSRC_FIRST_TELEM+TELEM_MIN_ALT-1:
@ -3248,7 +3250,7 @@ PLAY_FUNCTION(playValue, uint8_t idx)
PLAY_NUMBER(val, 1+UNIT_FEET, 0);
else
#endif
PLAY_NUMBER(val, 1+UNIT_METERS, 0);
PLAY_NUMBER(val, 1+UNIT_DIST, 0);
break;
case MIXSRC_FIRST_TELEM+TELEM_RPM-1:

View file

@ -774,6 +774,9 @@ void resetTelemetry()
frskyData.hub.gpsLongitude_ap = 9533;
getGpsDistance();
frskyData.hub.gpsSpeed_bp = 100;
frskyData.hub.gpsSpeed_ap = 50;
frskyData.hub.cellsCount = 6;
frskyData.hub.baroAltitudeOffset = 500 * 100;

View file

@ -41,8 +41,8 @@ enum CzechPrompts {
CZ_PROMPT_AMPS = CZ_PROMPT_UNITS_BASE+(UNIT_AMPS*4),
CZ_PROMPT_METERS_PER_SECOND = CZ_PROMPT_UNITS_BASE+(UNIT_METERS_PER_SECOND*4),
CZ_PROMPT_SPARE1 = CZ_PROMPT_UNITS_BASE+(UNIT_RAW*4),
CZ_PROMPT_KMH = CZ_PROMPT_UNITS_BASE+(UNIT_KMH*4),
CZ_PROMPT_METERS = CZ_PROMPT_UNITS_BASE+(UNIT_METERS*4),
CZ_PROMPT_KMH = CZ_PROMPT_UNITS_BASE+(UNIT_SPEED*4),
CZ_PROMPT_METERS = CZ_PROMPT_UNITS_BASE+(UNIT_DIST*4),
CZ_PROMPT_DEGREES = CZ_PROMPT_UNITS_BASE+(UNIT_DEGREES*4),
CZ_PROMPT_PERCENT = CZ_PROMPT_UNITS_BASE+(UNIT_PERCENT*4),
CZ_PROMPT_MILLIAMPS = CZ_PROMPT_UNITS_BASE+(UNIT_MILLIAMPS*4),
@ -120,12 +120,15 @@ I18N_PLAY_FUNCTION(cz, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
unit--;
convertUnit(number, unit);
if (IS_IMPERIAL_ENABLE()) {
if (unit == UNIT_METERS) {
if (unit == UNIT_DIST) {
unit = UNIT_FEET;
}
if (unit == UNIT_SPEED) {
unit = UNIT_KTS;
}
}
#if defined(CPUARM)
if ((att & PREC1) && (unit == UNIT_FEET || (unit == UNIT_METERS && number >= 100))) {
if ((att & PREC1) && (unit == UNIT_FEET || (unit == UNIT_DIST && number >= 100))) {
number /= 10;
att -= PREC1;
}

View file

@ -43,8 +43,8 @@ enum GermanPrompts {
DE_PROMPT_AMPS = DE_PROMPT_UNITS_BASE+UNIT_AMPS,
DE_PROMPT_METERS_PER_SECOND = DE_PROMPT_UNITS_BASE+UNIT_METERS_PER_SECOND,
DE_PROMPT_SPARE1 = DE_PROMPT_UNITS_BASE+UNIT_RAW,
DE_PROMPT_KMH = DE_PROMPT_UNITS_BASE+UNIT_KMH,
DE_PROMPT_METERS = DE_PROMPT_UNITS_BASE+UNIT_METERS,
DE_PROMPT_KMH = DE_PROMPT_UNITS_BASE+UNIT_SPEED,
DE_PROMPT_METERS = DE_PROMPT_UNITS_BASE+UNIT_DIST,
DE_PROMPT_DEGREES = DE_PROMPT_UNITS_BASE+UNIT_DEGREES,
DE_PROMPT_PERCENT = DE_PROMPT_UNITS_BASE+UNIT_PERCENT,
DE_PROMPT_MILLIAMPS = DE_PROMPT_UNITS_BASE+UNIT_MILLIAMPS,
@ -110,12 +110,15 @@ I18N_PLAY_FUNCTION(de, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
unit--;
convertUnit(number, unit);
if (IS_IMPERIAL_ENABLE()) {
if (unit == UNIT_METERS) {
if (unit == UNIT_DIST) {
unit = UNIT_FEET;
}
if (unit == UNIT_SPEED) {
unit = UNIT_KTS;
}
}
#if defined(CPUARM)
if ((att & PREC1) && (unit == UNIT_FEET || (unit == UNIT_METERS && number >= 100))) {
if ((att & PREC1) && (unit == UNIT_FEET || (unit == UNIT_DIST && number >= 100))) {
number /= 10;
att -= PREC1;
}

View file

@ -50,8 +50,8 @@ enum EnglishPrompts {
EN_PROMPT_AMPS = EN_PROMPT_UNITS_BASE+(UNIT_AMPS*2),
EN_PROMPT_METERS_PER_SECOND = EN_PROMPT_UNITS_BASE+(UNIT_METERS_PER_SECOND*2),
EN_PROMPT_SPARE1 = EN_PROMPT_UNITS_BASE+(UNIT_RAW*2),
EN_PROMPT_KMH = EN_PROMPT_UNITS_BASE+(UNIT_KMH*2),
EN_PROMPT_METERS = EN_PROMPT_UNITS_BASE+(UNIT_METERS*2),
EN_PROMPT_KMH = EN_PROMPT_UNITS_BASE+(UNIT_SPEED*2),
EN_PROMPT_METERS = EN_PROMPT_UNITS_BASE+(UNIT_DIST*2),
EN_PROMPT_DEGREES = EN_PROMPT_UNITS_BASE+(UNIT_DEGREES*2),
EN_PROMPT_PERCENT = EN_PROMPT_UNITS_BASE+(UNIT_PERCENT*2),
EN_PROMPT_MILLIAMPS = EN_PROMPT_UNITS_BASE+(UNIT_MILLIAMPS*2),
@ -59,7 +59,7 @@ enum EnglishPrompts {
EN_PROMPT_WATTS = EN_PROMPT_UNITS_BASE+(UNIT_WATTS*2),
EN_PROMPT_DB = EN_PROMPT_UNITS_BASE+(UNIT_DBM*2),
EN_PROMPT_FEET = EN_PROMPT_UNITS_BASE+(UNIT_FEET*2),
EN_PROMPT_KTS = EN_PROMPT_UNITS_BASE+(UNIT_KTS*2),
EN_PROMPT_MPH = EN_PROMPT_UNITS_BASE+(UNIT_KTS*2),
EN_PROMPT_HOURS = EN_PROMPT_UNITS_BASE+(UNIT_HOURS*2),
EN_PROMPT_MINUTES = EN_PROMPT_UNITS_BASE+(UNIT_MINUTES*2),
EN_PROMPT_SECONDS = EN_PROMPT_UNITS_BASE+(UNIT_SECONDS*2),
@ -97,12 +97,15 @@ I18N_PLAY_FUNCTION(en, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
unit--;
convertUnit(number, unit);
if (IS_IMPERIAL_ENABLE()) {
if (unit == UNIT_METERS) {
if (unit == UNIT_DIST) {
unit = UNIT_FEET;
}
if (unit == UNIT_SPEED) {
unit = UNIT_KTS;
}
}
#if defined(CPUARM)
if ((att & PREC1) && (unit == UNIT_FEET || (unit == UNIT_METERS && number >= 100))) {
if ((att & PREC1) && (unit == UNIT_FEET || (unit == UNIT_SPEED && number >= 100))) {
number /= 10;
att -= PREC1;
}

View file

@ -67,8 +67,8 @@ enum SpanishPrompts {
ES_PROMPT_AMPS = ES_PROMPT_UNITS_BASE+UNIT_AMPS,
ES_PROMPT_METERS_PER_SECOND = ES_PROMPT_UNITS_BASE+UNIT_METERS_PER_SECOND,
ES_PROMPT_SPARE1 = ES_PROMPT_UNITS_BASE+UNIT_RAW,
ES_PROMPT_KMH = ES_PROMPT_UNITS_BASE+UNIT_KMH,
ES_PROMPT_METERS = ES_PROMPT_UNITS_BASE+UNIT_METERS,
ES_PROMPT_KMH = ES_PROMPT_UNITS_BASE+UNIT_SPEED,
ES_PROMPT_METERS = ES_PROMPT_UNITS_BASE+UNIT_DIST,
ES_PROMPT_DEGREES = ES_PROMPT_UNITS_BASE+UNIT_DEGREES,
ES_PROMPT_PERCENT = ES_PROMPT_UNITS_BASE+UNIT_PERCENT,
ES_PROMPT_MILLIAMPS = ES_PROMPT_UNITS_BASE+UNIT_MILLIAMPS,
@ -134,12 +134,15 @@ I18N_PLAY_FUNCTION(es, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
unit--;
convertUnit(number, unit);
if (IS_IMPERIAL_ENABLE()) {
if (unit == UNIT_METERS) {
if (unit == UNIT_DIST) {
unit = UNIT_FEET;
}
if (unit == UNIT_SPEED) {
unit = UNIT_KTS;
}
}
#if defined(CPUARM)
if ((att & PREC1) && (unit == UNIT_FEET || (unit == UNIT_METERS && number >= 100))) {
if ((att & PREC1) && (unit == UNIT_FEET || (unit == UNIT_DIST && number >= 100))) {
number /= 10;
att -= PREC1;
}

View file

@ -48,8 +48,8 @@ enum FrenchPrompts {
FR_PROMPT_AMPS = FR_PROMPT_UNITS_BASE+UNIT_AMPS,
FR_PROMPT_METERS_PER_SECOND = FR_PROMPT_UNITS_BASE+UNIT_METERS_PER_SECOND,
FR_PROMPT_SPARE1 = FR_PROMPT_UNITS_BASE+UNIT_RAW,
FR_PROMPT_KMH = FR_PROMPT_UNITS_BASE+UNIT_KMH,
FR_PROMPT_METERS = FR_PROMPT_UNITS_BASE+UNIT_METERS,
FR_PROMPT_KMH = FR_PROMPT_UNITS_BASE+UNIT_SPEED,
FR_PROMPT_METERS = FR_PROMPT_UNITS_BASE+UNIT_DIST,
FR_PROMPT_DEGREES = FR_PROMPT_UNITS_BASE+UNIT_DEGREES,
FR_PROMPT_PERCENT = FR_PROMPT_UNITS_BASE+UNIT_PERCENT,
FR_PROMPT_MILLIAMPS = FR_PROMPT_UNITS_BASE+UNIT_MILLIAMPS,
@ -116,12 +116,15 @@ I18N_PLAY_FUNCTION(fr, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
unit--;
convertUnit(number, unit);
if (IS_IMPERIAL_ENABLE()) {
if (unit == UNIT_METERS) {
if (unit == UNIT_DIST) {
unit = UNIT_FEET;
}
if (unit == UNIT_SPEED) {
unit = UNIT_KTS;
}
}
#if defined(CPUARM)
if ((att & PREC1) && (unit == UNIT_FEET || (unit == UNIT_METERS && number >= 100))) {
if ((att & PREC1) && (unit == UNIT_FEET || (unit == UNIT_DIST && number >= 100))) {
number /= 10;
att -= PREC1;
}

View file

@ -44,8 +44,8 @@ enum ItalianPrompts {
IT_PROMPT_AMPS = IT_PROMPT_UNITS_BASE+UNIT_AMPS,
IT_PROMPT_METERS_PER_SECOND = IT_PROMPT_UNITS_BASE+UNIT_METERS_PER_SECOND,
IT_PROMPT_SPARE1 = IT_PROMPT_UNITS_BASE+UNIT_RAW,
IT_PROMPT_KMH = IT_PROMPT_UNITS_BASE+UNIT_KMH,
IT_PROMPT_METERS = IT_PROMPT_UNITS_BASE+UNIT_METERS,
IT_PROMPT_KMH = IT_PROMPT_UNITS_BASE+UNIT_SPEED,
IT_PROMPT_METERS = IT_PROMPT_UNITS_BASE+UNIT_DIST,
IT_PROMPT_DEGREES = IT_PROMPT_UNITS_BASE+UNIT_DEGREES,
IT_PROMPT_PERCENT = IT_PROMPT_UNITS_BASE+UNIT_PERCENT,
IT_PROMPT_MILLIAMPS = IT_PROMPT_UNITS_BASE+UNIT_MILLIAMPS,
@ -106,12 +106,15 @@ I18N_PLAY_FUNCTION(it, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
unit--;
convertUnit(number, unit);
if (IS_IMPERIAL_ENABLE()) {
if (unit == UNIT_METERS) {
if (unit == UNIT_DIST) {
unit = UNIT_FEET;
}
if (unit == UNIT_SPEED) {
unit = UNIT_KTS;
}
}
#if defined(CPUARM)
if ((att & PREC1) && (unit == UNIT_FEET || (unit == UNIT_METERS && number >= 100))) {
if ((att & PREC1) && (unit == UNIT_FEET || (unit == UNIT_DIST && number >= 100))) {
number /= 10;
att -= PREC1;
}

View file

@ -42,8 +42,8 @@ enum PolishPrompts {
PL_PROMPT_AMPS = PL_PROMPT_UNITS_BASE+(UNIT_AMPS*4),
PL_PROMPT_METERS_PER_SECOND = PL_PROMPT_UNITS_BASE+(UNIT_METERS_PER_SECOND*4),
PL_PROMPT_SPARE1 = PL_PROMPT_UNITS_BASE+(UNIT_RAW*4),
PL_PROMPT_KMH = PL_PROMPT_UNITS_BASE+(UNIT_KMH*4),
PL_PROMPT_METERS = PL_PROMPT_UNITS_BASE+(UNIT_METERS*4),
PL_PROMPT_KMH = PL_PROMPT_UNITS_BASE+(UNIT_SPEED*4),
PL_PROMPT_METERS = PL_PROMPT_UNITS_BASE+(UNIT_DIST*4),
PL_PROMPT_DEGREES = PL_PROMPT_UNITS_BASE+(UNIT_DEGREES*4),
PL_PROMPT_PERCENT = PL_PROMPT_UNITS_BASE+(UNIT_PERCENT*4),
PL_PROMPT_MILLIAMPS = PL_PROMPT_UNITS_BASE+(UNIT_MILLIAMPS*4),
@ -129,12 +129,15 @@ I18N_PLAY_FUNCTION(pl, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
unit--;
convertUnit(number, unit);
if (IS_IMPERIAL_ENABLE()) {
if (unit == UNIT_METERS) {
if (unit == UNIT_DIST) {
unit = UNIT_FEET;
}
if (unit == UNIT_SPEED) {
unit = UNIT_KTS;
}
}
#if defined(CPUARM)
if ((att & PREC1) && (unit == UNIT_FEET || (unit == UNIT_METERS && number >= 100))) {
if ((att & PREC1) && (unit == UNIT_FEET || (unit == UNIT_DIST && number >= 100))) {
number /= 10;
att -= PREC1;
}

View file

@ -67,8 +67,8 @@ enum PortuguesePrompts {
PT_PROMPT_AMPS = PT_PROMPT_UNITS_BASE+UNIT_AMPS,
PT_PROMPT_METERS_PER_SECOND = PT_PROMPT_UNITS_BASE+UNIT_METERS_PER_SECOND,
PT_PROMPT_SPARE1 = PT_PROMPT_UNITS_BASE+UNIT_RAW,
PT_PROMPT_KMH = PT_PROMPT_UNITS_BASE+UNIT_KMH,
PT_PROMPT_METERS = PT_PROMPT_UNITS_BASE+UNIT_METERS,
PT_PROMPT_KMH = PT_PROMPT_UNITS_BASE+UNIT_SPEED,
PT_PROMPT_METERS = PT_PROMPT_UNITS_BASE+UNIT_DIST,
PT_PROMPT_DEGREES = PT_PROMPT_UNITS_BASE+UNIT_DEGREES,
PT_PROMPT_PERCENT = PT_PROMPT_UNITS_BASE+UNIT_PERCENT,
PT_PROMPT_MILLIAMPS = PT_PROMPT_UNITS_BASE+UNIT_MILLIAMPS,
@ -119,12 +119,15 @@ I18N_PLAY_FUNCTION(pt, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
unit--;
convertUnit(number, unit);
if (IS_IMPERIAL_ENABLE()) {
if (unit == UNIT_METERS) {
if (unit == UNIT_DIST) {
unit = UNIT_FEET;
}
if (unit == UNIT_SPEED) {
unit = UNIT_KTS;
}
}
#if defined(CPUARM)
if ((att & PREC1) && (unit == UNIT_FEET || (unit == UNIT_METERS && number >= 100))) {
if ((att & PREC1) && (unit == UNIT_FEET || (unit == UNIT_DIST && number >= 100))) {
number /= 10;
att -= PREC1;
}

View file

@ -51,8 +51,8 @@ enum SwedishPrompts {
SE_PROMPT_AMPS = SE_PROMPT_UNITS_BASE+(UNIT_AMPS*2),
SE_PROMPT_METERS_PER_SECOND = SE_PROMPT_UNITS_BASE+(UNIT_METERS_PER_SECOND*2),
SE_PROMPT_SPARE1 = SE_PROMPT_UNITS_BASE+(UNIT_RAW*2),
SE_PROMPT_KMH = SE_PROMPT_UNITS_BASE+(UNIT_KMH*2),
SE_PROMPT_METERS = SE_PROMPT_UNITS_BASE+(UNIT_METERS*2),
SE_PROMPT_KMH = SE_PROMPT_UNITS_BASE+(UNIT_SPEED*2),
SE_PROMPT_METERS = SE_PROMPT_UNITS_BASE+(UNIT_DIST*2),
SE_PROMPT_DEGREES = SE_PROMPT_UNITS_BASE+(UNIT_DEGREES*2),
SE_PROMPT_PERCENT = SE_PROMPT_UNITS_BASE+(UNIT_PERCENT*2),
SE_PROMPT_MILLIAMPS = SE_PROMPT_UNITS_BASE+(UNIT_MILLIAMPS*2),
@ -84,12 +84,15 @@ I18N_PLAY_FUNCTION(se, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
unit--;
convertUnit(number, unit);
if (IS_IMPERIAL_ENABLE()) {
if (unit == UNIT_METERS) {
if (unit == UNIT_DIST) {
unit = UNIT_FEET;
}
if (unit == UNIT_SPEED) {
unit = UNIT_KTS;
}
}
#if defined(CPUARM)
if ((att & PREC1) && (unit == UNIT_FEET || (unit == UNIT_METERS && number >= 100))) {
if ((att & PREC1) && (unit == UNIT_FEET || (unit == UNIT_DIST && number >= 100))) {
number /= 10;
att -= PREC1;
}

View file

@ -56,8 +56,8 @@ enum SlovakPrompts {
SK_PROMPT_AMPS = SK_PROMPT_UNITS_BASE+(UNIT_AMPS*4),
SK_PROMPT_METERS_PER_SECOND = SK_PROMPT_UNITS_BASE+(UNIT_METERS_PER_SECOND*4),
SK_PROMPT_SPARE1 = SK_PROMPT_UNITS_BASE+(UNIT_RAW*4),
SK_PROMPT_KMH = SK_PROMPT_UNITS_BASE+(UNIT_KMH*4),
SK_PROMPT_METERS = SK_PROMPT_UNITS_BASE+(UNIT_METERS*4),
SK_PROMPT_KMH = SK_PROMPT_UNITS_BASE+(UNIT_SPEED*4),
SK_PROMPT_METERS = SK_PROMPT_UNITS_BASE+(UNIT_DIST*4),
SK_PROMPT_DEGREES = SK_PROMPT_UNITS_BASE+(UNIT_DEGREES*4),
SK_PROMPT_PERCENT = SK_PROMPT_UNITS_BASE+(UNIT_PERCENT*4),
SK_PROMPT_MILLIAMPS = SK_PROMPT_UNITS_BASE+(UNIT_MILLIAMPS*4),
@ -135,12 +135,15 @@ I18N_PLAY_FUNCTION(sk, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
unit--;
convertUnit(number, unit);
if (IS_IMPERIAL_ENABLE()) {
if (unit == UNIT_METERS) {
if (unit == UNIT_DIST) {
unit = UNIT_FEET;
}
if (unit == UNIT_SPEED) {
unit = UNIT_KTS;
}
}
#if defined(CPUARM)
if ((att & PREC1) && (unit == UNIT_FEET || (unit == UNIT_METERS && number >= 100))) {
if ((att & PREC1) && (unit == UNIT_FEET || (unit == UNIT_DIST && number >= 100))) {
number /= 10;
att -= PREC1;
}

View file

@ -146,7 +146,7 @@ def ttsEn():
"watt", "watts",
"db", "db",
"foot", "feet",
"knot", "knots",
"mile per hour", "miles per hour",
"hour", "hours",
"minute", "minutes",
"second", "seconds",