mirror of
https://github.com/opentx/opentx.git
synced 2025-07-26 17:55:19 +03:00
Lipo cells voltage badly displayed. Some flash saved.
This commit is contained in:
parent
4bd49938f3
commit
f98585acbe
5 changed files with 26 additions and 19 deletions
|
@ -432,6 +432,7 @@ void putsStrIdx(uint8_t x, uint8_t y, const pm_char *str, uint8_t idx, uint8_t a
|
|||
{
|
||||
lcd_putsAtt(x, y, str, att & ~BSS); // TODO use something else than BSS for LEADING0
|
||||
lcd_outdezNAtt(lcd_lastPos, y, idx, att|LEFT, 2);
|
||||
if (att&TWO_DOTS) lcd_putc(lcd_lastPos, y, ':');
|
||||
}
|
||||
|
||||
void putsChnRaw(uint8_t x, uint8_t y, uint8_t idx, uint8_t att)
|
||||
|
|
|
@ -75,6 +75,7 @@
|
|||
/* other flags */
|
||||
#define NO_UNIT UNSIGN
|
||||
#define SHRT_TM_MODE LEFT
|
||||
#define TWO_DOTS LEFT
|
||||
|
||||
extern uint8_t displayBuf[DISPLAY_W*DISPLAY_H/8];
|
||||
extern uint8_t lcd_lastPos;
|
||||
|
|
|
@ -93,12 +93,6 @@ void doMainScreenGrphics()
|
|||
}
|
||||
|
||||
#if defined(FRSKY)
|
||||
void displayA1A2(uint8_t x, uint8_t y, uint8_t idx)
|
||||
{
|
||||
lcd_puts(x, y, PSTR("A :"));
|
||||
lcd_putc(x+FW, y, '1'+idx);
|
||||
}
|
||||
|
||||
void displayRssiLine()
|
||||
{
|
||||
lcd_hline(0, 54, 128, 0); // separator
|
||||
|
@ -420,7 +414,7 @@ void menuMainView(uint8_t event)
|
|||
for (uint8_t i=0; i<2; i++) {
|
||||
if (g_model.frsky.channels[i].ratio) {
|
||||
blink = (FRSKY_alarmRaised(i) ? INVERS : 0);
|
||||
displayA1A2(x0, 2*FH, i);
|
||||
putsStrIdx(x0, 2*FH, STR_A, i+1, TWO_DOTS);
|
||||
x0 += 3*FW;
|
||||
putsTelemetryChannel(x0, 2*FH, i, frskyTelemetry[i].value, blink|DBLSIZE|LEFT);
|
||||
putsTelemetryChannel(x0+FW, 3*FH, i, frskyTelemetry[i].min, 0);
|
||||
|
@ -432,25 +426,22 @@ void menuMainView(uint8_t event)
|
|||
|
||||
#ifdef FRSKY_HUB
|
||||
// Cells voltage
|
||||
// TODO only display used cells!
|
||||
lcd_putsLeft( 5*FH-3, PSTR("V1=\004V2=\004V3=")) ;
|
||||
lcd_putsLeft( 6*FH-3, PSTR("V4=\004V5=\004V6="));
|
||||
{
|
||||
uint8_t x, y;
|
||||
x = 6*FW;
|
||||
y = 6*FH-3;
|
||||
x = 3*FW;
|
||||
y = 5*FH-3;
|
||||
for (uint8_t k=0; k<frskyHubData.cellsCount && k<6; k++) {
|
||||
uint8_t attr = (barsThresholds[6/*TODO constant*/] && frskyHubData.cellVolts[k] < barsThresholds[6/*TODO constant*/]) ? BLINK|PREC2 : PREC2;
|
||||
uint8_t attr = (barsThresholds[6/*TODO constant*/] && frskyHubData.cellVolts[k] < barsThresholds[6/*TODO constant*/]) ? BLINK|PREC2|LEFT : PREC2|LEFT;
|
||||
if (k == 3) {
|
||||
x = 6*FW;
|
||||
y = 7*FH-3;
|
||||
x = 3*FW;
|
||||
y = 6*FH-3;
|
||||
}
|
||||
putsStrIdx(x-3*FW, y, STR_V, k+1, TWO_DOTS);
|
||||
lcd_outdezNAtt(x, y, frskyHubData.cellVolts[k] * 2, attr, 4);
|
||||
x += 7*FW;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
displayRssiLine();
|
||||
}
|
||||
|
||||
|
@ -561,7 +552,7 @@ void menuMainView(uint8_t event)
|
|||
for (int i=0; i<2; i++) {
|
||||
if (g_model.frsky.channels[i].ratio) {
|
||||
blink = (FRSKY_alarmRaised(i) ? INVERS+BLINK : 0)|LEFT;
|
||||
displayA1A2(x0, y0, i);
|
||||
putsStrIdx(x0, y0, STR_A, i+1, TWO_DOTS);
|
||||
putsTelemetryChannel(x0+3*FW, y0, i, frskyTelemetry[i].value, blink);
|
||||
x0 = 12*FW-3;
|
||||
}
|
||||
|
|
|
@ -65,7 +65,12 @@
|
|||
#else
|
||||
#define TR_SDCLOGGS
|
||||
#endif
|
||||
#define TR_VFSWFUNC "Security \0 ""Trainer \0 ""Instant Trim ""Trims2Offsets""Play sound\0 " TR_SDCLOGGS
|
||||
#ifdef SOMO
|
||||
#define TR_SOMO "Play track\0 "
|
||||
#else
|
||||
#define TR_SOMO
|
||||
#endif
|
||||
#define TR_VFSWFUNC "Security \0 ""Trainer \0 ""Instant Trim ""Trims2Offsets""Play sound\0 " TR_SOMO TR_SDCLOGGS
|
||||
|
||||
#define LEN_FUNCSOUNDS 6
|
||||
#define TR_FUNCSOUNDS "Warn1 ""Warn2 ""Cheep ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""Siren ""AlmClk""Ratata""Tick ""Haptc1""Haptc2""Haptc3"
|
||||
|
@ -75,6 +80,8 @@
|
|||
|
||||
#define LEN_VTELEMUNIT 3
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""-\0 ""kts""kmh""M/h""m\0 ""@\0 ""%\0"
|
||||
#define STR_V (STR_VTELEMUNIT)
|
||||
#define STR_A (STR_VTELEMUNIT+LEN_VTELEMUNIT)
|
||||
|
||||
#define LEN_VALARM 3
|
||||
#define TR_VALARM "---""Yel""Org""Red"
|
||||
|
|
|
@ -65,7 +65,12 @@
|
|||
#else
|
||||
#define TR_SDCLOGGS
|
||||
#endif
|
||||
#define TR_VFSWFUNC "Securite \0 ""Ecolage \0 ""Trim instant ""Trims2Offsets""Jouer son " TR_SDCLOGGS
|
||||
#ifdef SOMO
|
||||
#define TR_SOMO "Jouer fichier"
|
||||
#else
|
||||
#define TR_SOMO
|
||||
#endif
|
||||
#define TR_VFSWFUNC "Securite \0 ""Ecolage \0 ""Trim instant ""Trims2Offsets""Jouer son " TR_SOMO TR_SDCLOGGS
|
||||
|
||||
#define LEN_FUNCSOUNDS 6
|
||||
#define TR_FUNCSOUNDS "Warn1 ""Warn2 ""Cheep ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""Siren ""AlmClk""Ratata""Tick ""Haptc1""Haptc2""Haptc3"
|
||||
|
@ -75,6 +80,8 @@
|
|||
|
||||
#define LEN_VTELEMUNIT 3
|
||||
#define TR_VTELEMUNIT "v\0 ""A\0 ""-\0 ""kts""kmh""M/h""m\0 ""@\0 ""%\0"
|
||||
#define STR_V (STR_VTELEMUNIT)
|
||||
#define STR_A (STR_VTELEMUNIT+LEN_VTELEMUNIT)
|
||||
|
||||
#define LEN_VALARM 3
|
||||
#define TR_VALARM "---""Yel""Org""Red"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue