1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-23 08:15:17 +03:00

Fix lcdLastPos (#4487)

* Fix lcdLastPos
Introduce lcdLeftPos

* Cosmetics

* Cosmetics

* Non ARM code cleanup

* Move telem screen to midsize

* Fine tune

* Renaming
This commit is contained in:
3djc 2017-03-04 10:16:45 +01:00 committed by Bertrand Songis
parent 4a2bbc665c
commit 80b44444ec
36 changed files with 279 additions and 242 deletions

View file

@ -27,10 +27,11 @@ void lcdClear()
memset(displayBuf, 0, DISPLAY_BUFFER_SIZE);
}
coord_t lcdLastPos;
coord_t lcdLastRightPos;
coord_t lcdNextPos;
#if defined(CPUARM)
coord_t lcdLastLeftPos;
void lcdPutPattern(coord_t x, coord_t y, const uint8_t * pattern, uint8_t width, uint8_t height, LcdFlags flags)
{
bool blink = false;
@ -379,15 +380,20 @@ void lcdDrawSizedText(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdF
}
s++;
}
lcdLastPos = x;
lcdLastRightPos = x;
lcdNextPos = x;
#if defined(CPUARM) && !defined(BOOT)
if (fontsize == MIDSIZE) {
lcdLastPos += 1;
lcdLastRightPos += 1;
}
if (flags & RIGHT) {
lcdLastPos -= width;
lcdLastRightPos -= width;
lcdNextPos -= width;
lcdLastLeftPos = lcdLastRightPos;
lcdLastRightPos = orig_x;
}
else {
lcdLastLeftPos = orig_x;
}
#endif
}
@ -458,25 +464,40 @@ void lcdDrawNumber(coord_t x, coord_t y, lcdint_t val, LcdFlags flags)
void lcdDrawNumber(coord_t x, coord_t y, lcdint_t val, LcdFlags flags, uint8_t len)
{
#if defined(CPUARM)
char str[16+1];
char *s = str+16;
*s = '\0';
int idx = 0;
int mode = MODE(flags);
bool neg = false;
if (val < 0) {
val = -val;
neg = true;
}
do {
*--s = '0' + (val % 10);
++idx;
val /= 10;
if (mode!=0 && idx==mode) {
mode = 0;
*--s = '.';
if (val==0) {
*--s = '0';
}
}
} while (val!=0 || mode>0 || (mode==MODE(LEADING0) && idx<len));
if (neg) {
*--s = '-';
}
flags &= ~LEADING0;
lcdDrawText(x, y, s, flags);
#else // CPUARM
bool dblsize = flags & DBLSIZE;
uint8_t fw = FWNUM;
int8_t mode = MODE(flags);
flags &= ~LEADING0;
#if defined(CPUARM)
uint32_t fontsize = FONTSIZE(flags);
bool dblsize = (fontsize == DBLSIZE);
bool xxlsize = (fontsize == XXLSIZE);
bool midsize = (fontsize == MIDSIZE);
bool smlsize = (fontsize == SMLSIZE);
bool tinsize = (fontsize == TINSIZE);
#else
bool dblsize = flags & DBLSIZE;
#define xxlsize 0
#define midsize 0
#define smlsize 0
#define tinsize 0
#endif
bool neg = false;
if (flags & UNSIGN) {
flags -= UNSIGN;
@ -504,34 +525,25 @@ void lcdDrawNumber(coord_t x, coord_t y, lcdint_t val, LcdFlags flags, uint8_t l
if (dblsize) {
fw += FWNUM;
}
else if (xxlsize) {
fw += 4*FWNUM-1;
}
else if (midsize) {
fw += FWNUM-3;
}
else if (tinsize) {
fw -= 1;
}
else {
if (IS_LEFT_ALIGNED(flags)) {
if (mode > 0) {
x += 2;
}
}
#if defined(BOLD_FONT) && !defined(CPUM64) || defined(TELEMETRY_NONE)
#if defined(BOLD_FONT) && !defined(CPUM64) || defined(TELEMETRY_NONE)
if (flags & BOLD) fw += 1;
#endif
#endif
}
if (IS_LEFT_ALIGNED(flags)) {
x += len * fw;
if (neg) {
x += ((xxlsize|dblsize|midsize) ? 7 : FWNUM);
x += ((dblsize) ? 7 : FWNUM);
}
}
lcdLastPos = x;
lcdLastRightPos = x;
x -= fw;
if (dblsize) x++;
@ -560,29 +572,6 @@ void lcdDrawNumber(coord_t x, coord_t y, lcdint_t val, LcdFlags flags, uint8_t l
}
}
}
else if (xxlsize) {
x -= 17;
lcdDrawChar(x+2, y, '.', f);
}
else if (midsize) {
x -= 3;
xn = x;
}
else if (smlsize) {
x -= 2;
lcdDrawPoint(x, y+5);
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
lcdDrawSolidVerticalLine(x, y-1, 8);
}
}
else if (tinsize) {
x--;
lcdDrawPoint(x-1, y+4);
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
lcdDrawSolidVerticalLine(x-1, y-1, 7);
}
x--;
}
else {
x -= 2;
lcdDrawChar(x, y, '.', f);
@ -591,26 +580,17 @@ void lcdDrawNumber(coord_t x, coord_t y, lcdint_t val, LcdFlags flags, uint8_t l
if (dblsize && (lcduint_t)val >= 1000 && (lcduint_t)val < 10000) x-=2;
val = qr.quot;
x -= fw;
#if defined(BOLD_FONT) && !defined(CPUM64) || defined(TELEMETRY_NONE)
#if defined(BOLD_FONT) && !defined(CPUM64) || defined(TELEMETRY_NONE)
if (i==len && (flags & BOLD)) x += 1;
#endif
#endif
}
if (xn) {
if (midsize) {
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
lcdDrawSolidVerticalLine(xn, y, 12);
lcdDrawSolidVerticalLine(xn+1, y, 12);
}
lcdDrawSolidHorizontalLine(xn, y+9, 2);
lcdDrawSolidHorizontalLine(xn, y+10, 2);
}
else {
// TODO needed on CPUAVR? y &= ~0x07;
lcdDrawSolidFilledRect(xn, y+2*FH-3, ln, 2);
}
}
if (neg) lcdDrawChar(x, y, '-', flags);
#endif // CPUARM
}
#endif
@ -806,13 +786,12 @@ void drawRtcTime(coord_t x, coord_t y, LcdFlags att)
void drawTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2)
{
div_t qr;
if (IS_RIGHT_ALIGNED(att)) {
att -= RIGHT;
if (att & DBLSIZE)
x -= 5*(2*FWNUM)-4;
else if (att & MIDSIZE)
x -= 5*8-4;
x -= 5*8-8;
else
x -= 5*FWNUM+1;
}
@ -835,15 +814,18 @@ void drawTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2
#endif
lcdDrawNumber(x, y, qr.quot, att|LEADING0|LEFT, 2);
#if defined(CPUARM)
if (att & MIDSIZE) {
lcdLastRightPos--;
}
if (separator == CHR_HOUR)
att &= ~DBLSIZE;
#endif
#if defined(CPUARM) && defined(RTCLOCK)
if (att & TIMEBLINK)
lcdDrawChar(lcdLastPos, y, separator, BLINK);
lcdDrawChar(lcdLastRightPos, y, separator, BLINK);
else
#endif
lcdDrawChar(lcdLastPos, y, separator, att&att2);
lcdDrawChar(lcdLastRightPos, y, separator, att&att2);
lcdDrawNumber(lcdNextPos, y, qr.rem, (att2|LEADING0|LEFT) & (~RIGHT), 2);
}
@ -851,7 +833,7 @@ void drawTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2
void putsVolts(coord_t x, coord_t y, uint16_t volts, LcdFlags att)
{
lcdDrawNumber(x, y, (int16_t)volts, (~NO_UNIT) & (att | ((att&PREC2)==PREC2 ? 0 : PREC1)));
if (~att & NO_UNIT) lcdDrawChar(lcdLastPos, y, 'V', att);
if (~att & NO_UNIT) lcdDrawChar(lcdLastRightPos, y, 'V', att);
}
void putsVBat(coord_t x, coord_t y, LcdFlags att)
@ -886,7 +868,7 @@ void drawSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att)
#endif
{
drawStringWithIndex(x, y, "LUA", qr.quot+1, att);
lcdDrawChar(lcdLastPos, y, 'a'+qr.rem, att);
lcdDrawChar(lcdLastRightPos, y, 'a'+qr.rem, att);
}
}
#endif
@ -924,8 +906,8 @@ void drawSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att)
else if (idx <= MIXSRC_LAST_CH) {
drawStringWithIndex(x, y, STR_CH, idx-MIXSRC_CH1+1, att);
if (ZEXIST(g_model.limitData[idx-MIXSRC_CH1].name) && (att & STREXPANDED)) {
lcdDrawChar(lcdLastPos, y, ' ', att|SMLSIZE);
lcdDrawSizedText(lcdLastPos+3, y, g_model.limitData[idx-MIXSRC_CH1].name, LEN_CHANNEL_NAME, ZCHAR|att|SMLSIZE);
lcdDrawChar(lcdLastRightPos, y, ' ', att|SMLSIZE);
lcdDrawSizedText(lcdLastRightPos+3, y, g_model.limitData[idx-MIXSRC_CH1].name, LEN_CHANNEL_NAME, ZCHAR|att|SMLSIZE);
}
}
else if (idx <= MIXSRC_LAST_GVAR) {
@ -938,7 +920,7 @@ void drawSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att)
idx -= MIXSRC_FIRST_TELEM;
div_t qr = div(idx, 3);
lcdDrawSizedText(x, y, g_model.telemetrySensors[qr.quot].label, TELEM_LABEL_LEN, ZCHAR|att);
if (qr.rem) lcdDrawChar(lcdLastPos, y, qr.rem==2 ? '+' : '-', att);
if (qr.rem) lcdDrawChar(lcdLastRightPos, y, qr.rem==2 ? '+' : '-', att);
}
}
#else
@ -967,7 +949,7 @@ void drawSource(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
idx -= MIXSRC_FIRST_TELEM;
div_t qr = div(idx, 3);
lcdDrawSizedText(x, y, g_model.telemetrySensors[qr.quot].label, ZLEN(g_model.telemetrySensors[qr.quot].label), ZCHAR|att);
if (qr.rem) lcdDrawChar(lcdLastPos, y, qr.rem==2 ? '+' : '-', att);
if (qr.rem) lcdDrawChar(lcdLastRightPos, y, qr.rem==2 ? '+' : '-', att);
}
#else
else
@ -1113,7 +1095,7 @@ void drawValueWithUnit(coord_t x, coord_t y, lcdint_t val, uint8_t unit, LcdFlag
// convertUnit(val, unit);
lcdDrawNumber(x, y, val, att & (~NO_UNIT));
if (!(att & NO_UNIT) && unit != UNIT_RAW) {
lcdDrawTextAtIndex(lcdLastPos/*+1*/, y, STR_VTELEMUNIT, unit, 0);
lcdDrawTextAtIndex(lcdLastRightPos/*+1*/, y, STR_VTELEMUNIT, unit, 0);
}
}
@ -1122,28 +1104,28 @@ void drawGPSCoord(coord_t x, coord_t y, int32_t value, const char * direction, L
att &= ~RIGHT & ~BOLD;
uint32_t absvalue = abs(value);
lcdDrawNumber(x, y, absvalue / 1000000, att); // ddd
lcdDrawChar(lcdLastPos, y, '@', att);
lcdDrawChar(lcdLastRightPos, y, '@', att);
absvalue = absvalue % 1000000;
absvalue *= 60;
if (g_eeGeneral.gpsFormat == 0 || !seconds) {
lcdDrawNumber(lcdNextPos, y, absvalue / 1000000, att|LEFT|LEADING0, 2); // mm before '.'
lcdDrawSolidVerticalLine(lcdLastPos, y, 2);
lcdLastPos += 1;
lcdDrawSolidVerticalLine(lcdLastRightPos, y, 2);
lcdLastRightPos += 1;
if (seconds) {
absvalue %= 1000000;
absvalue *= 60;
absvalue /= 10000;
lcdDrawNumber(lcdLastPos+2, y, absvalue, att|LEFT|PREC2);
lcdDrawSolidVerticalLine(lcdLastPos, y, 2);
lcdDrawSolidVerticalLine(lcdLastPos+2, y, 2);
lcdLastPos += 3;
lcdDrawNumber(lcdLastRightPos+2, y, absvalue, att|LEFT|PREC2);
lcdDrawSolidVerticalLine(lcdLastRightPos, y, 2);
lcdDrawSolidVerticalLine(lcdLastRightPos+2, y, 2);
lcdLastRightPos += 3;
}
}
else {
absvalue /= 10000;
lcdDrawNumber(lcdLastPos+FW, y, absvalue, att|LEFT|PREC2); // mm.mmm
lcdDrawNumber(lcdLastRightPos+FW, y, absvalue, att|LEFT|PREC2); // mm.mmm
}
lcdDrawSizedText(lcdLastPos+1, y, direction + (value>=0 ? 0 : 1), 1);
lcdDrawSizedText(lcdLastRightPos+1, y, direction + (value>=0 ? 0 : 1), 1);
}
void drawDate(coord_t x, coord_t y, TelemetryItem & telemetryItem, LcdFlags att)
@ -1152,22 +1134,22 @@ void drawDate(coord_t x, coord_t y, TelemetryItem & telemetryItem, LcdFlags att)
x -= 42;
att &= ~0x0F00; // TODO constant
lcdDrawNumber(x, y, telemetryItem.datetime.day, att|LEADING0|LEFT, 2);
lcdDrawChar(lcdLastPos-1, y, '-', att);
lcdDrawChar(lcdLastRightPos-1, y, '-', att);
lcdDrawNumber(lcdNextPos-1, y, telemetryItem.datetime.month, att|LEFT, 2);
lcdDrawChar(lcdLastPos-1, y, '-', att);
lcdDrawChar(lcdLastRightPos-1, y, '-', att);
lcdDrawNumber(lcdNextPos-1, y, telemetryItem.datetime.year-2000, att|LEFT);
y += FH;
lcdDrawNumber(x, y, telemetryItem.datetime.hour, att|LEADING0|LEFT, 2);
lcdDrawChar(lcdLastPos, y, ':', att);
lcdDrawChar(lcdLastRightPos, y, ':', att);
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.min, att|LEADING0|LEFT, 2);
lcdDrawChar(lcdLastPos, y, ':', att);
lcdDrawChar(lcdLastRightPos, y, ':', att);
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.sec, att|LEADING0|LEFT, 2);
}
else {
lcdDrawNumber(x, y, telemetryItem.datetime.hour, att|LEADING0|LEFT, 2);
lcdDrawChar(lcdLastPos, y, ':', att);
lcdDrawChar(lcdLastRightPos, y, ':', att);
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.min, att|LEADING0|LEFT, 2);
lcdDrawChar(lcdLastPos, y, ':', att);
lcdDrawChar(lcdLastRightPos, y, ':', att);
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.sec, att|LEADING0|LEFT, 2);
}
}
@ -1196,7 +1178,7 @@ void drawValueWithUnit(coord_t x, coord_t y, lcdint_t val, uint8_t unit, LcdFlag
convertUnit(val, unit);
lcdDrawNumber(x, y, val, att & (~NO_UNIT));
if (!(att & NO_UNIT) && unit != UNIT_RAW) {
lcdDrawTextAtIndex(lcdLastPos/*+1*/, y, STR_VTELEMUNIT, unit, 0);
lcdDrawTextAtIndex(lcdLastRightPos/*+1*/, y, STR_VTELEMUNIT, unit, 0);
}
}
@ -1339,7 +1321,7 @@ void drawTelemetryValue(coord_t x, coord_t y, uint8_t channel, lcdint_t val, uin
case TELEM_TX_VOLTAGE-1:
lcdDrawNumber(x, y, val, (att|PREC1) & (~NO_UNIT));
if (!(att & NO_UNIT))
lcdDrawChar(lcdLastPos/*+1*/, y, 'V');
lcdDrawChar(lcdLastRightPos/*+1*/, y, 'V');
break;
}
}

