1
0
Fork 0
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:
bsongis 2012-02-15 21:00:57 +00:00
parent 4bd49938f3
commit f98585acbe
5 changed files with 26 additions and 19 deletions

View file

@ -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_putsAtt(x, y, str, att & ~BSS); // TODO use something else than BSS for LEADING0
lcd_outdezNAtt(lcd_lastPos, y, idx, att|LEFT, 2); 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) void putsChnRaw(uint8_t x, uint8_t y, uint8_t idx, uint8_t att)

View file

@ -75,6 +75,7 @@
/* other flags */ /* other flags */
#define NO_UNIT UNSIGN #define NO_UNIT UNSIGN
#define SHRT_TM_MODE LEFT #define SHRT_TM_MODE LEFT
#define TWO_DOTS LEFT
extern uint8_t displayBuf[DISPLAY_W*DISPLAY_H/8]; extern uint8_t displayBuf[DISPLAY_W*DISPLAY_H/8];
extern uint8_t lcd_lastPos; extern uint8_t lcd_lastPos;

View file

@ -93,12 +93,6 @@ void doMainScreenGrphics()
} }
#if defined(FRSKY) #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() void displayRssiLine()
{ {
lcd_hline(0, 54, 128, 0); // separator lcd_hline(0, 54, 128, 0); // separator
@ -420,7 +414,7 @@ void menuMainView(uint8_t event)
for (uint8_t i=0; i<2; i++) { for (uint8_t i=0; i<2; i++) {
if (g_model.frsky.channels[i].ratio) { if (g_model.frsky.channels[i].ratio) {
blink = (FRSKY_alarmRaised(i) ? INVERS : 0); blink = (FRSKY_alarmRaised(i) ? INVERS : 0);
displayA1A2(x0, 2*FH, i); putsStrIdx(x0, 2*FH, STR_A, i+1, TWO_DOTS);
x0 += 3*FW; x0 += 3*FW;
putsTelemetryChannel(x0, 2*FH, i, frskyTelemetry[i].value, blink|DBLSIZE|LEFT); putsTelemetryChannel(x0, 2*FH, i, frskyTelemetry[i].value, blink|DBLSIZE|LEFT);
putsTelemetryChannel(x0+FW, 3*FH, i, frskyTelemetry[i].min, 0); putsTelemetryChannel(x0+FW, 3*FH, i, frskyTelemetry[i].min, 0);
@ -432,25 +426,22 @@ void menuMainView(uint8_t event)
#ifdef FRSKY_HUB #ifdef FRSKY_HUB
// Cells voltage // 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; uint8_t x, y;
x = 6*FW; x = 3*FW;
y = 6*FH-3; y = 5*FH-3;
for (uint8_t k=0; k<frskyHubData.cellsCount && k<6; k++) { 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) { if (k == 3) {
x = 6*FW; x = 3*FW;
y = 7*FH-3; 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); lcd_outdezNAtt(x, y, frskyHubData.cellVolts[k] * 2, attr, 4);
x += 7*FW; x += 7*FW;
} }
} }
#endif #endif
displayRssiLine(); displayRssiLine();
} }
@ -561,7 +552,7 @@ void menuMainView(uint8_t event)
for (int i=0; i<2; i++) { for (int i=0; i<2; i++) {
if (g_model.frsky.channels[i].ratio) { if (g_model.frsky.channels[i].ratio) {
blink = (FRSKY_alarmRaised(i) ? INVERS+BLINK : 0)|LEFT; 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); putsTelemetryChannel(x0+3*FW, y0, i, frskyTelemetry[i].value, blink);
x0 = 12*FW-3; x0 = 12*FW-3;
} }

View file

@ -65,7 +65,12 @@
#else #else
#define TR_SDCLOGGS #define TR_SDCLOGGS
#endif #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 LEN_FUNCSOUNDS 6
#define TR_FUNCSOUNDS "Warn1 ""Warn2 ""Cheep ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""Siren ""AlmClk""Ratata""Tick ""Haptc1""Haptc2""Haptc3" #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 LEN_VTELEMUNIT 3
#define TR_VTELEMUNIT "v\0 ""A\0 ""-\0 ""kts""kmh""M/h""m\0 ""@\0 ""%\0" #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 LEN_VALARM 3
#define TR_VALARM "---""Yel""Org""Red" #define TR_VALARM "---""Yel""Org""Red"

View file

@ -65,7 +65,12 @@
#else #else
#define TR_SDCLOGGS #define TR_SDCLOGGS
#endif #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 LEN_FUNCSOUNDS 6
#define TR_FUNCSOUNDS "Warn1 ""Warn2 ""Cheep ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""Siren ""AlmClk""Ratata""Tick ""Haptc1""Haptc2""Haptc3" #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 LEN_VTELEMUNIT 3
#define TR_VTELEMUNIT "v\0 ""A\0 ""-\0 ""kts""kmh""M/h""m\0 ""@\0 ""%\0" #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 LEN_VALARM 3
#define TR_VALARM "---""Yel""Org""Red" #define TR_VALARM "---""Yel""Org""Red"