Small corrections

This commit is contained in:
bsongis
2012-04-20 06:16:22 +00:00
parent 98e1c57db3
commit 9deddaaecd
9 changed files with 35 additions and 24 deletions
+1 -20
View File
@@ -826,6 +826,7 @@ int16_t convertTelemValue(uint8_t channel, uint8_t value)
result = value * 3;
break;
case TELEM_ALT:
case TELEM_GPSALT:
result = value * 4;
break;
case TELEM_RPM:
@@ -849,26 +850,6 @@ int16_t convertTelemValue(uint8_t channel, uint8_t value)
return result;
}
void putsTelemetryValue(uint8_t x, uint8_t y, int16_t val, uint8_t unit, uint8_t att)
{
#ifdef IMPERIAL_UNITS
if (unit == UNIT_DEGREES) {
val += 18 ;
val *= 115 ;
val >>= 6 ;
}
if (unit == UNIT_METERS) {
// m to ft *105/32
val = val * 3 + ( val >> 2 ) + (val >> 5) ;
unit = UNIT_MAX;
}
#endif
lcd_outdezAtt(x, (att & DBLSIZE ? y - FH : y), val, att & (~NO_UNIT)); // TODO we could add this test inside lcd_outdezAtt!
if (~att & NO_UNIT && unit != UNIT_RAW)
lcd_putsiAtt(lcd_lastPos/*+1*/, y, STR_VTELEMUNIT, unit, 0);
}
static const pm_uint8_t bchunit_ar[] PROGMEM = {
UNIT_METERS, // Alt
UNIT_RAW, // Rpm
-1
View File
@@ -177,7 +177,6 @@ int16_t convertTelemValue(uint8_t channel, uint8_t value);
NOINLINE uint8_t getRssiAlarmValue(uint8_t alarm);
void putsTelemetryChannel(uint8_t x, uint8_t y, uint8_t channel, int16_t val, uint8_t att);
void putsTelemetryValue(uint8_t x, uint8_t y, int16_t val, uint8_t unit, uint8_t att);
#endif
+1 -1
View File
@@ -61,7 +61,7 @@ const pm_char STR_OPEN9X[] PROGMEM =
ISTR(VFSWRESET)
ISTR(FUNCSOUNDS)
ISTR(VTELEMCHNS)
#ifdef FRSKY
#if defined(FRSKY) || defined(PCBARM)
ISTR(VTELEMUNIT)
ISTR(VALARM)
ISTR(VALARMFN)
+2 -2
View File
@@ -78,7 +78,7 @@ extern const pm_char STR_OPEN9X[];
#define OFS_VFSWRESET (OFS_VFSWFUNC + sizeof(TR_VFSWFUNC))
#define OFS_FUNCSOUNDS (OFS_VFSWRESET + sizeof(TR_VFSWRESET))
#define OFS_VTELEMCHNS (OFS_FUNCSOUNDS + sizeof(TR_FUNCSOUNDS))
#ifdef FRSKY
#if defined(FRSKY) || defined(PCBARM)
#define OFS_VTELEMUNIT (OFS_VTELEMCHNS + sizeof(TR_VTELEMCHNS))
#define OFS_VALARM (OFS_VTELEMUNIT + sizeof(TR_VTELEMUNIT))
#define OFS_VALARMFN (OFS_VALARM + sizeof(TR_VALARM))
@@ -142,7 +142,7 @@ extern const pm_char STR_OPEN9X[];
#define STR_FUNCSOUNDS (STR_OPEN9X + OFS_FUNCSOUNDS)
#define STR_VTELEMCHNS (STR_OPEN9X + OFS_VTELEMCHNS)
#ifdef FRSKY
#if defined(FRSKY) || defined(PCBARM)
#define STR_VTELEMUNIT (STR_OPEN9X + OFS_VTELEMUNIT)
#define STR_VALARM (STR_OPEN9X + OFS_VALARM)
#define STR_VALARMFN (STR_OPEN9X + OFS_VALARMFN)
+21
View File
@@ -655,6 +655,27 @@ void incRotaryEncoder(uint8_t idx, int8_t inc)
#endif
#if defined(FRSKY) || defined(PCBARM)
void putsTelemetryValue(uint8_t x, uint8_t y, int16_t val, uint8_t unit, uint8_t att)
{
#ifdef IMPERIAL_UNITS
if (unit == UNIT_DEGREES) {
val += 18 ;
val *= 115 ;
val >>= 6 ;
}
if (unit == UNIT_METERS) {
// m to ft *105/32
val = val * 3 + ( val >> 2 ) + (val >> 5) ;
}
#endif
lcd_outdezAtt(x, (att & DBLSIZE ? y - FH : y), val, att & (~NO_UNIT)); // TODO we could add this test inside lcd_outdezAtt!
if (~att & NO_UNIT && unit != UNIT_RAW)
lcd_putsiAtt(lcd_lastPos/*+1*/, y, STR_VTELEMUNIT, unit, 0);
}
#endif
void clearKeyEvents()
{
#ifdef SIMU
+4
View File
@@ -847,5 +847,9 @@ extern union ReusableBuffer reusableBuffer;
void checkFlashOnBeep();
#if defined(FRSKY) || defined(PCBARM)
void putsTelemetryValue(uint8_t x, uint8_t y, int16_t val, uint8_t unit, uint8_t att);
#endif
#endif // gruvin9x_h
/*eof*/
+2
View File
@@ -134,6 +134,8 @@
#define TR_VTELPROTO "NoneHub WSHH"
#elif defined(FRSKY_HUB)
#define TR_VTELPROTO "NoneHub "
#else
#define TR_VTELPROTO ""
#endif
#define LEN_GPSFORMAT "\004"
+2
View File
@@ -129,6 +129,8 @@
#define TR_VTELPROTO "NoneHub WSHH"
#elif defined(FRSKY_HUB)
#define TR_VTELPROTO "NoneHub "
#else
#define TR_VTELPROTO ""
#endif
#define LEN_GPSFORMAT "\004"
+2
View File
@@ -128,6 +128,8 @@
#define TR_VTELPROTO "--- Hub WSHH"
#elif defined(FRSKY_HUB)
#define TR_VTELPROTO "--- Hub "
#else
#define TR_VTELPROTO ""
#endif
#define LEN_GPSFORMAT "\004"