View file

@ -130,7 +130,8 @@
extern display_t displayBuf[DISPLAY_BUFFER_SIZE];
extern coord_t lcdLastPos;
extern coord_t lcdLastRightPos;
extern coord_t lcdLastLeftPos;
extern coord_t lcdNextPos;
#define DISPLAY_END (displayBuf + DISPLAY_BUFFER_SIZE)

View file

@ -24,7 +24,7 @@ void displayPresetChoice(event_t event)
{
runPopupWarning(event);
lcdDrawNumber(WARNING_LINE_X+FW*7, WARNING_LINE_Y, 45*warningInputValue/4, LEFT|INVERS);
lcdDrawChar(lcdLastPos, WARNING_LINE_Y, '@', INVERS);
lcdDrawChar(lcdLastRightPos, WARNING_LINE_Y, '@', INVERS);
if (warningResult) {
warningResult = 0;
@ -99,7 +99,7 @@ void menuModelCurveOne(event_t event)
attr = (menuVerticalPosition==2 ? (s_editMode>0 ? INVERS|BLINK : INVERS) : 0);
lcdDrawTextAlignedLeft(5*FH+1, STR_COUNT);
lcdDrawNumber(INDENT_WIDTH, 6*FH+1, 5+crv.points, LEFT|attr);
lcdDrawText(lcdLastPos, 6*FH+1, STR_PTS, attr);
lcdDrawText(lcdLastRightPos, 6*FH+1, STR_PTS, attr);
if (attr) {
int8_t count = checkIncDecModel(event, crv.points, -3, 12); // 2pts - 17pts
if (checkIncDec_Ret) {

View file

@ -110,7 +110,7 @@ void menuModelCurveOne(event_t event)
lcdDrawTextAlignedLeft(7*FH, STR_TYPE);
uint8_t attr = (s_editMode <= 0 ? INVERS : 0);
lcdDrawNumber(5*FW-2, 7*FH, crv.points, LEFT|attr);
lcdDrawText(lcdLastPos, 7*FH, crv.custom ? PSTR("pt'") : PSTR("pt"), attr);
lcdDrawText(lcdLastRightPos, 7*FH, crv.custom ? PSTR("pt'") : PSTR("pt"), attr);
drawCurve();

View file

@ -396,7 +396,7 @@ void menuModelMixOne(event_t event)
{
TITLE(STR_MIXER);
MixData * md2 = mixAddress(s_currIdx) ;
putsChn(lcdLastPos+1*FW, 0, md2->destCh+1,0);
putsChn(lcdLastRightPos+1*FW, 0, md2->destCh+1,0);
#if defined(ROTARY_ENCODERS)
#if defined(CURVES)

View file

@ -43,14 +43,14 @@ void putsEdgeDelayParam(coord_t x, coord_t y, LogicalSwitchData *cs, uint8_t lat
{
lcdDrawChar(x-4, y, '[');
lcdDrawNumber(x, y, lswTimerValue(cs->v2), LEFT|PREC1|lattr);
lcdDrawChar(lcdLastPos, y, ':');
lcdDrawChar(lcdLastRightPos, y, ':');
if (cs->v3 < 0)
lcdDrawText(lcdLastPos+3, y, "<<", rattr);
lcdDrawText(lcdLastRightPos+3, y, "<<", rattr);
else if (cs->v3 == 0)
lcdDrawText(lcdLastPos+3, y, "--", rattr);
lcdDrawText(lcdLastRightPos+3, y, "--", rattr);
else
lcdDrawNumber(lcdLastPos+3, y, lswTimerValue(cs->v2+cs->v3), LEFT|PREC1|rattr);
lcdDrawChar(lcdLastPos, y, ']');
lcdDrawNumber(lcdLastRightPos+3, y, lswTimerValue(cs->v2+cs->v3), LEFT|PREC1|rattr);
lcdDrawChar(lcdLastRightPos, y, ']');
}
#define CSWONE_2ND_COLUMN (11*FW)

View file

@ -326,7 +326,7 @@ void menuModelSelect(event_t event)
#if defined(EEPROM_RLC) && defined(CPUARM)
lcdDrawText(9*FW-(LEN_FREE-4)*FW-4, 0, STR_FREE);
if (event) reusableBuffer.modelsel.eepromfree = EeFsGetFree();
lcdDrawNumber(lcdLastPos+3, 0, reusableBuffer.modelsel.eepromfree, LEFT);
lcdDrawNumber(lcdLastRightPos+3, 0, reusableBuffer.modelsel.eepromfree, LEFT);
#elif defined(EEPROM_RLC)
lcdDrawText(9*FW-(LEN_FREE-4)*FW, 0, STR_FREE);
if (event) reusableBuffer.modelsel.eepromfree = EeFsGetFree();

View file

@ -723,9 +723,9 @@ void menuModelSetup(event_t event)
lcdDrawTextAlignedLeft(y, STR_CHANNELRANGE);
if ((int8_t)PORT_CHANNELS_ROWS(moduleIdx) >= 0) {
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, STR_CH, menuHorizontalPosition==0 ? attr : 0);
lcdDrawNumber(lcdLastPos, y, moduleData.channelsStart+1, LEFT | (menuHorizontalPosition==0 ? attr : 0));
lcdDrawChar(lcdLastPos, y, '-');
lcdDrawNumber(lcdLastPos + FW+1, y, moduleData.channelsStart+NUM_CHANNELS(moduleIdx), LEFT | (menuHorizontalPosition==1 ? attr : 0));
lcdDrawNumber(lcdLastRightPos, y, moduleData.channelsStart+1, LEFT | (menuHorizontalPosition==0 ? attr : 0));
lcdDrawChar(lcdLastRightPos, y, '-');
lcdDrawNumber(lcdLastRightPos + FW+1, y, moduleData.channelsStart+NUM_CHANNELS(moduleIdx), LEFT | (menuHorizontalPosition==1 ? attr : 0));
if (attr && (editMode>0 || p1valdiff)) {
switch (menuHorizontalPosition) {
case 0:
@ -953,9 +953,9 @@ void menuModelSetup(event_t event)
lcdDrawTextAlignedLeft(y, PSTR("Port2"));
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VPROTOS, 0, 0);
lcdDrawText(MODEL_SETUP_2ND_COLUMN+4*FW+3, y, STR_CH, menuHorizontalPosition<=0 ? attr : 0);
lcdDrawNumber(lcdLastPos, y, g_model.moduleData[1].channelsStart+1, LEFT | (menuHorizontalPosition<=0 ? attr : 0));
lcdDrawChar(lcdLastPos, y, '-');
lcdDrawNumber(lcdLastPos + FW+1, y, g_model.moduleData[1].channelsStart+8+g_model.moduleData[1].channelsCount, LEFT | (menuHorizontalPosition!=0 ? attr : 0));
lcdDrawNumber(lcdLastRightPos, y, g_model.moduleData[1].channelsStart+1, LEFT | (menuHorizontalPosition<=0 ? attr : 0));
lcdDrawChar(lcdLastRightPos, y, '-');
lcdDrawNumber(lcdLastRightPos + FW+1, y, g_model.moduleData[1].channelsStart+8+g_model.moduleData[1].channelsCount, LEFT | (menuHorizontalPosition!=0 ? attr : 0));
if (attr && (editMode>0 || p1valdiff)) {
switch (menuHorizontalPosition) {
case 0:

View file

@ -373,7 +373,7 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
else if (func == FUNC_LOGS) {
if (val_displayed) {
lcdDrawNumber(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|PREC1|LEFT);
lcdDrawChar(lcdLastPos, y, 's');
lcdDrawChar(lcdLastRightPos, y, 's');
}
else {
lcdDrawMMM(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, attr);

View file

@ -519,7 +519,7 @@ void menuModelTelemetryFrsky(event_t event)
if (k>=ITEM_TELEMETRY_SENSOR1 && k<ITEM_TELEMETRY_SENSOR1+MAX_TELEMETRY_SENSORS) {
int index = k - ITEM_TELEMETRY_SENSOR1;
lcdDrawNumber(INDENT_WIDTH, y, index+1, LEFT|attr);
lcdDrawChar(lcdLastPos, y, ':', attr);
lcdDrawChar(lcdLastRightPos, y, ':', attr);
lcdDrawSizedText(3*FW, y, g_model.telemetrySensors[index].label, TELEM_LABEL_LEN, ZCHAR);
if (telemetryItems[index].isFresh()) {
lcdDrawChar(16*FW, y, '*');
@ -530,7 +530,7 @@ void menuModelTelemetryFrsky(event_t event)
lcdNextPos = TELEM_COL2;
if (isOld) lcdDrawChar(lcdNextPos, y, '[');
drawSensorCustomValue(lcdNextPos, y, index, getValue(MIXSRC_FIRST_TELEM+3*index), LEFT);
if (isOld) lcdDrawChar(lcdLastPos, y, ']');
if (isOld) lcdDrawChar(lcdLastRightPos, y, ']');
}
else {
lcdDrawText(TELEM_COL2, y, "---", 0); // TODO shortcut
@ -626,7 +626,7 @@ void menuModelTelemetryFrsky(event_t event)
case ITEM_TELEMETRY_A2_RANGE:
lcdDrawTextAlignedLeft(y, STR_RANGE);
drawTelemetryValue(TELEM_COL2, y, dest, 255-channel.offset, (menuHorizontalPosition<=0 ? attr : 0)|NO_UNIT|LEFT);
lcdDrawTextAtIndex(lcdLastPos, y, STR_VTELEMUNIT, channel.type, menuHorizontalPosition!=0 ? attr : 0);
lcdDrawTextAtIndex(lcdLastRightPos, y, STR_VTELEMUNIT, channel.type, menuHorizontalPosition!=0 ? attr : 0);
if (attr && (s_editMode>0 || p1valdiff)) {
if (menuHorizontalPosition == 0) {
uint16_t ratio = checkIncDec(event, channel.ratio, 0, 256, EE_MODEL);

View file

@ -603,7 +603,7 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t
// TODO lcdDrawFilledRect(0, 0, LCD_W, MENU_HEADER_HEIGHT, SOLID, FILL_WHITE|GREY_DEFAULT);
}
DISPLAY_PROGRESS_BAR(menuTab ? lcdLastPos-2*FW-((curr+1)/10*FWNUM)-2 : 20*FW+1);
DISPLAY_PROGRESS_BAR(menuTab ? lcdLastRightPos-2*FW-((curr+1)/10*FWNUM)-2 : 20*FW+1);
switch (event) {
case EVT_ENTRY:
@ -898,7 +898,7 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t
}
DISPLAY_PROGRESS_BAR(menuTab ? lcdLastPos-2*FW-((curr+1)/10*FWNUM)-2 : 20*FW+1);
DISPLAY_PROGRESS_BAR(menuTab ? lcdLastRightPos-2*FW-((curr+1)/10*FWNUM)-2 : 20*FW+1);
if (s_editMode<=0) {
if (scrollUD) {

View file

@ -218,8 +218,8 @@ void menuRadioSetup(event_t event)
case ITEM_SETUP_BATT_RANGE:
lcdDrawTextAlignedLeft(y, STR_BATTERY_RANGE);
putsVolts(RADIO_SETUP_2ND_COLUMN, y, 90+g_eeGeneral.vBatMin, (menuHorizontalPosition==0 ? attr : 0)|LEFT|NO_UNIT);
lcdDrawChar(lcdLastPos, y, '-');
putsVolts(lcdLastPos+FW, y, 120+g_eeGeneral.vBatMax, (menuHorizontalPosition>0 ? attr : 0)|LEFT|NO_UNIT);
lcdDrawChar(lcdLastRightPos, y, '-');
putsVolts(lcdLastRightPos+FW, y, 120+g_eeGeneral.vBatMax, (menuHorizontalPosition>0 ? attr : 0)|LEFT|NO_UNIT);
if (attr && s_editMode>0) {
if (menuHorizontalPosition==0)
CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatMin, -50, g_eeGeneral.vBatMax+29); // min=4.0V
@ -299,7 +299,7 @@ void menuRadioSetup(event_t event)
#if defined(CPUARM)
lcdDrawChar(RADIO_SETUP_2ND_COLUMN, y, '+', attr);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN+FW, y, g_eeGeneral.speakerPitch*15, attr|LEFT);
lcdDrawText(lcdLastPos, y, "Hz", attr);
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
#else
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.speakerPitch, attr|LEFT);
#endif
@ -319,19 +319,19 @@ void menuRadioSetup(event_t event)
case ITEM_SETUP_VARIO_PITCH:
lcdDrawTextAlignedLeft(y, STR_PITCH_AT_ZERO);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10), attr|LEFT);
lcdDrawText(lcdLastPos, y, "Hz", attr);
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioPitch, -40, 40);
break;
case ITEM_SETUP_VARIO_RANGE:
lcdDrawTextAlignedLeft(y, STR_PITCH_AT_MAX);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10)+VARIO_FREQUENCY_RANGE+(g_eeGeneral.varioRange*10), attr|LEFT);
lcdDrawText(lcdLastPos, y, "Hz", attr);
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRange, -80, 80);
break;
case ITEM_SETUP_VARIO_REPEAT:
lcdDrawTextAlignedLeft(y, STR_REPEAT_AT_ZERO);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_REPEAT_ZERO+(g_eeGeneral.varioRepeat*10), attr|LEFT);
lcdDrawText(lcdLastPos, y, STR_MS, attr);
lcdDrawText(lcdLastRightPos, y, STR_MS, attr);
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRepeat, -30, 50);
break;
#endif
@ -406,7 +406,7 @@ void menuRadioSetup(event_t event)
case ITEM_SETUP_INACTIVITY_ALARM:
lcdDrawTextAlignedLeft(y, STR_INACTIVITYALARM);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.inactivityTimer, attr|LEFT);
lcdDrawChar(lcdLastPos, y, 'm');
lcdDrawChar(lcdLastRightPos, y, 'm');
if(attr) g_eeGeneral.inactivityTimer = checkIncDec(event, g_eeGeneral.inactivityTimer, 0, 250, EE_GENERAL); //0..250minutes
break;
@ -434,7 +434,7 @@ void menuRadioSetup(event_t event)
case ITEM_SETUP_BACKLIGHT_DELAY:
lcdDrawTextAlignedLeft(y, STR_BLDELAY);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.lightAutoOff*5, attr|LEFT);
lcdDrawChar(lcdLastPos, y, 's');
lcdDrawChar(lcdLastRightPos, y, 's');
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.lightAutoOff, 0, 600/5);
break;
@ -537,7 +537,7 @@ void menuRadioSetup(event_t event)
case ITEM_SETUP_SWITCHES_DELAY:
lcdDrawTextAlignedLeft(y, STR_SWITCHES_DELAY);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, 10*SWITCHES_DELAY(), attr|LEFT);
lcdDrawText(lcdLastPos, y, STR_MS, attr);
lcdDrawText(lcdLastRightPos, y, STR_MS, attr);
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.switchesDelay, -15, +15);
break;
#endif

View file

@ -496,7 +496,7 @@ void menuModelTelemetryMavlink(event_t event) {
case ITEM_MAVLINK_RC_RSSI_SCALE:
lcdDrawTextAlignedLeft(y, STR_MAVLINK_RC_RSSI_SCALE_LABEL);
lcdDrawNumber(VIEW_MAVLINK_2ND_COLUMN, y, (25 + g_model.mavlink.rc_rssi_scale * 5), attr|LEFT);
lcdDrawChar(lcdLastPos, y, '%');
lcdDrawChar(lcdLastRightPos, y, '%');
if (attr) CHECK_INCDEC_MODELVAR(event, g_model.mavlink.rc_rssi_scale, 0, 15);
break;
case ITEM_MAVLINK_PC_RSSI_EN:

View file

@ -171,16 +171,16 @@ void menuStatisticsDebug(event_t event)
#if defined(CPUARM)
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_MIXMAX, STR_TMIXMAXMS);
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_MIXMAX, DURATION_MS_PREC2(maxMixerDuration), PREC2|LEFT);
lcdDrawText(lcdLastPos, MENU_DEBUG_Y_MIXMAX, "ms");
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_MIXMAX, "ms");
#endif
#if defined(CPUARM)
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_RTOS, STR_FREESTACKMINB);
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS+2, menusStack.available(), UNSIGN|LEFT|TINSIZE);
lcdDrawText(lcdLastPos, MENU_DEBUG_Y_RTOS, "/");
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_RTOS+2, mixerStack.available(), UNSIGN|LEFT|TINSIZE);
lcdDrawText(lcdLastPos, MENU_DEBUG_Y_RTOS, "/");
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_RTOS+2, audioStack.available(), UNSIGN|LEFT|TINSIZE);
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_RTOS, "/");
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_RTOS+2, mixerStack.available(), UNSIGN|LEFT|TINSIZE);
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_RTOS, "/");
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_RTOS+2, audioStack.available(), UNSIGN|LEFT|TINSIZE);
#endif
#if !defined(CPUARM)

View file

@ -72,24 +72,24 @@ void drawGPSCoord(uint8_t y, char direction, int16_t bp, int16_t ap)
if (telemetryData.hub.gpsFix >= 0) {
if (!direction) direction = '-';
lcdDrawNumber(TELEM_2ND_COLUMN, y, bp / 100, LEFT); // ddd before '.'
lcdDrawChar(lcdLastPos, y, '@');
lcdDrawChar(lcdLastRightPos, y, '@');
uint8_t mn = bp % 100; // TODO div_t
if (g_eeGeneral.gpsFormat == 0) {
lcdDrawChar(lcdLastPos+FWNUM, y, direction);
lcdDrawNumber(lcdLastPos+FW+FW+1, y, mn, LEFT|LEADING0, 2); // mm before '.'
lcdDrawSolidVerticalLine(lcdLastPos, y, 2);
lcdDrawChar(lcdLastRightPos+FWNUM, y, direction);
lcdDrawNumber(lcdLastRightPos+FW+FW+1, y, mn, LEFT|LEADING0, 2); // mm before '.'
lcdDrawSolidVerticalLine(lcdLastRightPos, y, 2);
uint16_t ss = ap * 6;
lcdDrawNumber(lcdLastPos+3, y, ss / 1000, LEFT|LEADING0, 2); // ''
lcdDrawPoint(lcdLastPos, y+FH-2, 0); // small decimal point
lcdDrawNumber(lcdLastPos+2, y, ss % 1000, LEFT|LEADING0, 3); // ''
lcdDrawSolidVerticalLine(lcdLastPos, y, 2);
lcdDrawSolidVerticalLine(lcdLastPos+2, y, 2);
lcdDrawNumber(lcdLastRightPos+3, y, ss / 1000, LEFT|LEADING0, 2); // ''
lcdDrawPoint(lcdLastRightPos, y+FH-2, 0); // small decimal point
lcdDrawNumber(lcdLastRightPos+2, y, ss % 1000, LEFT|LEADING0, 3); // ''
lcdDrawSolidVerticalLine(lcdLastRightPos, y, 2);
lcdDrawSolidVerticalLine(lcdLastRightPos+2, y, 2);
}
else {
lcdDrawNumber(lcdLastPos+FW, y, mn, LEFT|LEADING0, 2); // mm before '.'
lcdDrawPoint(lcdLastPos, y+FH-2, 0); // small decimal point
lcdDrawNumber(lcdLastPos+2, y, ap, LEFT|UNSIGN|LEADING0, 4); // after '.'
lcdDrawChar(lcdLastPos+1, y, direction);
lcdDrawNumber(lcdLastRightPos+FW, y, mn, LEFT|LEADING0, 2); // mm before '.'
lcdDrawPoint(lcdLastRightPos, y+FH-2, 0); // small decimal point
lcdDrawNumber(lcdLastRightPos+2, y, ap, LEFT|UNSIGN|LEADING0, 4); // after '.'
lcdDrawChar(lcdLastRightPos+1, y, direction);
}
}
else {
@ -324,7 +324,7 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
}
}
if (field) {
LcdFlags att = (i==3 ? RIGHT|NO_UNIT : RIGHT|DBLSIZE|NO_UNIT);
LcdFlags att = (i==3 ? RIGHT|NO_UNIT : RIGHT|MIDSIZE|NO_UNIT);
coord_t pos[] = {0, 65, 130};
if (field >= MIXSRC_FIRST_TIMER && field <= MIXSRC_LAST_TIMER && i!=3) {
// there is not enough space on LCD for displaying "Tmr1" or "Tmr2" and still see the - sign, we write "T1" or "T2" instead
@ -332,6 +332,7 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
}
else if (field >= MIXSRC_FIRST_TELEM && isGPSSensor(1+(field-MIXSRC_FIRST_TELEM)/3) && telemetryItems[(field-MIXSRC_FIRST_TELEM)/3].isAvailable()) {
// we don't display GPS name, no space for it
att = RIGHT|DBLSIZE|NO_UNIT; //DBLSIZE ensure the telem screen specific display for GPS is used
}
else {
drawSource(pos[j], 1+FH+2*FH*i, field, 0);

View file

@ -39,7 +39,8 @@ void lcdClear()
memset(displayBuf, 0, DISPLAY_BUFFER_SIZE);
}
coord_t lcdLastPos;
coord_t lcdLastRightPos;
coord_t lcdLastLeftPos;
coord_t lcdNextPos;
struct PatternData
@ -325,15 +326,20 @@ void lcdDrawSizedText(coord_t x, coord_t y, const char * s, uint8_t len, LcdFlag
s++;
}
lcdLastPos = x;
lcdLastRightPos = x;
lcdNextPos = x;
if (fontsize == MIDSIZE) {
lcdLastPos += 1;
lcdLastRightPos += 1;
}
if (flags & RIGHT) {
lcdLastPos -= width;
lcdLastRightPos -= width;
lcdNextPos -= width;
lcdLastLeftPos = lcdLastRightPos;
lcdLastRightPos = orig_x;
}
else {
lcdLastLeftPos = orig_x;
}
}
@ -558,7 +564,7 @@ void drawTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2
void putsVolts(coord_t x, coord_t y, uint16_t volts, LcdFlags att)
{
lcdDrawNumber(x, y, (int16_t)volts, (~NO_UNIT) & (att | ((att&PREC2)==PREC2 ? 0 : PREC1)));
if (~att & NO_UNIT) lcdDrawChar(lcdLastPos, y, 'V', att);
if (~att & NO_UNIT) lcdDrawChar(lcdLastRightPos, y, 'V', att);
}
void putsVBat(coord_t x, coord_t y, LcdFlags att)
@ -598,7 +604,7 @@ void drawSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att)
#endif
{
drawStringWithIndex(x, y, "LUA", qr.quot+1, att);
lcdDrawChar(lcdLastPos, y, 'a'+qr.rem, att);
lcdDrawChar(lcdLastRightPos, y, 'a'+qr.rem, att);
}
}
@ -634,8 +640,8 @@ void drawSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att)
else if (idx <= MIXSRC_LAST_CH) {
drawStringWithIndex(x, y, STR_CH, idx-MIXSRC_CH1+1, att);
if (ZEXIST(g_model.limitData[idx-MIXSRC_CH1].name) && (att & STREXPANDED)) {
lcdDrawChar(lcdLastPos, y, ' ', att|SMLSIZE);
lcdDrawSizedText(lcdLastPos+3, y, g_model.limitData[idx-MIXSRC_CH1].name, LEN_CHANNEL_NAME, ZCHAR|att|SMLSIZE);
lcdDrawChar(lcdLastRightPos, y, ' ', att|SMLSIZE);
lcdDrawSizedText(lcdLastRightPos+3, y, g_model.limitData[idx-MIXSRC_CH1].name, LEN_CHANNEL_NAME, ZCHAR|att|SMLSIZE);
}
}
else if (idx <= MIXSRC_LAST_GVAR) {
@ -648,7 +654,7 @@ void drawSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att)
idx -= MIXSRC_FIRST_TELEM;
div_t qr = div(idx, 3);
lcdDrawSizedText(x, y, g_model.telemetrySensors[qr.quot].label, TELEM_LABEL_LEN, ZCHAR|att);
if (qr.rem) lcdDrawChar(lcdLastPos, y, qr.rem==2 ? '+' : '-', att);
if (qr.rem) lcdDrawChar(lcdLastRightPos, y, qr.rem==2 ? '+' : '-', att);
}
}
@ -717,7 +723,7 @@ void drawValueWithUnit(coord_t x, coord_t y, int32_t val, uint8_t unit, LcdFlags
// convertUnit(val, unit);
lcdDrawNumber(x, y, val, att & (~NO_UNIT));
if (!(att & NO_UNIT) && unit != UNIT_RAW) {
lcdDrawTextAtIndex(lcdLastPos/*+1*/, y, STR_VTELEMUNIT, unit, 0);
lcdDrawTextAtIndex(lcdLastRightPos/*+1*/, y, STR_VTELEMUNIT, unit, 0);
}
}
@ -727,28 +733,28 @@ void drawGPSCoord(coord_t x, coord_t y, int32_t value, const char * direction, L
att &= ~RIGHT;
if (x > 10) x-=10;
lcdDrawNumber(x, y, absvalue / 1000000, att); // ddd
lcdDrawChar(lcdLastPos, y, '@', att);
lcdDrawChar(lcdLastRightPos, y, '@', att);
absvalue = absvalue % 1000000;
absvalue *= 60;
if (g_eeGeneral.gpsFormat == 0 || !seconds) {
lcdDrawNumber(lcdNextPos, y, absvalue / 1000000, att|LEFT|LEADING0, 2); // mm before '.'
lcdDrawSolidVerticalLine(lcdLastPos, y, 2);
lcdLastPos += 1;
lcdDrawSolidVerticalLine(lcdLastRightPos, y, 2);
lcdLastRightPos += 1;
if (seconds) {
absvalue %= 1000000;
absvalue *= 60;
absvalue /= 10000;
lcdDrawNumber(lcdLastPos+2, y, absvalue, att|LEFT|PREC2);
lcdDrawSolidVerticalLine(lcdLastPos, y, 2);
lcdDrawSolidVerticalLine(lcdLastPos+2, y, 2);
lcdLastPos += 3;
lcdDrawNumber(lcdLastRightPos+2, y, absvalue, att|LEFT|PREC2);
lcdDrawSolidVerticalLine(lcdLastRightPos, y, 2);
lcdDrawSolidVerticalLine(lcdLastRightPos+2, y, 2);
lcdLastRightPos += 3;
}
}
else {
absvalue /= 10000;
lcdDrawNumber(lcdLastPos+FW, y, absvalue, att|LEFT|PREC2); // mm.mmm
lcdDrawNumber(lcdLastRightPos+FW, y, absvalue, att|LEFT|PREC2); // mm.mmm
}
lcdDrawSizedText(lcdLastPos+1, y, direction + (value>=0 ? 0 : 1), 1);
lcdDrawSizedText(lcdLastRightPos+1, y, direction + (value>=0 ? 0 : 1), 1);
}
void drawDate(coord_t x, coord_t y, TelemetryItem & telemetryItem, LcdFlags att)
@ -757,27 +763,27 @@ void drawDate(coord_t x, coord_t y, TelemetryItem & telemetryItem, LcdFlags att)
x -= 42;
att &= ~0x0F00; // TODO constant
lcdDrawNumber(x, y, telemetryItem.datetime.day, att|LEADING0|LEFT, 2);
lcdDrawChar(lcdLastPos-1, y, '-', att);
lcdDrawChar(lcdLastRightPos-1, y, '-', att);
lcdDrawNumber(lcdNextPos-1, y, telemetryItem.datetime.month, att|LEFT, 2);
lcdDrawChar(lcdLastPos-1, y, '-', att);
lcdDrawChar(lcdLastRightPos-1, y, '-', att);
lcdDrawNumber(lcdNextPos-1, y, telemetryItem.datetime.year-2000, att|LEFT);
y += FH;
lcdDrawNumber(x, y, telemetryItem.datetime.hour, att|LEADING0|LEFT, 2);
lcdDrawChar(lcdLastPos, y, ':', att);
lcdDrawChar(lcdLastRightPos, y, ':', att);
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.min, att|LEADING0|LEFT, 2);
lcdDrawChar(lcdLastPos, y, ':', att);
lcdDrawChar(lcdLastRightPos, y, ':', att);
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.sec, att|LEADING0|LEFT, 2);
}
else {
lcdDrawNumber(x, y, telemetryItem.datetime.day, att|LEADING0|LEFT, 2);
lcdDrawChar(lcdLastPos-1, y, '-', att);
lcdDrawChar(lcdLastRightPos-1, y, '-', att);
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.month, att|LEFT, 2);
lcdDrawChar(lcdLastPos-1, y, '-', att);
lcdDrawChar(lcdLastRightPos-1, y, '-', att);
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.year-2000, att|LEFT);
lcdDrawNumber(lcdNextPos+FW+1, y, telemetryItem.datetime.hour, att|LEADING0|LEFT, 2);
lcdDrawChar(lcdLastPos, y, ':', att);
lcdDrawChar(lcdLastRightPos, y, ':', att);
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.min, att|LEADING0|LEFT, 2);
lcdDrawChar(lcdLastPos, y, ':', att);
lcdDrawChar(lcdLastRightPos, y, ':', att);
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.sec, att|LEADING0|LEFT, 2);
}
}

View file

@ -94,7 +94,8 @@
extern display_t displayBuf[DISPLAY_BUFFER_SIZE];
#endif
extern coord_t lcdLastPos;
extern coord_t lcdLastRightPos;
extern coord_t lcdLastLeftPos;
extern coord_t lcdNextPos;
#define DISPLAY_END (displayBuf + DISPLAY_BUFFER_SIZE)

View file

@ -24,7 +24,7 @@ void displayPresetChoice(event_t event)
{
runPopupWarning(event);
lcdDrawNumber(WARNING_LINE_X+FW*7, WARNING_LINE_Y, 45*warningInputValue/4, LEFT|INVERS);
lcdDrawChar(lcdLastPos, WARNING_LINE_Y, '@', INVERS);
lcdDrawChar(lcdLastRightPos, WARNING_LINE_Y, '@', INVERS);
if (warningResult) {
warningResult = 0;
@ -103,7 +103,7 @@ void menuModelCurveOne(event_t event)
attr = (menuVerticalPosition==2 ? (s_editMode>0 ? INVERS|BLINK : INVERS) : 0);
lcdDrawTextAlignedLeft(5*FH+1, STR_COUNT);
lcdDrawNumber(INDENT_WIDTH, 6*FH+1, 5+crv.points, LEFT|attr);
lcdDrawText(lcdLastPos, 6*FH+1, STR_PTS, attr);
lcdDrawText(lcdLastRightPos, 6*FH+1, STR_PTS, attr);
if (attr) {
int8_t count = checkIncDecModel(event, crv.points, -3, 12); // 2pts - 17pts
if (checkIncDec_Ret) {

View file

@ -43,14 +43,14 @@ void putsEdgeDelayParam(coord_t x, coord_t y, LogicalSwitchData * cs, uint8_t la
{
lcdDrawChar(x-4, y, '[');
lcdDrawNumber(x, y, lswTimerValue(cs->v2), LEFT|PREC1|lattr);
lcdDrawChar(lcdLastPos, y, ':');
lcdDrawChar(lcdLastRightPos, y, ':');
if (cs->v3 < 0)
lcdDrawText(lcdLastPos+3, y, "<<", rattr);
lcdDrawText(lcdLastRightPos+3, y, "<<", rattr);
else if (cs->v3 == 0)
lcdDrawText(lcdLastPos+3, y, "--", rattr);
lcdDrawText(lcdLastRightPos+3, y, "--", rattr);
else
lcdDrawNumber(lcdLastPos+3, y, lswTimerValue(cs->v2+cs->v3), LEFT|PREC1|rattr);
lcdDrawChar(lcdLastPos, y, ']');
lcdDrawNumber(lcdLastRightPos+3, y, lswTimerValue(cs->v2+cs->v3), LEFT|PREC1|rattr);
lcdDrawChar(lcdLastRightPos, y, ']');
}
void onLogicalSwitchesMenu(const char *result)

View file

@ -231,7 +231,7 @@ void menuModelSelect(event_t event)
lcdDrawNumber(19*FW, 0, EeFsGetFree(), RIGHT);
lcdDrawText(19*FW + 3, 0, STR_BYTES);
lcdDrawText(lcdLastPos + 3, 0, STR_FREE);
lcdDrawText(lcdLastRightPos + 3, 0, STR_FREE);
drawScreenIndex(MENU_MODEL_SELECT, DIM(menuTabModel), 0);
lcdDrawFilledRect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);

View file

@ -176,7 +176,7 @@ void editTimerCountdown(int timerIdx, coord_t y, LcdFlags attr, event_t event)
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VBEEPCOUNTDOWN, timer.countdownBeep, (menuHorizontalPosition==0 ? attr : 0));
if (timer.countdownBeep != COUNTDOWN_SILENT) {
lcdDrawNumber(MODEL_SETUP_3RD_COLUMN, y, TIMER_COUNTDOWN_START(timerIdx), (menuHorizontalPosition == 1 ? attr : 0) | LEFT);
lcdDrawChar(lcdLastPos, y, 's');
lcdDrawChar(lcdLastRightPos, y, 's');
}
if (attr && s_editMode>0) {
switch (menuHorizontalPosition) {
@ -790,14 +790,14 @@ void menuModelSetup(event_t event)
lcdDrawTextAlignedLeft(y, STR_CHANNELRANGE);
if ((int8_t)PORT_CHANNELS_ROWS(moduleIdx) >= 0) {
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, STR_CH, menuHorizontalPosition==0 ? attr : 0);
lcdDrawNumber(lcdLastPos, y, moduleData.channelsStart+1, LEFT | (menuHorizontalPosition==0 ? attr : 0));
lcdDrawChar(lcdLastPos, y, '-');
lcdDrawNumber(lcdLastPos + FW+1, y, moduleData.channelsStart+NUM_CHANNELS(moduleIdx), LEFT | (menuHorizontalPosition==1 ? attr : 0));
lcdDrawNumber(lcdLastRightPos, y, moduleData.channelsStart+1, LEFT | (menuHorizontalPosition==0 ? attr : 0));
lcdDrawChar(lcdLastRightPos, y, '-');
lcdDrawNumber(lcdLastRightPos + FW+1, y, moduleData.channelsStart+NUM_CHANNELS(moduleIdx), LEFT | (menuHorizontalPosition==1 ? attr : 0));
if (IS_MODULE_XJT(moduleIdx) && g_model.moduleData[moduleIdx].rfProtocol== RF_PROTO_X16) {
if (NUM_CHANNELS(moduleIdx) > 8)
lcdDrawText(lcdLastPos+5, y, "(18ms)");
lcdDrawText(lcdLastRightPos+5, y, "(18ms)");
else
lcdDrawText(lcdLastPos+5, y, "(9ms)");
lcdDrawText(lcdLastRightPos+5, y, "(9ms)");
}
if (attr && s_editMode>0) {
switch (menuHorizontalPosition) {
@ -831,9 +831,9 @@ void menuModelSetup(event_t event)
if (IS_MODULE_PPM(moduleIdx)) {
lcdDrawTextAlignedLeft(y, STR_PPMFRAME);
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN, y, (int16_t)moduleData.ppm.frameLength*5 + 225, (menuHorizontalPosition<=0 ? attr : 0) | PREC1|LEFT);
lcdDrawText(lcdLastPos, y, STR_MS);
lcdDrawText(lcdLastRightPos, y, STR_MS);
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN+6*FW, y, (moduleData.ppm.delay*50)+300, (CURSOR_ON_LINE() || menuHorizontalPosition==1) ? attr : 0);
lcdDrawChar(lcdLastPos, y, 'u');
lcdDrawChar(lcdLastRightPos, y, 'u');
lcdDrawChar(MODEL_SETUP_2ND_COLUMN+12*FW, y, moduleData.ppm.pulsePol ? '+' : '-', (CURSOR_ON_LINE() || menuHorizontalPosition==2) ? attr : 0);
if (attr && s_editMode>0) {

View file

@ -326,7 +326,7 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
else if (func == FUNC_LOGS) {
if (val_displayed) {
lcdDrawNumber(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|PREC1|LEFT);
lcdDrawChar(lcdLastPos, y, 's');
lcdDrawChar(lcdLastRightPos, y, 's');
}
else {
lcdDrawMMM(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, attr);

View file

@ -416,7 +416,7 @@ void menuModelTelemetryFrsky(event_t event)
if (k>=ITEM_TELEMETRY_SENSOR1 && k<ITEM_TELEMETRY_SENSOR1+MAX_TELEMETRY_SENSORS) {
int index = k-ITEM_TELEMETRY_SENSOR1;
lcdDrawNumber(INDENT_WIDTH, y, index+1, LEFT|attr);
lcdDrawChar(lcdLastPos, y, ':', attr);
lcdDrawChar(lcdLastRightPos, y, ':', attr);
lcdDrawSizedText(3*FW, y, g_model.telemetrySensors[index].label, TELEM_LABEL_LEN, ZCHAR);
if (telemetryItems[index].isFresh()) {
lcdDrawChar(10*FW, y, '*');
@ -427,7 +427,7 @@ void menuModelTelemetryFrsky(event_t event)
lcdNextPos = TELEM_COL2;
if (isOld) lcdDrawChar(lcdNextPos, y, '[');
drawSensorCustomValue(lcdNextPos, y, index, getValue(MIXSRC_FIRST_TELEM+3*index), LEFT);
if (isOld) lcdDrawChar(lcdLastPos, y, ']');
if (isOld) lcdDrawChar(lcdLastRightPos, y, ']');
}
else {
lcdDrawText(TELEM_COL2, y, "---", 0); // TODO shortcut

View file

@ -387,7 +387,7 @@ void check(const char * name, event_t event, uint8_t curr, const MenuHandlerFunc
lcdDrawFilledRect(0, 0, LCD_W, MENU_HEADER_HEIGHT, SOLID, FILL_WHITE|GREY_DEFAULT);
}
DISPLAY_PROGRESS_BAR(menuTab ? lcdLastPos-2*FW-((curr+1)/10*FWNUM)-2 : 20*FW+1);
DISPLAY_PROGRESS_BAR(menuTab ? lcdLastRightPos-2*FW-((curr+1)/10*FWNUM)-2 : 20*FW+1);
switch (event) {
case EVT_ENTRY:

View file

@ -199,8 +199,8 @@ void menuRadioSetup(event_t event)
case ITEM_SETUP_BATTERY_RANGE:
lcdDrawTextAlignedLeft(y, STR_BATTERY_RANGE);
putsVolts(RADIO_SETUP_2ND_COLUMN, y, 90+g_eeGeneral.vBatMin, (menuHorizontalPosition==0 ? attr : 0)|LEFT|NO_UNIT);
lcdDrawChar(lcdLastPos, y, '-');
putsVolts(lcdLastPos+FW, y, 120+g_eeGeneral.vBatMax, (menuHorizontalPosition>0 ? attr : 0)|LEFT|NO_UNIT);
lcdDrawChar(lcdLastRightPos, y, '-');
putsVolts(lcdLastRightPos+FW, y, 120+g_eeGeneral.vBatMax, (menuHorizontalPosition>0 ? attr : 0)|LEFT|NO_UNIT);
if (attr && menuHorizontalPosition < 0) lcdDrawFilledRect(RADIO_SETUP_2ND_COLUMN, y, LCD_W-RADIO_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH, 8);
if (attr && s_editMode>0) {
if (menuHorizontalPosition==0)
@ -255,7 +255,7 @@ void menuRadioSetup(event_t event)
lcdDrawTextAlignedLeft( y, STR_SPKRPITCH);
lcdDrawChar(RADIO_SETUP_2ND_COLUMN, y, '+', attr);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN+FW, y, g_eeGeneral.speakerPitch*15, attr|LEFT);
lcdDrawText(lcdLastPos, y, "Hz", attr);
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
if (attr) {
CHECK_INCDEC_GENVAR(event, g_eeGeneral.speakerPitch, 0, 20);
}
@ -273,21 +273,21 @@ void menuRadioSetup(event_t event)
case ITEM_SETUP_VARIO_PITCH:
lcdDrawTextAlignedLeft(y, STR_PITCH_AT_ZERO);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10), attr|LEFT);
lcdDrawText(lcdLastPos, y, "Hz", attr);
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioPitch, -40, 40);
break;
case ITEM_SETUP_VARIO_RANGE:
lcdDrawTextAlignedLeft(y, STR_PITCH_AT_MAX);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10)+VARIO_FREQUENCY_RANGE+(g_eeGeneral.varioRange*10), attr|LEFT);
lcdDrawText(lcdLastPos, y, "Hz", attr);
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRange, -80, 80);
break;
case ITEM_SETUP_VARIO_REPEAT:
lcdDrawTextAlignedLeft(y, STR_REPEAT_AT_ZERO);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_REPEAT_ZERO+(g_eeGeneral.varioRepeat*10), attr|LEFT);
lcdDrawText(lcdLastPos, y, STR_MS, attr);
lcdDrawText(lcdLastRightPos, y, STR_MS, attr);
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRepeat, -30, 50);
break;
#endif
@ -346,7 +346,7 @@ void menuRadioSetup(event_t event)
case ITEM_SETUP_INACTIVITY_ALARM:
lcdDrawTextAlignedLeft(y, STR_INACTIVITYALARM);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.inactivityTimer, attr|LEFT);
lcdDrawChar(lcdLastPos, y, 'm');
lcdDrawChar(lcdLastRightPos, y, 'm');
if(attr) g_eeGeneral.inactivityTimer = checkIncDec(event, g_eeGeneral.inactivityTimer, 0, 250, EE_GENERAL); //0..250minutes
break;
@ -365,7 +365,7 @@ void menuRadioSetup(event_t event)
case ITEM_SETUP_BACKLIGHT_DELAY:
lcdDrawTextAlignedLeft(y, STR_BLDELAY);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.lightAutoOff*5, attr|LEFT);
lcdDrawChar(lcdLastPos, y, 's');
lcdDrawChar(lcdLastRightPos, y, 's');
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.lightAutoOff, 0, 600/5);
break;
@ -393,7 +393,7 @@ void menuRadioSetup(event_t event)
lcdDrawTextAlignedLeft(y, STR_SPLASHSCREEN);
if (SPLASH_NEEDED()) {
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, SPLASH_TIMEOUT/100, attr|LEFT);
lcdDrawChar(lcdLastPos, y, 's');
lcdDrawChar(lcdLastRightPos, y, 's');
}
else {
lcdDrawMMM(RADIO_SETUP_2ND_COLUMN, y, attr);
@ -466,7 +466,7 @@ void menuRadioSetup(event_t event)
case ITEM_SETUP_SWITCHES_DELAY:
lcdDrawTextAlignedLeft(y, STR_SWITCHES_DELAY);
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, 10*SWITCHES_DELAY(), attr|LEFT);
lcdDrawText(lcdLastPos, y, STR_MS, attr);
lcdDrawText(lcdLastRightPos, y, STR_MS, attr);
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.switchesDelay, -15, 100-15);
break;

View file

@ -207,7 +207,7 @@ void displayTopBar()
/* Tx voltage */
putsVBat(BAR_X+2, BAR_Y+1, LEFT);
batt_icon_x = lcdLastPos;
batt_icon_x = lcdLastRightPos;
lcdDrawRect(batt_icon_x+FW, BAR_Y+1, 13, 7);
lcdDrawSolidVerticalLine(batt_icon_x+FW+13, BAR_Y+2, 5);
@ -224,7 +224,7 @@ void displayTopBar()
TelemetryItem & voltsItem = telemetryItems[item];
if (voltsItem.isAvailable()) {
drawSensorCustomValue(batt_icon_x+7*FW+2, BAR_Y+1, item, voltsItem.value, LEFT);
altitude_icon_x = lcdLastPos+1;
altitude_icon_x = lcdLastRightPos+1;
}
}
}
@ -576,7 +576,7 @@ void menuMainView(event_t event)
lcdDrawSizedText(BITMAP_X+4*FW+FW/2, BITMAP_Y+FH-1, g_model.gvars[gvarLastChanged].name, LEN_GVAR_NAME, ZCHAR);
lcdDrawText(BITMAP_X+FW, BITMAP_Y+2*FH+3, PSTR("["), BOLD);
drawGVarValue(BITMAP_X+2*FW, BITMAP_Y+2*FH+3, gvarLastChanged, GVAR_VALUE(gvarLastChanged, getGVarFlightMode(mixerCurrentFlightMode, gvarLastChanged)), LEFT|BOLD);
lcdDrawText(lcdLastPos, BITMAP_Y+2*FH+3, PSTR("]"), BOLD);
lcdDrawText(lcdLastRightPos, BITMAP_Y+2*FH+3, PSTR("]"), BOLD);
}
#endif
}

View file

@ -152,40 +152,40 @@ void menuStatisticsDebug(event_t event)
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_FREE_RAM, "Free Mem");
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_FREE_RAM, availableMemory(), LEFT);
lcdDrawText(lcdLastPos, MENU_DEBUG_Y_FREE_RAM, "b");
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_FREE_RAM, "b");
#if defined(LUA)
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_LUA, "Lua scripts");
lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_LUA+1, "[Duration]", SMLSIZE);
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_LUA, 10*maxLuaDuration, LEFT);
lcdDrawText(lcdLastPos+2, MENU_DEBUG_Y_LUA+1, "[Interval]", SMLSIZE);
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_LUA, 10*maxLuaInterval, LEFT);
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_LUA, 10*maxLuaDuration, LEFT);
lcdDrawText(lcdLastRightPos+2, MENU_DEBUG_Y_LUA+1, "[Interval]", SMLSIZE);
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_LUA, 10*maxLuaInterval, LEFT);
#endif
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_MIXMAX, STR_TMIXMAXMS);
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_MIXMAX, DURATION_MS_PREC2(maxMixerDuration), PREC2|LEFT);
lcdDrawText(lcdLastPos, MENU_DEBUG_Y_MIXMAX, "ms");
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_MIXMAX, "ms");
#if !defined(SIMU) && defined(USB_SERIAL)
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_USB, "Usb");
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_USB, charsWritten, LEFT);
lcdDrawText(lcdLastPos, MENU_DEBUG_Y_USB, " ");
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_USB, APP_Rx_ptr_in, LEFT);
lcdDrawText(lcdLastPos, MENU_DEBUG_Y_USB, " ");
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_USB, APP_Rx_ptr_out, LEFT);
lcdDrawText(lcdLastPos, MENU_DEBUG_Y_USB, " ");
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_USB, usbWraps, LEFT);
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_USB, " ");
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_USB, APP_Rx_ptr_in, LEFT);
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_USB, " ");
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_USB, APP_Rx_ptr_out, LEFT);
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_USB, " ");
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_USB, usbWraps, LEFT);
#endif
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_RTOS, STR_FREESTACKMINB);
lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS+1, "[M]", SMLSIZE);
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_RTOS, menusStack.available(), LEFT);
lcdDrawText(lcdLastPos+2, MENU_DEBUG_Y_RTOS+1, "[X]", SMLSIZE);
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_RTOS, mixerStack.available(), LEFT);
lcdDrawText(lcdLastPos+2, MENU_DEBUG_Y_RTOS+1, "[A]", SMLSIZE);
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_RTOS, audioStack.available(), LEFT);
lcdDrawText(lcdLastPos+2, MENU_DEBUG_Y_RTOS+1, "[I]", SMLSIZE);
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_RTOS, stackAvailable(), LEFT);
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_RTOS, menusStack.available(), LEFT);
lcdDrawText(lcdLastRightPos+2, MENU_DEBUG_Y_RTOS+1, "[X]", SMLSIZE);
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_RTOS, mixerStack.available(), LEFT);
lcdDrawText(lcdLastRightPos+2, MENU_DEBUG_Y_RTOS+1, "[A]", SMLSIZE);
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_RTOS, audioStack.available(), LEFT);
lcdDrawText(lcdLastRightPos+2, MENU_DEBUG_Y_RTOS+1, "[I]", SMLSIZE);
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_RTOS, stackAvailable(), LEFT);
lcdDrawText(3*FW, 7*FH+1, STR_MENUTORESET);
lcdInvertLastLine();

View file

@ -51,7 +51,7 @@ bool menuModelCustomScriptOne(event_t event)
{
ScriptData &sd = g_model.scriptsData[s_currIdx];
// drawStringWithIndex(lcdLastPos+FW, 0, "LUA", s_currIdx+1, 0);
// drawStringWithIndex(lcdLastRightPos+FW, 0, "LUA", s_currIdx+1, 0);
SUBMENU(STR_MENUCUSTOMSCRIPTS, ICON_MODEL_LUA_SCRIPTS, 3+scriptInputsOutputs[s_currIdx].inputsCount, { 0, 0, LABEL(inputs), 0/*repeated*/ });

View file

@ -88,7 +88,7 @@ void menuModelCurvesAll(event_t event)
editName(4*FW, y, crv.name, sizeof(crv.name), 0, 0);
#if LCD_W >= 212
lcdDrawNumber(11*FW, y, 5+crv.points, LEFT);
lcdDrawText(lcdLastPos, y, STR_PTS, 0);
lcdDrawText(lcdLastRightPos, y, STR_PTS, 0);
#endif
#endif
}

View file

@ -34,21 +34,21 @@ void menuRadioSdManagerInfo(event_t event)
lcdDrawTextAlignedLeft(3*FH, STR_SD_SIZE);
lcdDrawNumber(10*FW, 3*FH, sdGetSize(), LEFT);
lcdDrawChar(lcdLastPos, 3*FH, 'M');
lcdDrawChar(lcdLastRightPos, 3*FH, 'M');
lcdDrawTextAlignedLeft(4*FH, STR_SD_SECTORS);
#if defined(SD_GET_FREE_BLOCKNR)
lcdDrawNumber(10*FW, 4*FH, SD_GET_FREE_BLOCKNR()/1000, LEFT);
lcdDrawChar(lcdLastPos, 4*FH, '/');
lcdDrawNumber(lcdLastPos+FW, 4*FH, sdGetNoSectors()/1000, LEFT);
lcdDrawChar(lcdLastRightPos, 4*FH, '/');
lcdDrawNumber(lcdLastRightPos+FW, 4*FH, sdGetNoSectors()/1000, LEFT);
#else
lcdDrawNumber(10*FW, 4*FH, sdGetNoSectors()/1000, LEFT);
#endif
lcdDrawChar(lcdLastPos, 4*FH, 'k');
lcdDrawChar(lcdLastRightPos, 4*FH, 'k');
lcdDrawTextAlignedLeft(5*FH, STR_SD_SPEED);
lcdDrawNumber(10*FW, 5*FH, SD_GET_SPEED()/1000, LEFT);
lcdDrawText(lcdLastPos, 5*FH, "kb/s");
lcdDrawText(lcdLastRightPos, 5*FH, "kb/s");
}
inline bool isFilenameGreater(bool isfile, const char * fn, const char * line)

View file

@ -136,20 +136,55 @@ static int luaLcdDrawLine(lua_State *L)
/*luadoc
@function lcd.getLastPos()
Returns the last x position from previous output
Returns the rightmost x position from previous output
@retval number (integer) x position
@notice Only available on Taranis
@notice For added clarity, it is recommended to use lcd.getLastRightPos()
@status current Introduced in 2.0.0
*/
/*luadoc
@function lcd.getLastRightPos()
Returns the rightest x position from previous drawtext or drawNumber output
@retval number (integer) x position
@notice Only available on Taranis
@notice This is strictly equivalent to former lcd.getLastPos()
@status current Introduced in 2.2.0
*/
static int luaLcdGetLastPos(lua_State *L)
{
lua_pushinteger(L, lcdLastPos);
lua_pushinteger(L, lcdLastRightPos);
return 1;
}
#endif
/*luadoc
@function lcd.getLastLeftPos()
Returns the leftmost x position from previous drawtext or drawNumber output
@retval number (integer) x position
@notice Only available on Taranis
@status current Introduced in 2.2.0
*/
static int luaLcdGetLeftPos(lua_State *L)
{
lua_pushinteger(L, lcdLastLeftPos);
return 1;
}
#endif // COLORLCD
/*luadoc
@function lcd.drawText(x, y, text [, flags])
@ -833,12 +868,16 @@ const luaL_Reg lcdLib[] = {
{ "RGB", luaRGB },
#elif LCD_DEPTH > 1
{ "getLastPos", luaLcdGetLastPos },
{ "getLastRightPos", luaLcdGetLastPos },
{ "getLastLeftPos", luaLcdGetLeftPos },
{ "drawPixmap", luaLcdDrawPixmap },
{ "drawScreenTitle", luaLcdDrawScreenTitle },
{ "drawCombobox", luaLcdDrawCombobox },
#else
{ "drawScreenTitle", luaLcdDrawScreenTitle },
{ "getLastPos", luaLcdGetLastPos },
{ "getLastRightPos", luaLcdGetLastPos },
{ "getLastLeftPos", luaLcdGetLeftPos },
{ "drawCombobox", luaLcdDrawCombobox },
#endif
{ NULL, NULL } /* sentinel */

View file

@ -776,12 +776,12 @@ void luaDoOneRunStandalone(event_t evt)
else if (luaDisplayStatistics) {
#if defined(COLORLCD)
#else
lcdDrawSolidHorizontalLine(0, 7*FH-1, lcdLastPos+6, ERASE);
lcdDrawSolidHorizontalLine(0, 7*FH-1, lcdLastRightPos+6, ERASE);
lcdDrawText(0, 7*FH, "GV Use: ");
lcdDrawNumber(lcdLastPos, 7*FH, luaGetMemUsed(lsScripts), LEFT);
lcdDrawChar(lcdLastPos, 7*FH, 'b');
lcdDrawSolidHorizontalLine(0, 7*FH-2, lcdLastPos+6, FORCE);
lcdDrawVerticalLine(lcdLastPos+6, 7*FH-2, FH+2, SOLID, FORCE);
lcdDrawNumber(lcdLastRightPos, 7*FH, luaGetMemUsed(lsScripts), LEFT);
lcdDrawChar(lcdLastRightPos, 7*FH, 'b');
lcdDrawSolidHorizontalLine(0, 7*FH-2, lcdLastRightPos+6, FORCE);
lcdDrawVerticalLine(lcdLastRightPos+6, 7*FH-2, FH+2, SOLID, FORCE);
#endif
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

View file

@ -106,6 +106,13 @@ TEST(outdezNAtt, test_unsigned)
lcdDrawNumber(0, 0, 65530, LEFT);
EXPECT_TRUE(checkScreenshot("unsigned")) << "Unsigned numbers will be bad displayed";
}
#elif defined(CPUARM) && LCD_W <= 128
TEST(outdezNAtt, test_unsigned)
{
lcdClear();
lcdDrawNumber(0, 0, 65530, LEFT|UNSIGN);
EXPECT_TRUE(checkScreenshot("arm_unsigned")) << "Unsigned numbers will be bad displayed";
}
#else
TEST(outdezNAtt, test_unsigned)
{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 365 B

After

Width:  |  Height:  |  Size: 349 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 355 B

After

Width:  |  Height:  |  Size: 340 B

Before After
Before After