mirror of
https://github.com/opentx/opentx.git
synced 2025-07-19 14:25:11 +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:
parent
4a2bbc665c
commit
80b44444ec
36 changed files with 279 additions and 242 deletions
|
@ -27,10 +27,11 @@ void lcdClear()
|
||||||
memset(displayBuf, 0, DISPLAY_BUFFER_SIZE);
|
memset(displayBuf, 0, DISPLAY_BUFFER_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
coord_t lcdLastPos;
|
coord_t lcdLastRightPos;
|
||||||
coord_t lcdNextPos;
|
coord_t lcdNextPos;
|
||||||
|
|
||||||
#if defined(CPUARM)
|
#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)
|
void lcdPutPattern(coord_t x, coord_t y, const uint8_t * pattern, uint8_t width, uint8_t height, LcdFlags flags)
|
||||||
{
|
{
|
||||||
bool blink = false;
|
bool blink = false;
|
||||||
|
@ -379,15 +380,20 @@ void lcdDrawSizedText(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdF
|
||||||
}
|
}
|
||||||
s++;
|
s++;
|
||||||
}
|
}
|
||||||
lcdLastPos = x;
|
lcdLastRightPos = x;
|
||||||
lcdNextPos = x;
|
lcdNextPos = x;
|
||||||
#if defined(CPUARM) && !defined(BOOT)
|
#if defined(CPUARM) && !defined(BOOT)
|
||||||
if (fontsize == MIDSIZE) {
|
if (fontsize == MIDSIZE) {
|
||||||
lcdLastPos += 1;
|
lcdLastRightPos += 1;
|
||||||
}
|
}
|
||||||
if (flags & RIGHT) {
|
if (flags & RIGHT) {
|
||||||
lcdLastPos -= width;
|
lcdLastRightPos -= width;
|
||||||
lcdNextPos -= width;
|
lcdNextPos -= width;
|
||||||
|
lcdLastLeftPos = lcdLastRightPos;
|
||||||
|
lcdLastRightPos = orig_x;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
lcdLastLeftPos = orig_x;
|
||||||
}
|
}
|
||||||
#endif
|
#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)
|
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;
|
uint8_t fw = FWNUM;
|
||||||
int8_t mode = MODE(flags);
|
int8_t mode = MODE(flags);
|
||||||
flags &= ~LEADING0;
|
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;
|
bool neg = false;
|
||||||
if (flags & UNSIGN) {
|
if (flags & UNSIGN) {
|
||||||
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) {
|
if (dblsize) {
|
||||||
fw += FWNUM;
|
fw += FWNUM;
|
||||||
}
|
}
|
||||||
else if (xxlsize) {
|
|
||||||
fw += 4*FWNUM-1;
|
|
||||||
}
|
|
||||||
else if (midsize) {
|
|
||||||
fw += FWNUM-3;
|
|
||||||
}
|
|
||||||
else if (tinsize) {
|
|
||||||
fw -= 1;
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
if (IS_LEFT_ALIGNED(flags)) {
|
if (IS_LEFT_ALIGNED(flags)) {
|
||||||
if (mode > 0) {
|
if (mode > 0) {
|
||||||
x += 2;
|
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;
|
if (flags & BOLD) fw += 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_LEFT_ALIGNED(flags)) {
|
if (IS_LEFT_ALIGNED(flags)) {
|
||||||
x += len * fw;
|
x += len * fw;
|
||||||
if (neg) {
|
if (neg) {
|
||||||
x += ((xxlsize|dblsize|midsize) ? 7 : FWNUM);
|
x += ((dblsize) ? 7 : FWNUM);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lcdLastPos = x;
|
lcdLastRightPos = x;
|
||||||
x -= fw;
|
x -= fw;
|
||||||
if (dblsize) x++;
|
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 {
|
else {
|
||||||
x -= 2;
|
x -= 2;
|
||||||
lcdDrawChar(x, y, '.', f);
|
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;
|
if (dblsize && (lcduint_t)val >= 1000 && (lcduint_t)val < 10000) x-=2;
|
||||||
val = qr.quot;
|
val = qr.quot;
|
||||||
x -= fw;
|
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;
|
if (i==len && (flags & BOLD)) x += 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xn) {
|
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;
|
// TODO needed on CPUAVR? y &= ~0x07;
|
||||||
lcdDrawSolidFilledRect(xn, y+2*FH-3, ln, 2);
|
lcdDrawSolidFilledRect(xn, y+2*FH-3, ln, 2);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (neg) lcdDrawChar(x, y, '-', flags);
|
if (neg) lcdDrawChar(x, y, '-', flags);
|
||||||
|
#endif // CPUARM
|
||||||
}
|
}
|
||||||
#endif
|
#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)
|
void drawTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2)
|
||||||
{
|
{
|
||||||
div_t qr;
|
div_t qr;
|
||||||
|
|
||||||
if (IS_RIGHT_ALIGNED(att)) {
|
if (IS_RIGHT_ALIGNED(att)) {
|
||||||
att -= RIGHT;
|
att -= RIGHT;
|
||||||
if (att & DBLSIZE)
|
if (att & DBLSIZE)
|
||||||
x -= 5*(2*FWNUM)-4;
|
x -= 5*(2*FWNUM)-4;
|
||||||
else if (att & MIDSIZE)
|
else if (att & MIDSIZE)
|
||||||
x -= 5*8-4;
|
x -= 5*8-8;
|
||||||
else
|
else
|
||||||
x -= 5*FWNUM+1;
|
x -= 5*FWNUM+1;
|
||||||
}
|
}
|
||||||
|
@ -835,15 +814,18 @@ void drawTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att, LcdFlags att2
|
||||||
#endif
|
#endif
|
||||||
lcdDrawNumber(x, y, qr.quot, att|LEADING0|LEFT, 2);
|
lcdDrawNumber(x, y, qr.quot, att|LEADING0|LEFT, 2);
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
|
if (att & MIDSIZE) {
|
||||||
|
lcdLastRightPos--;
|
||||||
|
}
|
||||||
if (separator == CHR_HOUR)
|
if (separator == CHR_HOUR)
|
||||||
att &= ~DBLSIZE;
|
att &= ~DBLSIZE;
|
||||||
#endif
|
#endif
|
||||||
#if defined(CPUARM) && defined(RTCLOCK)
|
#if defined(CPUARM) && defined(RTCLOCK)
|
||||||
if (att & TIMEBLINK)
|
if (att & TIMEBLINK)
|
||||||
lcdDrawChar(lcdLastPos, y, separator, BLINK);
|
lcdDrawChar(lcdLastRightPos, y, separator, BLINK);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
lcdDrawChar(lcdLastPos, y, separator, att&att2);
|
lcdDrawChar(lcdLastRightPos, y, separator, att&att2);
|
||||||
lcdDrawNumber(lcdNextPos, y, qr.rem, (att2|LEADING0|LEFT) & (~RIGHT), 2);
|
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)
|
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)));
|
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)
|
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
|
#endif
|
||||||
{
|
{
|
||||||
drawStringWithIndex(x, y, "LUA", qr.quot+1, att);
|
drawStringWithIndex(x, y, "LUA", qr.quot+1, att);
|
||||||
lcdDrawChar(lcdLastPos, y, 'a'+qr.rem, att);
|
lcdDrawChar(lcdLastRightPos, y, 'a'+qr.rem, att);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -924,8 +906,8 @@ void drawSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att)
|
||||||
else if (idx <= MIXSRC_LAST_CH) {
|
else if (idx <= MIXSRC_LAST_CH) {
|
||||||
drawStringWithIndex(x, y, STR_CH, idx-MIXSRC_CH1+1, att);
|
drawStringWithIndex(x, y, STR_CH, idx-MIXSRC_CH1+1, att);
|
||||||
if (ZEXIST(g_model.limitData[idx-MIXSRC_CH1].name) && (att & STREXPANDED)) {
|
if (ZEXIST(g_model.limitData[idx-MIXSRC_CH1].name) && (att & STREXPANDED)) {
|
||||||
lcdDrawChar(lcdLastPos, y, ' ', att|SMLSIZE);
|
lcdDrawChar(lcdLastRightPos, y, ' ', att|SMLSIZE);
|
||||||
lcdDrawSizedText(lcdLastPos+3, y, g_model.limitData[idx-MIXSRC_CH1].name, LEN_CHANNEL_NAME, ZCHAR|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) {
|
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;
|
idx -= MIXSRC_FIRST_TELEM;
|
||||||
div_t qr = div(idx, 3);
|
div_t qr = div(idx, 3);
|
||||||
lcdDrawSizedText(x, y, g_model.telemetrySensors[qr.quot].label, TELEM_LABEL_LEN, ZCHAR|att);
|
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
|
#else
|
||||||
|
@ -967,7 +949,7 @@ void drawSource(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
||||||
idx -= MIXSRC_FIRST_TELEM;
|
idx -= MIXSRC_FIRST_TELEM;
|
||||||
div_t qr = div(idx, 3);
|
div_t qr = div(idx, 3);
|
||||||
lcdDrawSizedText(x, y, g_model.telemetrySensors[qr.quot].label, ZLEN(g_model.telemetrySensors[qr.quot].label), ZCHAR|att);
|
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
|
||||||
else
|
else
|
||||||
|
@ -1113,7 +1095,7 @@ void drawValueWithUnit(coord_t x, coord_t y, lcdint_t val, uint8_t unit, LcdFlag
|
||||||
// convertUnit(val, unit);
|
// convertUnit(val, unit);
|
||||||
lcdDrawNumber(x, y, val, att & (~NO_UNIT));
|
lcdDrawNumber(x, y, val, att & (~NO_UNIT));
|
||||||
if (!(att & NO_UNIT) && unit != UNIT_RAW) {
|
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;
|
att &= ~RIGHT & ~BOLD;
|
||||||
uint32_t absvalue = abs(value);
|
uint32_t absvalue = abs(value);
|
||||||
lcdDrawNumber(x, y, absvalue / 1000000, att); // ddd
|
lcdDrawNumber(x, y, absvalue / 1000000, att); // ddd
|
||||||
lcdDrawChar(lcdLastPos, y, '@', att);
|
lcdDrawChar(lcdLastRightPos, y, '@', att);
|
||||||
absvalue = absvalue % 1000000;
|
absvalue = absvalue % 1000000;
|
||||||
absvalue *= 60;
|
absvalue *= 60;
|
||||||
if (g_eeGeneral.gpsFormat == 0 || !seconds) {
|
if (g_eeGeneral.gpsFormat == 0 || !seconds) {
|
||||||
lcdDrawNumber(lcdNextPos, y, absvalue / 1000000, att|LEFT|LEADING0, 2); // mm before '.'
|
lcdDrawNumber(lcdNextPos, y, absvalue / 1000000, att|LEFT|LEADING0, 2); // mm before '.'
|
||||||
lcdDrawSolidVerticalLine(lcdLastPos, y, 2);
|
lcdDrawSolidVerticalLine(lcdLastRightPos, y, 2);
|
||||||
lcdLastPos += 1;
|
lcdLastRightPos += 1;
|
||||||
if (seconds) {
|
if (seconds) {
|
||||||
absvalue %= 1000000;
|
absvalue %= 1000000;
|
||||||
absvalue *= 60;
|
absvalue *= 60;
|
||||||
absvalue /= 10000;
|
absvalue /= 10000;
|
||||||
lcdDrawNumber(lcdLastPos+2, y, absvalue, att|LEFT|PREC2);
|
lcdDrawNumber(lcdLastRightPos+2, y, absvalue, att|LEFT|PREC2);
|
||||||
lcdDrawSolidVerticalLine(lcdLastPos, y, 2);
|
lcdDrawSolidVerticalLine(lcdLastRightPos, y, 2);
|
||||||
lcdDrawSolidVerticalLine(lcdLastPos+2, y, 2);
|
lcdDrawSolidVerticalLine(lcdLastRightPos+2, y, 2);
|
||||||
lcdLastPos += 3;
|
lcdLastRightPos += 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
absvalue /= 10000;
|
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)
|
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;
|
x -= 42;
|
||||||
att &= ~0x0F00; // TODO constant
|
att &= ~0x0F00; // TODO constant
|
||||||
lcdDrawNumber(x, y, telemetryItem.datetime.day, att|LEADING0|LEFT, 2);
|
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);
|
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);
|
lcdDrawNumber(lcdNextPos-1, y, telemetryItem.datetime.year-2000, att|LEFT);
|
||||||
y += FH;
|
y += FH;
|
||||||
lcdDrawNumber(x, y, telemetryItem.datetime.hour, att|LEADING0|LEFT, 2);
|
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);
|
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);
|
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.sec, att|LEADING0|LEFT, 2);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawNumber(x, y, telemetryItem.datetime.hour, att|LEADING0|LEFT, 2);
|
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);
|
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);
|
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);
|
convertUnit(val, unit);
|
||||||
lcdDrawNumber(x, y, val, att & (~NO_UNIT));
|
lcdDrawNumber(x, y, val, att & (~NO_UNIT));
|
||||||
if (!(att & NO_UNIT) && unit != UNIT_RAW) {
|
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:
|
case TELEM_TX_VOLTAGE-1:
|
||||||
lcdDrawNumber(x, y, val, (att|PREC1) & (~NO_UNIT));
|
lcdDrawNumber(x, y, val, (att|PREC1) & (~NO_UNIT));
|
||||||
if (!(att & NO_UNIT))
|
if (!(att & NO_UNIT))
|
||||||
lcdDrawChar(lcdLastPos/*+1*/, y, 'V');
|
lcdDrawChar(lcdLastRightPos/*+1*/, y, 'V');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,7 +130,8 @@
|
||||||
|
|
||||||
extern display_t displayBuf[DISPLAY_BUFFER_SIZE];
|
extern display_t displayBuf[DISPLAY_BUFFER_SIZE];
|
||||||
|
|
||||||
extern coord_t lcdLastPos;
|
extern coord_t lcdLastRightPos;
|
||||||
|
extern coord_t lcdLastLeftPos;
|
||||||
extern coord_t lcdNextPos;
|
extern coord_t lcdNextPos;
|
||||||
|
|
||||||
#define DISPLAY_END (displayBuf + DISPLAY_BUFFER_SIZE)
|
#define DISPLAY_END (displayBuf + DISPLAY_BUFFER_SIZE)
|
||||||
|
|
|
@ -24,7 +24,7 @@ void displayPresetChoice(event_t event)
|
||||||
{
|
{
|
||||||
runPopupWarning(event);
|
runPopupWarning(event);
|
||||||
lcdDrawNumber(WARNING_LINE_X+FW*7, WARNING_LINE_Y, 45*warningInputValue/4, LEFT|INVERS);
|
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) {
|
if (warningResult) {
|
||||||
warningResult = 0;
|
warningResult = 0;
|
||||||
|
@ -99,7 +99,7 @@ void menuModelCurveOne(event_t event)
|
||||||
attr = (menuVerticalPosition==2 ? (s_editMode>0 ? INVERS|BLINK : INVERS) : 0);
|
attr = (menuVerticalPosition==2 ? (s_editMode>0 ? INVERS|BLINK : INVERS) : 0);
|
||||||
lcdDrawTextAlignedLeft(5*FH+1, STR_COUNT);
|
lcdDrawTextAlignedLeft(5*FH+1, STR_COUNT);
|
||||||
lcdDrawNumber(INDENT_WIDTH, 6*FH+1, 5+crv.points, LEFT|attr);
|
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) {
|
if (attr) {
|
||||||
int8_t count = checkIncDecModel(event, crv.points, -3, 12); // 2pts - 17pts
|
int8_t count = checkIncDecModel(event, crv.points, -3, 12); // 2pts - 17pts
|
||||||
if (checkIncDec_Ret) {
|
if (checkIncDec_Ret) {
|
||||||
|
|
|
@ -110,7 +110,7 @@ void menuModelCurveOne(event_t event)
|
||||||
lcdDrawTextAlignedLeft(7*FH, STR_TYPE);
|
lcdDrawTextAlignedLeft(7*FH, STR_TYPE);
|
||||||
uint8_t attr = (s_editMode <= 0 ? INVERS : 0);
|
uint8_t attr = (s_editMode <= 0 ? INVERS : 0);
|
||||||
lcdDrawNumber(5*FW-2, 7*FH, crv.points, LEFT|attr);
|
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();
|
drawCurve();
|
||||||
|
|
||||||
|
|
|
@ -396,7 +396,7 @@ void menuModelMixOne(event_t event)
|
||||||
{
|
{
|
||||||
TITLE(STR_MIXER);
|
TITLE(STR_MIXER);
|
||||||
MixData * md2 = mixAddress(s_currIdx) ;
|
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(ROTARY_ENCODERS)
|
||||||
#if defined(CURVES)
|
#if defined(CURVES)
|
||||||
|
|
|
@ -43,14 +43,14 @@ void putsEdgeDelayParam(coord_t x, coord_t y, LogicalSwitchData *cs, uint8_t lat
|
||||||
{
|
{
|
||||||
lcdDrawChar(x-4, y, '[');
|
lcdDrawChar(x-4, y, '[');
|
||||||
lcdDrawNumber(x, y, lswTimerValue(cs->v2), LEFT|PREC1|lattr);
|
lcdDrawNumber(x, y, lswTimerValue(cs->v2), LEFT|PREC1|lattr);
|
||||||
lcdDrawChar(lcdLastPos, y, ':');
|
lcdDrawChar(lcdLastRightPos, y, ':');
|
||||||
if (cs->v3 < 0)
|
if (cs->v3 < 0)
|
||||||
lcdDrawText(lcdLastPos+3, y, "<<", rattr);
|
lcdDrawText(lcdLastRightPos+3, y, "<<", rattr);
|
||||||
else if (cs->v3 == 0)
|
else if (cs->v3 == 0)
|
||||||
lcdDrawText(lcdLastPos+3, y, "--", rattr);
|
lcdDrawText(lcdLastRightPos+3, y, "--", rattr);
|
||||||
else
|
else
|
||||||
lcdDrawNumber(lcdLastPos+3, y, lswTimerValue(cs->v2+cs->v3), LEFT|PREC1|rattr);
|
lcdDrawNumber(lcdLastRightPos+3, y, lswTimerValue(cs->v2+cs->v3), LEFT|PREC1|rattr);
|
||||||
lcdDrawChar(lcdLastPos, y, ']');
|
lcdDrawChar(lcdLastRightPos, y, ']');
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CSWONE_2ND_COLUMN (11*FW)
|
#define CSWONE_2ND_COLUMN (11*FW)
|
||||||
|
|
|
@ -326,7 +326,7 @@ void menuModelSelect(event_t event)
|
||||||
#if defined(EEPROM_RLC) && defined(CPUARM)
|
#if defined(EEPROM_RLC) && defined(CPUARM)
|
||||||
lcdDrawText(9*FW-(LEN_FREE-4)*FW-4, 0, STR_FREE);
|
lcdDrawText(9*FW-(LEN_FREE-4)*FW-4, 0, STR_FREE);
|
||||||
if (event) reusableBuffer.modelsel.eepromfree = EeFsGetFree();
|
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)
|
#elif defined(EEPROM_RLC)
|
||||||
lcdDrawText(9*FW-(LEN_FREE-4)*FW, 0, STR_FREE);
|
lcdDrawText(9*FW-(LEN_FREE-4)*FW, 0, STR_FREE);
|
||||||
if (event) reusableBuffer.modelsel.eepromfree = EeFsGetFree();
|
if (event) reusableBuffer.modelsel.eepromfree = EeFsGetFree();
|
||||||
|
|
|
@ -723,9 +723,9 @@ void menuModelSetup(event_t event)
|
||||||
lcdDrawTextAlignedLeft(y, STR_CHANNELRANGE);
|
lcdDrawTextAlignedLeft(y, STR_CHANNELRANGE);
|
||||||
if ((int8_t)PORT_CHANNELS_ROWS(moduleIdx) >= 0) {
|
if ((int8_t)PORT_CHANNELS_ROWS(moduleIdx) >= 0) {
|
||||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, STR_CH, menuHorizontalPosition==0 ? attr : 0);
|
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, STR_CH, menuHorizontalPosition==0 ? attr : 0);
|
||||||
lcdDrawNumber(lcdLastPos, y, moduleData.channelsStart+1, LEFT | (menuHorizontalPosition==0 ? attr : 0));
|
lcdDrawNumber(lcdLastRightPos, y, moduleData.channelsStart+1, LEFT | (menuHorizontalPosition==0 ? attr : 0));
|
||||||
lcdDrawChar(lcdLastPos, y, '-');
|
lcdDrawChar(lcdLastRightPos, y, '-');
|
||||||
lcdDrawNumber(lcdLastPos + FW+1, y, moduleData.channelsStart+NUM_CHANNELS(moduleIdx), LEFT | (menuHorizontalPosition==1 ? attr : 0));
|
lcdDrawNumber(lcdLastRightPos + FW+1, y, moduleData.channelsStart+NUM_CHANNELS(moduleIdx), LEFT | (menuHorizontalPosition==1 ? attr : 0));
|
||||||
if (attr && (editMode>0 || p1valdiff)) {
|
if (attr && (editMode>0 || p1valdiff)) {
|
||||||
switch (menuHorizontalPosition) {
|
switch (menuHorizontalPosition) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -953,9 +953,9 @@ void menuModelSetup(event_t event)
|
||||||
lcdDrawTextAlignedLeft(y, PSTR("Port2"));
|
lcdDrawTextAlignedLeft(y, PSTR("Port2"));
|
||||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VPROTOS, 0, 0);
|
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);
|
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));
|
lcdDrawNumber(lcdLastRightPos, y, g_model.moduleData[1].channelsStart+1, LEFT | (menuHorizontalPosition<=0 ? attr : 0));
|
||||||
lcdDrawChar(lcdLastPos, y, '-');
|
lcdDrawChar(lcdLastRightPos, y, '-');
|
||||||
lcdDrawNumber(lcdLastPos + FW+1, y, g_model.moduleData[1].channelsStart+8+g_model.moduleData[1].channelsCount, LEFT | (menuHorizontalPosition!=0 ? attr : 0));
|
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)) {
|
if (attr && (editMode>0 || p1valdiff)) {
|
||||||
switch (menuHorizontalPosition) {
|
switch (menuHorizontalPosition) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|
|
@ -373,7 +373,7 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||||
else if (func == FUNC_LOGS) {
|
else if (func == FUNC_LOGS) {
|
||||||
if (val_displayed) {
|
if (val_displayed) {
|
||||||
lcdDrawNumber(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|PREC1|LEFT);
|
lcdDrawNumber(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|PREC1|LEFT);
|
||||||
lcdDrawChar(lcdLastPos, y, 's');
|
lcdDrawChar(lcdLastRightPos, y, 's');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawMMM(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, attr);
|
lcdDrawMMM(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, attr);
|
||||||
|
|
|
@ -519,7 +519,7 @@ void menuModelTelemetryFrsky(event_t event)
|
||||||
if (k>=ITEM_TELEMETRY_SENSOR1 && k<ITEM_TELEMETRY_SENSOR1+MAX_TELEMETRY_SENSORS) {
|
if (k>=ITEM_TELEMETRY_SENSOR1 && k<ITEM_TELEMETRY_SENSOR1+MAX_TELEMETRY_SENSORS) {
|
||||||
int index = k - ITEM_TELEMETRY_SENSOR1;
|
int index = k - ITEM_TELEMETRY_SENSOR1;
|
||||||
lcdDrawNumber(INDENT_WIDTH, y, index+1, LEFT|attr);
|
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);
|
lcdDrawSizedText(3*FW, y, g_model.telemetrySensors[index].label, TELEM_LABEL_LEN, ZCHAR);
|
||||||
if (telemetryItems[index].isFresh()) {
|
if (telemetryItems[index].isFresh()) {
|
||||||
lcdDrawChar(16*FW, y, '*');
|
lcdDrawChar(16*FW, y, '*');
|
||||||
|
@ -530,7 +530,7 @@ void menuModelTelemetryFrsky(event_t event)
|
||||||
lcdNextPos = TELEM_COL2;
|
lcdNextPos = TELEM_COL2;
|
||||||
if (isOld) lcdDrawChar(lcdNextPos, y, '[');
|
if (isOld) lcdDrawChar(lcdNextPos, y, '[');
|
||||||
drawSensorCustomValue(lcdNextPos, y, index, getValue(MIXSRC_FIRST_TELEM+3*index), LEFT);
|
drawSensorCustomValue(lcdNextPos, y, index, getValue(MIXSRC_FIRST_TELEM+3*index), LEFT);
|
||||||
if (isOld) lcdDrawChar(lcdLastPos, y, ']');
|
if (isOld) lcdDrawChar(lcdLastRightPos, y, ']');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawText(TELEM_COL2, y, "---", 0); // TODO shortcut
|
lcdDrawText(TELEM_COL2, y, "---", 0); // TODO shortcut
|
||||||
|
@ -626,7 +626,7 @@ void menuModelTelemetryFrsky(event_t event)
|
||||||
case ITEM_TELEMETRY_A2_RANGE:
|
case ITEM_TELEMETRY_A2_RANGE:
|
||||||
lcdDrawTextAlignedLeft(y, STR_RANGE);
|
lcdDrawTextAlignedLeft(y, STR_RANGE);
|
||||||
drawTelemetryValue(TELEM_COL2, y, dest, 255-channel.offset, (menuHorizontalPosition<=0 ? attr : 0)|NO_UNIT|LEFT);
|
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 (attr && (s_editMode>0 || p1valdiff)) {
|
||||||
if (menuHorizontalPosition == 0) {
|
if (menuHorizontalPosition == 0) {
|
||||||
uint16_t ratio = checkIncDec(event, channel.ratio, 0, 256, EE_MODEL);
|
uint16_t ratio = checkIncDec(event, channel.ratio, 0, 256, EE_MODEL);
|
||||||
|
|
|
@ -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);
|
// 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) {
|
switch (event) {
|
||||||
case EVT_ENTRY:
|
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 (s_editMode<=0) {
|
||||||
if (scrollUD) {
|
if (scrollUD) {
|
||||||
|
|
|
@ -218,8 +218,8 @@ void menuRadioSetup(event_t event)
|
||||||
case ITEM_SETUP_BATT_RANGE:
|
case ITEM_SETUP_BATT_RANGE:
|
||||||
lcdDrawTextAlignedLeft(y, STR_BATTERY_RANGE);
|
lcdDrawTextAlignedLeft(y, STR_BATTERY_RANGE);
|
||||||
putsVolts(RADIO_SETUP_2ND_COLUMN, y, 90+g_eeGeneral.vBatMin, (menuHorizontalPosition==0 ? attr : 0)|LEFT|NO_UNIT);
|
putsVolts(RADIO_SETUP_2ND_COLUMN, y, 90+g_eeGeneral.vBatMin, (menuHorizontalPosition==0 ? attr : 0)|LEFT|NO_UNIT);
|
||||||
lcdDrawChar(lcdLastPos, y, '-');
|
lcdDrawChar(lcdLastRightPos, y, '-');
|
||||||
putsVolts(lcdLastPos+FW, y, 120+g_eeGeneral.vBatMax, (menuHorizontalPosition>0 ? attr : 0)|LEFT|NO_UNIT);
|
putsVolts(lcdLastRightPos+FW, y, 120+g_eeGeneral.vBatMax, (menuHorizontalPosition>0 ? attr : 0)|LEFT|NO_UNIT);
|
||||||
if (attr && s_editMode>0) {
|
if (attr && s_editMode>0) {
|
||||||
if (menuHorizontalPosition==0)
|
if (menuHorizontalPosition==0)
|
||||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatMin, -50, g_eeGeneral.vBatMax+29); // min=4.0V
|
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)
|
#if defined(CPUARM)
|
||||||
lcdDrawChar(RADIO_SETUP_2ND_COLUMN, y, '+', attr);
|
lcdDrawChar(RADIO_SETUP_2ND_COLUMN, y, '+', attr);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN+FW, y, g_eeGeneral.speakerPitch*15, attr|LEFT);
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN+FW, y, g_eeGeneral.speakerPitch*15, attr|LEFT);
|
||||||
lcdDrawText(lcdLastPos, y, "Hz", attr);
|
lcdDrawText(lcdLastRightPos, y, "Hz", attr);
|
||||||
#else
|
#else
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.speakerPitch, attr|LEFT);
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.speakerPitch, attr|LEFT);
|
||||||
#endif
|
#endif
|
||||||
|
@ -319,19 +319,19 @@ void menuRadioSetup(event_t event)
|
||||||
case ITEM_SETUP_VARIO_PITCH:
|
case ITEM_SETUP_VARIO_PITCH:
|
||||||
lcdDrawTextAlignedLeft(y, STR_PITCH_AT_ZERO);
|
lcdDrawTextAlignedLeft(y, STR_PITCH_AT_ZERO);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10), attr|LEFT);
|
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);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioPitch, -40, 40);
|
||||||
break;
|
break;
|
||||||
case ITEM_SETUP_VARIO_RANGE:
|
case ITEM_SETUP_VARIO_RANGE:
|
||||||
lcdDrawTextAlignedLeft(y, STR_PITCH_AT_MAX);
|
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);
|
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);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRange, -80, 80);
|
||||||
break;
|
break;
|
||||||
case ITEM_SETUP_VARIO_REPEAT:
|
case ITEM_SETUP_VARIO_REPEAT:
|
||||||
lcdDrawTextAlignedLeft(y, STR_REPEAT_AT_ZERO);
|
lcdDrawTextAlignedLeft(y, STR_REPEAT_AT_ZERO);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_REPEAT_ZERO+(g_eeGeneral.varioRepeat*10), attr|LEFT);
|
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);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRepeat, -30, 50);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
@ -406,7 +406,7 @@ void menuRadioSetup(event_t event)
|
||||||
case ITEM_SETUP_INACTIVITY_ALARM:
|
case ITEM_SETUP_INACTIVITY_ALARM:
|
||||||
lcdDrawTextAlignedLeft(y, STR_INACTIVITYALARM);
|
lcdDrawTextAlignedLeft(y, STR_INACTIVITYALARM);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.inactivityTimer, attr|LEFT);
|
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
|
if(attr) g_eeGeneral.inactivityTimer = checkIncDec(event, g_eeGeneral.inactivityTimer, 0, 250, EE_GENERAL); //0..250minutes
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -434,7 +434,7 @@ void menuRadioSetup(event_t event)
|
||||||
case ITEM_SETUP_BACKLIGHT_DELAY:
|
case ITEM_SETUP_BACKLIGHT_DELAY:
|
||||||
lcdDrawTextAlignedLeft(y, STR_BLDELAY);
|
lcdDrawTextAlignedLeft(y, STR_BLDELAY);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.lightAutoOff*5, attr|LEFT);
|
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);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.lightAutoOff, 0, 600/5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -537,7 +537,7 @@ void menuRadioSetup(event_t event)
|
||||||
case ITEM_SETUP_SWITCHES_DELAY:
|
case ITEM_SETUP_SWITCHES_DELAY:
|
||||||
lcdDrawTextAlignedLeft(y, STR_SWITCHES_DELAY);
|
lcdDrawTextAlignedLeft(y, STR_SWITCHES_DELAY);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, 10*SWITCHES_DELAY(), attr|LEFT);
|
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);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.switchesDelay, -15, +15);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -496,7 +496,7 @@ void menuModelTelemetryMavlink(event_t event) {
|
||||||
case ITEM_MAVLINK_RC_RSSI_SCALE:
|
case ITEM_MAVLINK_RC_RSSI_SCALE:
|
||||||
lcdDrawTextAlignedLeft(y, STR_MAVLINK_RC_RSSI_SCALE_LABEL);
|
lcdDrawTextAlignedLeft(y, STR_MAVLINK_RC_RSSI_SCALE_LABEL);
|
||||||
lcdDrawNumber(VIEW_MAVLINK_2ND_COLUMN, y, (25 + g_model.mavlink.rc_rssi_scale * 5), attr|LEFT);
|
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);
|
if (attr) CHECK_INCDEC_MODELVAR(event, g_model.mavlink.rc_rssi_scale, 0, 15);
|
||||||
break;
|
break;
|
||||||
case ITEM_MAVLINK_PC_RSSI_EN:
|
case ITEM_MAVLINK_PC_RSSI_EN:
|
||||||
|
|
|
@ -171,16 +171,16 @@ void menuStatisticsDebug(event_t event)
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_MIXMAX, STR_TMIXMAXMS);
|
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_MIXMAX, STR_TMIXMAXMS);
|
||||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_MIXMAX, DURATION_MS_PREC2(maxMixerDuration), PREC2|LEFT);
|
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
|
#endif
|
||||||
|
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_RTOS, STR_FREESTACKMINB);
|
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_RTOS, STR_FREESTACKMINB);
|
||||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS+2, menusStack.available(), UNSIGN|LEFT|TINSIZE);
|
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS+2, menusStack.available(), UNSIGN|LEFT|TINSIZE);
|
||||||
lcdDrawText(lcdLastPos, MENU_DEBUG_Y_RTOS, "/");
|
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_RTOS, "/");
|
||||||
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_RTOS+2, mixerStack.available(), UNSIGN|LEFT|TINSIZE);
|
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_RTOS+2, mixerStack.available(), UNSIGN|LEFT|TINSIZE);
|
||||||
lcdDrawText(lcdLastPos, MENU_DEBUG_Y_RTOS, "/");
|
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_RTOS, "/");
|
||||||
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_RTOS+2, audioStack.available(), UNSIGN|LEFT|TINSIZE);
|
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_RTOS+2, audioStack.available(), UNSIGN|LEFT|TINSIZE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(CPUARM)
|
#if !defined(CPUARM)
|
||||||
|
|
|
@ -72,24 +72,24 @@ void drawGPSCoord(uint8_t y, char direction, int16_t bp, int16_t ap)
|
||||||
if (telemetryData.hub.gpsFix >= 0) {
|
if (telemetryData.hub.gpsFix >= 0) {
|
||||||
if (!direction) direction = '-';
|
if (!direction) direction = '-';
|
||||||
lcdDrawNumber(TELEM_2ND_COLUMN, y, bp / 100, LEFT); // ddd before '.'
|
lcdDrawNumber(TELEM_2ND_COLUMN, y, bp / 100, LEFT); // ddd before '.'
|
||||||
lcdDrawChar(lcdLastPos, y, '@');
|
lcdDrawChar(lcdLastRightPos, y, '@');
|
||||||
uint8_t mn = bp % 100; // TODO div_t
|
uint8_t mn = bp % 100; // TODO div_t
|
||||||
if (g_eeGeneral.gpsFormat == 0) {
|
if (g_eeGeneral.gpsFormat == 0) {
|
||||||
lcdDrawChar(lcdLastPos+FWNUM, y, direction);
|
lcdDrawChar(lcdLastRightPos+FWNUM, y, direction);
|
||||||
lcdDrawNumber(lcdLastPos+FW+FW+1, y, mn, LEFT|LEADING0, 2); // mm before '.'
|
lcdDrawNumber(lcdLastRightPos+FW+FW+1, y, mn, LEFT|LEADING0, 2); // mm before '.'
|
||||||
lcdDrawSolidVerticalLine(lcdLastPos, y, 2);
|
lcdDrawSolidVerticalLine(lcdLastRightPos, y, 2);
|
||||||
uint16_t ss = ap * 6;
|
uint16_t ss = ap * 6;
|
||||||
lcdDrawNumber(lcdLastPos+3, y, ss / 1000, LEFT|LEADING0, 2); // ''
|
lcdDrawNumber(lcdLastRightPos+3, y, ss / 1000, LEFT|LEADING0, 2); // ''
|
||||||
lcdDrawPoint(lcdLastPos, y+FH-2, 0); // small decimal point
|
lcdDrawPoint(lcdLastRightPos, y+FH-2, 0); // small decimal point
|
||||||
lcdDrawNumber(lcdLastPos+2, y, ss % 1000, LEFT|LEADING0, 3); // ''
|
lcdDrawNumber(lcdLastRightPos+2, y, ss % 1000, LEFT|LEADING0, 3); // ''
|
||||||
lcdDrawSolidVerticalLine(lcdLastPos, y, 2);
|
lcdDrawSolidVerticalLine(lcdLastRightPos, y, 2);
|
||||||
lcdDrawSolidVerticalLine(lcdLastPos+2, y, 2);
|
lcdDrawSolidVerticalLine(lcdLastRightPos+2, y, 2);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawNumber(lcdLastPos+FW, y, mn, LEFT|LEADING0, 2); // mm before '.'
|
lcdDrawNumber(lcdLastRightPos+FW, y, mn, LEFT|LEADING0, 2); // mm before '.'
|
||||||
lcdDrawPoint(lcdLastPos, y+FH-2, 0); // small decimal point
|
lcdDrawPoint(lcdLastRightPos, y+FH-2, 0); // small decimal point
|
||||||
lcdDrawNumber(lcdLastPos+2, y, ap, LEFT|UNSIGN|LEADING0, 4); // after '.'
|
lcdDrawNumber(lcdLastRightPos+2, y, ap, LEFT|UNSIGN|LEADING0, 4); // after '.'
|
||||||
lcdDrawChar(lcdLastPos+1, y, direction);
|
lcdDrawChar(lcdLastRightPos+1, y, direction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -324,7 +324,7 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (field) {
|
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};
|
coord_t pos[] = {0, 65, 130};
|
||||||
if (field >= MIXSRC_FIRST_TIMER && field <= MIXSRC_LAST_TIMER && i!=3) {
|
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
|
// 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()) {
|
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
|
// 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 {
|
else {
|
||||||
drawSource(pos[j], 1+FH+2*FH*i, field, 0);
|
drawSource(pos[j], 1+FH+2*FH*i, field, 0);
|
||||||
|
|
|
@ -39,7 +39,8 @@ void lcdClear()
|
||||||
memset(displayBuf, 0, DISPLAY_BUFFER_SIZE);
|
memset(displayBuf, 0, DISPLAY_BUFFER_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
coord_t lcdLastPos;
|
coord_t lcdLastRightPos;
|
||||||
|
coord_t lcdLastLeftPos;
|
||||||
coord_t lcdNextPos;
|
coord_t lcdNextPos;
|
||||||
|
|
||||||
struct PatternData
|
struct PatternData
|
||||||
|
@ -325,15 +326,20 @@ void lcdDrawSizedText(coord_t x, coord_t y, const char * s, uint8_t len, LcdFlag
|
||||||
s++;
|
s++;
|
||||||
}
|
}
|
||||||
|
|
||||||
lcdLastPos = x;
|
lcdLastRightPos = x;
|
||||||
lcdNextPos = x;
|
lcdNextPos = x;
|
||||||
if (fontsize == MIDSIZE) {
|
if (fontsize == MIDSIZE) {
|
||||||
lcdLastPos += 1;
|
lcdLastRightPos += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & RIGHT) {
|
if (flags & RIGHT) {
|
||||||
lcdLastPos -= width;
|
lcdLastRightPos -= width;
|
||||||
lcdNextPos -= 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)
|
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)));
|
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)
|
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
|
#endif
|
||||||
{
|
{
|
||||||
drawStringWithIndex(x, y, "LUA", qr.quot+1, att);
|
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) {
|
else if (idx <= MIXSRC_LAST_CH) {
|
||||||
drawStringWithIndex(x, y, STR_CH, idx-MIXSRC_CH1+1, att);
|
drawStringWithIndex(x, y, STR_CH, idx-MIXSRC_CH1+1, att);
|
||||||
if (ZEXIST(g_model.limitData[idx-MIXSRC_CH1].name) && (att & STREXPANDED)) {
|
if (ZEXIST(g_model.limitData[idx-MIXSRC_CH1].name) && (att & STREXPANDED)) {
|
||||||
lcdDrawChar(lcdLastPos, y, ' ', att|SMLSIZE);
|
lcdDrawChar(lcdLastRightPos, y, ' ', att|SMLSIZE);
|
||||||
lcdDrawSizedText(lcdLastPos+3, y, g_model.limitData[idx-MIXSRC_CH1].name, LEN_CHANNEL_NAME, ZCHAR|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) {
|
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;
|
idx -= MIXSRC_FIRST_TELEM;
|
||||||
div_t qr = div(idx, 3);
|
div_t qr = div(idx, 3);
|
||||||
lcdDrawSizedText(x, y, g_model.telemetrySensors[qr.quot].label, TELEM_LABEL_LEN, ZCHAR|att);
|
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);
|
// convertUnit(val, unit);
|
||||||
lcdDrawNumber(x, y, val, att & (~NO_UNIT));
|
lcdDrawNumber(x, y, val, att & (~NO_UNIT));
|
||||||
if (!(att & NO_UNIT) && unit != UNIT_RAW) {
|
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;
|
att &= ~RIGHT;
|
||||||
if (x > 10) x-=10;
|
if (x > 10) x-=10;
|
||||||
lcdDrawNumber(x, y, absvalue / 1000000, att); // ddd
|
lcdDrawNumber(x, y, absvalue / 1000000, att); // ddd
|
||||||
lcdDrawChar(lcdLastPos, y, '@', att);
|
lcdDrawChar(lcdLastRightPos, y, '@', att);
|
||||||
absvalue = absvalue % 1000000;
|
absvalue = absvalue % 1000000;
|
||||||
absvalue *= 60;
|
absvalue *= 60;
|
||||||
if (g_eeGeneral.gpsFormat == 0 || !seconds) {
|
if (g_eeGeneral.gpsFormat == 0 || !seconds) {
|
||||||
lcdDrawNumber(lcdNextPos, y, absvalue / 1000000, att|LEFT|LEADING0, 2); // mm before '.'
|
lcdDrawNumber(lcdNextPos, y, absvalue / 1000000, att|LEFT|LEADING0, 2); // mm before '.'
|
||||||
lcdDrawSolidVerticalLine(lcdLastPos, y, 2);
|
lcdDrawSolidVerticalLine(lcdLastRightPos, y, 2);
|
||||||
lcdLastPos += 1;
|
lcdLastRightPos += 1;
|
||||||
if (seconds) {
|
if (seconds) {
|
||||||
absvalue %= 1000000;
|
absvalue %= 1000000;
|
||||||
absvalue *= 60;
|
absvalue *= 60;
|
||||||
absvalue /= 10000;
|
absvalue /= 10000;
|
||||||
lcdDrawNumber(lcdLastPos+2, y, absvalue, att|LEFT|PREC2);
|
lcdDrawNumber(lcdLastRightPos+2, y, absvalue, att|LEFT|PREC2);
|
||||||
lcdDrawSolidVerticalLine(lcdLastPos, y, 2);
|
lcdDrawSolidVerticalLine(lcdLastRightPos, y, 2);
|
||||||
lcdDrawSolidVerticalLine(lcdLastPos+2, y, 2);
|
lcdDrawSolidVerticalLine(lcdLastRightPos+2, y, 2);
|
||||||
lcdLastPos += 3;
|
lcdLastRightPos += 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
absvalue /= 10000;
|
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)
|
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;
|
x -= 42;
|
||||||
att &= ~0x0F00; // TODO constant
|
att &= ~0x0F00; // TODO constant
|
||||||
lcdDrawNumber(x, y, telemetryItem.datetime.day, att|LEADING0|LEFT, 2);
|
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);
|
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);
|
lcdDrawNumber(lcdNextPos-1, y, telemetryItem.datetime.year-2000, att|LEFT);
|
||||||
y += FH;
|
y += FH;
|
||||||
lcdDrawNumber(x, y, telemetryItem.datetime.hour, att|LEADING0|LEFT, 2);
|
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);
|
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);
|
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.sec, att|LEADING0|LEFT, 2);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawNumber(x, y, telemetryItem.datetime.day, att|LEADING0|LEFT, 2);
|
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);
|
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, y, telemetryItem.datetime.year-2000, att|LEFT);
|
||||||
lcdDrawNumber(lcdNextPos+FW+1, y, telemetryItem.datetime.hour, att|LEADING0|LEFT, 2);
|
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);
|
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);
|
lcdDrawNumber(lcdNextPos, y, telemetryItem.datetime.sec, att|LEADING0|LEFT, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,7 +94,8 @@
|
||||||
extern display_t displayBuf[DISPLAY_BUFFER_SIZE];
|
extern display_t displayBuf[DISPLAY_BUFFER_SIZE];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern coord_t lcdLastPos;
|
extern coord_t lcdLastRightPos;
|
||||||
|
extern coord_t lcdLastLeftPos;
|
||||||
extern coord_t lcdNextPos;
|
extern coord_t lcdNextPos;
|
||||||
|
|
||||||
#define DISPLAY_END (displayBuf + DISPLAY_BUFFER_SIZE)
|
#define DISPLAY_END (displayBuf + DISPLAY_BUFFER_SIZE)
|
||||||
|
|
|
@ -24,7 +24,7 @@ void displayPresetChoice(event_t event)
|
||||||
{
|
{
|
||||||
runPopupWarning(event);
|
runPopupWarning(event);
|
||||||
lcdDrawNumber(WARNING_LINE_X+FW*7, WARNING_LINE_Y, 45*warningInputValue/4, LEFT|INVERS);
|
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) {
|
if (warningResult) {
|
||||||
warningResult = 0;
|
warningResult = 0;
|
||||||
|
@ -103,7 +103,7 @@ void menuModelCurveOne(event_t event)
|
||||||
attr = (menuVerticalPosition==2 ? (s_editMode>0 ? INVERS|BLINK : INVERS) : 0);
|
attr = (menuVerticalPosition==2 ? (s_editMode>0 ? INVERS|BLINK : INVERS) : 0);
|
||||||
lcdDrawTextAlignedLeft(5*FH+1, STR_COUNT);
|
lcdDrawTextAlignedLeft(5*FH+1, STR_COUNT);
|
||||||
lcdDrawNumber(INDENT_WIDTH, 6*FH+1, 5+crv.points, LEFT|attr);
|
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) {
|
if (attr) {
|
||||||
int8_t count = checkIncDecModel(event, crv.points, -3, 12); // 2pts - 17pts
|
int8_t count = checkIncDecModel(event, crv.points, -3, 12); // 2pts - 17pts
|
||||||
if (checkIncDec_Ret) {
|
if (checkIncDec_Ret) {
|
||||||
|
|
|
@ -43,14 +43,14 @@ void putsEdgeDelayParam(coord_t x, coord_t y, LogicalSwitchData * cs, uint8_t la
|
||||||
{
|
{
|
||||||
lcdDrawChar(x-4, y, '[');
|
lcdDrawChar(x-4, y, '[');
|
||||||
lcdDrawNumber(x, y, lswTimerValue(cs->v2), LEFT|PREC1|lattr);
|
lcdDrawNumber(x, y, lswTimerValue(cs->v2), LEFT|PREC1|lattr);
|
||||||
lcdDrawChar(lcdLastPos, y, ':');
|
lcdDrawChar(lcdLastRightPos, y, ':');
|
||||||
if (cs->v3 < 0)
|
if (cs->v3 < 0)
|
||||||
lcdDrawText(lcdLastPos+3, y, "<<", rattr);
|
lcdDrawText(lcdLastRightPos+3, y, "<<", rattr);
|
||||||
else if (cs->v3 == 0)
|
else if (cs->v3 == 0)
|
||||||
lcdDrawText(lcdLastPos+3, y, "--", rattr);
|
lcdDrawText(lcdLastRightPos+3, y, "--", rattr);
|
||||||
else
|
else
|
||||||
lcdDrawNumber(lcdLastPos+3, y, lswTimerValue(cs->v2+cs->v3), LEFT|PREC1|rattr);
|
lcdDrawNumber(lcdLastRightPos+3, y, lswTimerValue(cs->v2+cs->v3), LEFT|PREC1|rattr);
|
||||||
lcdDrawChar(lcdLastPos, y, ']');
|
lcdDrawChar(lcdLastRightPos, y, ']');
|
||||||
}
|
}
|
||||||
|
|
||||||
void onLogicalSwitchesMenu(const char *result)
|
void onLogicalSwitchesMenu(const char *result)
|
||||||
|
|
|
@ -231,7 +231,7 @@ void menuModelSelect(event_t event)
|
||||||
|
|
||||||
lcdDrawNumber(19*FW, 0, EeFsGetFree(), RIGHT);
|
lcdDrawNumber(19*FW, 0, EeFsGetFree(), RIGHT);
|
||||||
lcdDrawText(19*FW + 3, 0, STR_BYTES);
|
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);
|
drawScreenIndex(MENU_MODEL_SELECT, DIM(menuTabModel), 0);
|
||||||
lcdDrawFilledRect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);
|
lcdDrawFilledRect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);
|
||||||
|
|
|
@ -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));
|
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VBEEPCOUNTDOWN, timer.countdownBeep, (menuHorizontalPosition==0 ? attr : 0));
|
||||||
if (timer.countdownBeep != COUNTDOWN_SILENT) {
|
if (timer.countdownBeep != COUNTDOWN_SILENT) {
|
||||||
lcdDrawNumber(MODEL_SETUP_3RD_COLUMN, y, TIMER_COUNTDOWN_START(timerIdx), (menuHorizontalPosition == 1 ? attr : 0) | LEFT);
|
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) {
|
if (attr && s_editMode>0) {
|
||||||
switch (menuHorizontalPosition) {
|
switch (menuHorizontalPosition) {
|
||||||
|
@ -790,14 +790,14 @@ void menuModelSetup(event_t event)
|
||||||
lcdDrawTextAlignedLeft(y, STR_CHANNELRANGE);
|
lcdDrawTextAlignedLeft(y, STR_CHANNELRANGE);
|
||||||
if ((int8_t)PORT_CHANNELS_ROWS(moduleIdx) >= 0) {
|
if ((int8_t)PORT_CHANNELS_ROWS(moduleIdx) >= 0) {
|
||||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, STR_CH, menuHorizontalPosition==0 ? attr : 0);
|
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, STR_CH, menuHorizontalPosition==0 ? attr : 0);
|
||||||
lcdDrawNumber(lcdLastPos, y, moduleData.channelsStart+1, LEFT | (menuHorizontalPosition==0 ? attr : 0));
|
lcdDrawNumber(lcdLastRightPos, y, moduleData.channelsStart+1, LEFT | (menuHorizontalPosition==0 ? attr : 0));
|
||||||
lcdDrawChar(lcdLastPos, y, '-');
|
lcdDrawChar(lcdLastRightPos, y, '-');
|
||||||
lcdDrawNumber(lcdLastPos + FW+1, y, moduleData.channelsStart+NUM_CHANNELS(moduleIdx), LEFT | (menuHorizontalPosition==1 ? attr : 0));
|
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 (IS_MODULE_XJT(moduleIdx) && g_model.moduleData[moduleIdx].rfProtocol== RF_PROTO_X16) {
|
||||||
if (NUM_CHANNELS(moduleIdx) > 8)
|
if (NUM_CHANNELS(moduleIdx) > 8)
|
||||||
lcdDrawText(lcdLastPos+5, y, "(18ms)");
|
lcdDrawText(lcdLastRightPos+5, y, "(18ms)");
|
||||||
else
|
else
|
||||||
lcdDrawText(lcdLastPos+5, y, "(9ms)");
|
lcdDrawText(lcdLastRightPos+5, y, "(9ms)");
|
||||||
}
|
}
|
||||||
if (attr && s_editMode>0) {
|
if (attr && s_editMode>0) {
|
||||||
switch (menuHorizontalPosition) {
|
switch (menuHorizontalPosition) {
|
||||||
|
@ -831,9 +831,9 @@ void menuModelSetup(event_t event)
|
||||||
if (IS_MODULE_PPM(moduleIdx)) {
|
if (IS_MODULE_PPM(moduleIdx)) {
|
||||||
lcdDrawTextAlignedLeft(y, STR_PPMFRAME);
|
lcdDrawTextAlignedLeft(y, STR_PPMFRAME);
|
||||||
lcdDrawNumber(MODEL_SETUP_2ND_COLUMN, y, (int16_t)moduleData.ppm.frameLength*5 + 225, (menuHorizontalPosition<=0 ? attr : 0) | PREC1|LEFT);
|
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);
|
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);
|
lcdDrawChar(MODEL_SETUP_2ND_COLUMN+12*FW, y, moduleData.ppm.pulsePol ? '+' : '-', (CURSOR_ON_LINE() || menuHorizontalPosition==2) ? attr : 0);
|
||||||
|
|
||||||
if (attr && s_editMode>0) {
|
if (attr && s_editMode>0) {
|
||||||
|
|
|
@ -326,7 +326,7 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||||
else if (func == FUNC_LOGS) {
|
else if (func == FUNC_LOGS) {
|
||||||
if (val_displayed) {
|
if (val_displayed) {
|
||||||
lcdDrawNumber(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|PREC1|LEFT);
|
lcdDrawNumber(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|PREC1|LEFT);
|
||||||
lcdDrawChar(lcdLastPos, y, 's');
|
lcdDrawChar(lcdLastRightPos, y, 's');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawMMM(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, attr);
|
lcdDrawMMM(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, attr);
|
||||||
|
|
|
@ -416,7 +416,7 @@ void menuModelTelemetryFrsky(event_t event)
|
||||||
if (k>=ITEM_TELEMETRY_SENSOR1 && k<ITEM_TELEMETRY_SENSOR1+MAX_TELEMETRY_SENSORS) {
|
if (k>=ITEM_TELEMETRY_SENSOR1 && k<ITEM_TELEMETRY_SENSOR1+MAX_TELEMETRY_SENSORS) {
|
||||||
int index = k-ITEM_TELEMETRY_SENSOR1;
|
int index = k-ITEM_TELEMETRY_SENSOR1;
|
||||||
lcdDrawNumber(INDENT_WIDTH, y, index+1, LEFT|attr);
|
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);
|
lcdDrawSizedText(3*FW, y, g_model.telemetrySensors[index].label, TELEM_LABEL_LEN, ZCHAR);
|
||||||
if (telemetryItems[index].isFresh()) {
|
if (telemetryItems[index].isFresh()) {
|
||||||
lcdDrawChar(10*FW, y, '*');
|
lcdDrawChar(10*FW, y, '*');
|
||||||
|
@ -427,7 +427,7 @@ void menuModelTelemetryFrsky(event_t event)
|
||||||
lcdNextPos = TELEM_COL2;
|
lcdNextPos = TELEM_COL2;
|
||||||
if (isOld) lcdDrawChar(lcdNextPos, y, '[');
|
if (isOld) lcdDrawChar(lcdNextPos, y, '[');
|
||||||
drawSensorCustomValue(lcdNextPos, y, index, getValue(MIXSRC_FIRST_TELEM+3*index), LEFT);
|
drawSensorCustomValue(lcdNextPos, y, index, getValue(MIXSRC_FIRST_TELEM+3*index), LEFT);
|
||||||
if (isOld) lcdDrawChar(lcdLastPos, y, ']');
|
if (isOld) lcdDrawChar(lcdLastRightPos, y, ']');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawText(TELEM_COL2, y, "---", 0); // TODO shortcut
|
lcdDrawText(TELEM_COL2, y, "---", 0); // TODO shortcut
|
||||||
|
|
|
@ -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);
|
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) {
|
switch (event) {
|
||||||
case EVT_ENTRY:
|
case EVT_ENTRY:
|
||||||
|
|
|
@ -199,8 +199,8 @@ void menuRadioSetup(event_t event)
|
||||||
case ITEM_SETUP_BATTERY_RANGE:
|
case ITEM_SETUP_BATTERY_RANGE:
|
||||||
lcdDrawTextAlignedLeft(y, STR_BATTERY_RANGE);
|
lcdDrawTextAlignedLeft(y, STR_BATTERY_RANGE);
|
||||||
putsVolts(RADIO_SETUP_2ND_COLUMN, y, 90+g_eeGeneral.vBatMin, (menuHorizontalPosition==0 ? attr : 0)|LEFT|NO_UNIT);
|
putsVolts(RADIO_SETUP_2ND_COLUMN, y, 90+g_eeGeneral.vBatMin, (menuHorizontalPosition==0 ? attr : 0)|LEFT|NO_UNIT);
|
||||||
lcdDrawChar(lcdLastPos, y, '-');
|
lcdDrawChar(lcdLastRightPos, y, '-');
|
||||||
putsVolts(lcdLastPos+FW, y, 120+g_eeGeneral.vBatMax, (menuHorizontalPosition>0 ? attr : 0)|LEFT|NO_UNIT);
|
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 && menuHorizontalPosition < 0) lcdDrawFilledRect(RADIO_SETUP_2ND_COLUMN, y, LCD_W-RADIO_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH, 8);
|
||||||
if (attr && s_editMode>0) {
|
if (attr && s_editMode>0) {
|
||||||
if (menuHorizontalPosition==0)
|
if (menuHorizontalPosition==0)
|
||||||
|
@ -255,7 +255,7 @@ void menuRadioSetup(event_t event)
|
||||||
lcdDrawTextAlignedLeft( y, STR_SPKRPITCH);
|
lcdDrawTextAlignedLeft( y, STR_SPKRPITCH);
|
||||||
lcdDrawChar(RADIO_SETUP_2ND_COLUMN, y, '+', attr);
|
lcdDrawChar(RADIO_SETUP_2ND_COLUMN, y, '+', attr);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN+FW, y, g_eeGeneral.speakerPitch*15, attr|LEFT);
|
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) {
|
if (attr) {
|
||||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.speakerPitch, 0, 20);
|
CHECK_INCDEC_GENVAR(event, g_eeGeneral.speakerPitch, 0, 20);
|
||||||
}
|
}
|
||||||
|
@ -273,21 +273,21 @@ void menuRadioSetup(event_t event)
|
||||||
case ITEM_SETUP_VARIO_PITCH:
|
case ITEM_SETUP_VARIO_PITCH:
|
||||||
lcdDrawTextAlignedLeft(y, STR_PITCH_AT_ZERO);
|
lcdDrawTextAlignedLeft(y, STR_PITCH_AT_ZERO);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10), attr|LEFT);
|
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);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioPitch, -40, 40);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_SETUP_VARIO_RANGE:
|
case ITEM_SETUP_VARIO_RANGE:
|
||||||
lcdDrawTextAlignedLeft(y, STR_PITCH_AT_MAX);
|
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);
|
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);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRange, -80, 80);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ITEM_SETUP_VARIO_REPEAT:
|
case ITEM_SETUP_VARIO_REPEAT:
|
||||||
lcdDrawTextAlignedLeft(y, STR_REPEAT_AT_ZERO);
|
lcdDrawTextAlignedLeft(y, STR_REPEAT_AT_ZERO);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, VARIO_REPEAT_ZERO+(g_eeGeneral.varioRepeat*10), attr|LEFT);
|
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);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRepeat, -30, 50);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
@ -346,7 +346,7 @@ void menuRadioSetup(event_t event)
|
||||||
case ITEM_SETUP_INACTIVITY_ALARM:
|
case ITEM_SETUP_INACTIVITY_ALARM:
|
||||||
lcdDrawTextAlignedLeft(y, STR_INACTIVITYALARM);
|
lcdDrawTextAlignedLeft(y, STR_INACTIVITYALARM);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.inactivityTimer, attr|LEFT);
|
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
|
if(attr) g_eeGeneral.inactivityTimer = checkIncDec(event, g_eeGeneral.inactivityTimer, 0, 250, EE_GENERAL); //0..250minutes
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -365,7 +365,7 @@ void menuRadioSetup(event_t event)
|
||||||
case ITEM_SETUP_BACKLIGHT_DELAY:
|
case ITEM_SETUP_BACKLIGHT_DELAY:
|
||||||
lcdDrawTextAlignedLeft(y, STR_BLDELAY);
|
lcdDrawTextAlignedLeft(y, STR_BLDELAY);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.lightAutoOff*5, attr|LEFT);
|
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);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.lightAutoOff, 0, 600/5);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -393,7 +393,7 @@ void menuRadioSetup(event_t event)
|
||||||
lcdDrawTextAlignedLeft(y, STR_SPLASHSCREEN);
|
lcdDrawTextAlignedLeft(y, STR_SPLASHSCREEN);
|
||||||
if (SPLASH_NEEDED()) {
|
if (SPLASH_NEEDED()) {
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, SPLASH_TIMEOUT/100, attr|LEFT);
|
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, SPLASH_TIMEOUT/100, attr|LEFT);
|
||||||
lcdDrawChar(lcdLastPos, y, 's');
|
lcdDrawChar(lcdLastRightPos, y, 's');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lcdDrawMMM(RADIO_SETUP_2ND_COLUMN, y, attr);
|
lcdDrawMMM(RADIO_SETUP_2ND_COLUMN, y, attr);
|
||||||
|
@ -466,7 +466,7 @@ void menuRadioSetup(event_t event)
|
||||||
case ITEM_SETUP_SWITCHES_DELAY:
|
case ITEM_SETUP_SWITCHES_DELAY:
|
||||||
lcdDrawTextAlignedLeft(y, STR_SWITCHES_DELAY);
|
lcdDrawTextAlignedLeft(y, STR_SWITCHES_DELAY);
|
||||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, 10*SWITCHES_DELAY(), attr|LEFT);
|
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);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.switchesDelay, -15, 100-15);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -207,7 +207,7 @@ void displayTopBar()
|
||||||
|
|
||||||
/* Tx voltage */
|
/* Tx voltage */
|
||||||
putsVBat(BAR_X+2, BAR_Y+1, LEFT);
|
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);
|
lcdDrawRect(batt_icon_x+FW, BAR_Y+1, 13, 7);
|
||||||
lcdDrawSolidVerticalLine(batt_icon_x+FW+13, BAR_Y+2, 5);
|
lcdDrawSolidVerticalLine(batt_icon_x+FW+13, BAR_Y+2, 5);
|
||||||
|
|
||||||
|
@ -224,7 +224,7 @@ void displayTopBar()
|
||||||
TelemetryItem & voltsItem = telemetryItems[item];
|
TelemetryItem & voltsItem = telemetryItems[item];
|
||||||
if (voltsItem.isAvailable()) {
|
if (voltsItem.isAvailable()) {
|
||||||
drawSensorCustomValue(batt_icon_x+7*FW+2, BAR_Y+1, item, voltsItem.value, LEFT);
|
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);
|
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);
|
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);
|
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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,40 +152,40 @@ void menuStatisticsDebug(event_t event)
|
||||||
|
|
||||||
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_FREE_RAM, "Free Mem");
|
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_FREE_RAM, "Free Mem");
|
||||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_FREE_RAM, availableMemory(), LEFT);
|
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)
|
#if defined(LUA)
|
||||||
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_LUA, "Lua scripts");
|
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_LUA, "Lua scripts");
|
||||||
lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_LUA+1, "[Duration]", SMLSIZE);
|
lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_LUA+1, "[Duration]", SMLSIZE);
|
||||||
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_LUA, 10*maxLuaDuration, LEFT);
|
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_LUA, 10*maxLuaDuration, LEFT);
|
||||||
lcdDrawText(lcdLastPos+2, MENU_DEBUG_Y_LUA+1, "[Interval]", SMLSIZE);
|
lcdDrawText(lcdLastRightPos+2, MENU_DEBUG_Y_LUA+1, "[Interval]", SMLSIZE);
|
||||||
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_LUA, 10*maxLuaInterval, LEFT);
|
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_LUA, 10*maxLuaInterval, LEFT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_MIXMAX, STR_TMIXMAXMS);
|
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_MIXMAX, STR_TMIXMAXMS);
|
||||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_MIXMAX, DURATION_MS_PREC2(maxMixerDuration), PREC2|LEFT);
|
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)
|
#if !defined(SIMU) && defined(USB_SERIAL)
|
||||||
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_USB, "Usb");
|
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_USB, "Usb");
|
||||||
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_USB, charsWritten, LEFT);
|
lcdDrawNumber(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_USB, charsWritten, LEFT);
|
||||||
lcdDrawText(lcdLastPos, MENU_DEBUG_Y_USB, " ");
|
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_USB, " ");
|
||||||
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_USB, APP_Rx_ptr_in, LEFT);
|
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_USB, APP_Rx_ptr_in, LEFT);
|
||||||
lcdDrawText(lcdLastPos, MENU_DEBUG_Y_USB, " ");
|
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_USB, " ");
|
||||||
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_USB, APP_Rx_ptr_out, LEFT);
|
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_USB, APP_Rx_ptr_out, LEFT);
|
||||||
lcdDrawText(lcdLastPos, MENU_DEBUG_Y_USB, " ");
|
lcdDrawText(lcdLastRightPos, MENU_DEBUG_Y_USB, " ");
|
||||||
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_USB, usbWraps, LEFT);
|
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_USB, usbWraps, LEFT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_RTOS, STR_FREESTACKMINB);
|
lcdDrawTextAlignedLeft(MENU_DEBUG_Y_RTOS, STR_FREESTACKMINB);
|
||||||
lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS+1, "[M]", SMLSIZE);
|
lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS+1, "[M]", SMLSIZE);
|
||||||
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_RTOS, menusStack.available(), LEFT);
|
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_RTOS, menusStack.available(), LEFT);
|
||||||
lcdDrawText(lcdLastPos+2, MENU_DEBUG_Y_RTOS+1, "[X]", SMLSIZE);
|
lcdDrawText(lcdLastRightPos+2, MENU_DEBUG_Y_RTOS+1, "[X]", SMLSIZE);
|
||||||
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_RTOS, mixerStack.available(), LEFT);
|
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_RTOS, mixerStack.available(), LEFT);
|
||||||
lcdDrawText(lcdLastPos+2, MENU_DEBUG_Y_RTOS+1, "[A]", SMLSIZE);
|
lcdDrawText(lcdLastRightPos+2, MENU_DEBUG_Y_RTOS+1, "[A]", SMLSIZE);
|
||||||
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_RTOS, audioStack.available(), LEFT);
|
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_RTOS, audioStack.available(), LEFT);
|
||||||
lcdDrawText(lcdLastPos+2, MENU_DEBUG_Y_RTOS+1, "[I]", SMLSIZE);
|
lcdDrawText(lcdLastRightPos+2, MENU_DEBUG_Y_RTOS+1, "[I]", SMLSIZE);
|
||||||
lcdDrawNumber(lcdLastPos, MENU_DEBUG_Y_RTOS, stackAvailable(), LEFT);
|
lcdDrawNumber(lcdLastRightPos, MENU_DEBUG_Y_RTOS, stackAvailable(), LEFT);
|
||||||
|
|
||||||
lcdDrawText(3*FW, 7*FH+1, STR_MENUTORESET);
|
lcdDrawText(3*FW, 7*FH+1, STR_MENUTORESET);
|
||||||
lcdInvertLastLine();
|
lcdInvertLastLine();
|
||||||
|
|
|
@ -51,7 +51,7 @@ bool menuModelCustomScriptOne(event_t event)
|
||||||
{
|
{
|
||||||
ScriptData &sd = g_model.scriptsData[s_currIdx];
|
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*/ });
|
SUBMENU(STR_MENUCUSTOMSCRIPTS, ICON_MODEL_LUA_SCRIPTS, 3+scriptInputsOutputs[s_currIdx].inputsCount, { 0, 0, LABEL(inputs), 0/*repeated*/ });
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ void menuModelCurvesAll(event_t event)
|
||||||
editName(4*FW, y, crv.name, sizeof(crv.name), 0, 0);
|
editName(4*FW, y, crv.name, sizeof(crv.name), 0, 0);
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
lcdDrawNumber(11*FW, y, 5+crv.points, LEFT);
|
lcdDrawNumber(11*FW, y, 5+crv.points, LEFT);
|
||||||
lcdDrawText(lcdLastPos, y, STR_PTS, 0);
|
lcdDrawText(lcdLastRightPos, y, STR_PTS, 0);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,21 +34,21 @@ void menuRadioSdManagerInfo(event_t event)
|
||||||
|
|
||||||
lcdDrawTextAlignedLeft(3*FH, STR_SD_SIZE);
|
lcdDrawTextAlignedLeft(3*FH, STR_SD_SIZE);
|
||||||
lcdDrawNumber(10*FW, 3*FH, sdGetSize(), LEFT);
|
lcdDrawNumber(10*FW, 3*FH, sdGetSize(), LEFT);
|
||||||
lcdDrawChar(lcdLastPos, 3*FH, 'M');
|
lcdDrawChar(lcdLastRightPos, 3*FH, 'M');
|
||||||
|
|
||||||
lcdDrawTextAlignedLeft(4*FH, STR_SD_SECTORS);
|
lcdDrawTextAlignedLeft(4*FH, STR_SD_SECTORS);
|
||||||
#if defined(SD_GET_FREE_BLOCKNR)
|
#if defined(SD_GET_FREE_BLOCKNR)
|
||||||
lcdDrawNumber(10*FW, 4*FH, SD_GET_FREE_BLOCKNR()/1000, LEFT);
|
lcdDrawNumber(10*FW, 4*FH, SD_GET_FREE_BLOCKNR()/1000, LEFT);
|
||||||
lcdDrawChar(lcdLastPos, 4*FH, '/');
|
lcdDrawChar(lcdLastRightPos, 4*FH, '/');
|
||||||
lcdDrawNumber(lcdLastPos+FW, 4*FH, sdGetNoSectors()/1000, LEFT);
|
lcdDrawNumber(lcdLastRightPos+FW, 4*FH, sdGetNoSectors()/1000, LEFT);
|
||||||
#else
|
#else
|
||||||
lcdDrawNumber(10*FW, 4*FH, sdGetNoSectors()/1000, LEFT);
|
lcdDrawNumber(10*FW, 4*FH, sdGetNoSectors()/1000, LEFT);
|
||||||
#endif
|
#endif
|
||||||
lcdDrawChar(lcdLastPos, 4*FH, 'k');
|
lcdDrawChar(lcdLastRightPos, 4*FH, 'k');
|
||||||
|
|
||||||
lcdDrawTextAlignedLeft(5*FH, STR_SD_SPEED);
|
lcdDrawTextAlignedLeft(5*FH, STR_SD_SPEED);
|
||||||
lcdDrawNumber(10*FW, 5*FH, SD_GET_SPEED()/1000, LEFT);
|
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)
|
inline bool isFilenameGreater(bool isfile, const char * fn, const char * line)
|
||||||
|
|
|
@ -136,20 +136,55 @@ static int luaLcdDrawLine(lua_State *L)
|
||||||
/*luadoc
|
/*luadoc
|
||||||
@function lcd.getLastPos()
|
@function lcd.getLastPos()
|
||||||
|
|
||||||
Returns the last x position from previous output
|
Returns the rightmost x position from previous output
|
||||||
|
|
||||||
@retval number (integer) x position
|
@retval number (integer) x position
|
||||||
|
|
||||||
@notice Only available on Taranis
|
@notice Only available on Taranis
|
||||||
|
|
||||||
|
@notice For added clarity, it is recommended to use lcd.getLastRightPos()
|
||||||
|
|
||||||
@status current Introduced in 2.0.0
|
@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)
|
static int luaLcdGetLastPos(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_pushinteger(L, lcdLastPos);
|
lua_pushinteger(L, lcdLastRightPos);
|
||||||
return 1;
|
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
|
/*luadoc
|
||||||
@function lcd.drawText(x, y, text [, flags])
|
@function lcd.drawText(x, y, text [, flags])
|
||||||
|
@ -833,12 +868,16 @@ const luaL_Reg lcdLib[] = {
|
||||||
{ "RGB", luaRGB },
|
{ "RGB", luaRGB },
|
||||||
#elif LCD_DEPTH > 1
|
#elif LCD_DEPTH > 1
|
||||||
{ "getLastPos", luaLcdGetLastPos },
|
{ "getLastPos", luaLcdGetLastPos },
|
||||||
|
{ "getLastRightPos", luaLcdGetLastPos },
|
||||||
|
{ "getLastLeftPos", luaLcdGetLeftPos },
|
||||||
{ "drawPixmap", luaLcdDrawPixmap },
|
{ "drawPixmap", luaLcdDrawPixmap },
|
||||||
{ "drawScreenTitle", luaLcdDrawScreenTitle },
|
{ "drawScreenTitle", luaLcdDrawScreenTitle },
|
||||||
{ "drawCombobox", luaLcdDrawCombobox },
|
{ "drawCombobox", luaLcdDrawCombobox },
|
||||||
#else
|
#else
|
||||||
{ "drawScreenTitle", luaLcdDrawScreenTitle },
|
{ "drawScreenTitle", luaLcdDrawScreenTitle },
|
||||||
{ "getLastPos", luaLcdGetLastPos },
|
{ "getLastPos", luaLcdGetLastPos },
|
||||||
|
{ "getLastRightPos", luaLcdGetLastPos },
|
||||||
|
{ "getLastLeftPos", luaLcdGetLeftPos },
|
||||||
{ "drawCombobox", luaLcdDrawCombobox },
|
{ "drawCombobox", luaLcdDrawCombobox },
|
||||||
#endif
|
#endif
|
||||||
{ NULL, NULL } /* sentinel */
|
{ NULL, NULL } /* sentinel */
|
||||||
|
|
|
@ -776,12 +776,12 @@ void luaDoOneRunStandalone(event_t evt)
|
||||||
else if (luaDisplayStatistics) {
|
else if (luaDisplayStatistics) {
|
||||||
#if defined(COLORLCD)
|
#if defined(COLORLCD)
|
||||||
#else
|
#else
|
||||||
lcdDrawSolidHorizontalLine(0, 7*FH-1, lcdLastPos+6, ERASE);
|
lcdDrawSolidHorizontalLine(0, 7*FH-1, lcdLastRightPos+6, ERASE);
|
||||||
lcdDrawText(0, 7*FH, "GV Use: ");
|
lcdDrawText(0, 7*FH, "GV Use: ");
|
||||||
lcdDrawNumber(lcdLastPos, 7*FH, luaGetMemUsed(lsScripts), LEFT);
|
lcdDrawNumber(lcdLastRightPos, 7*FH, luaGetMemUsed(lsScripts), LEFT);
|
||||||
lcdDrawChar(lcdLastPos, 7*FH, 'b');
|
lcdDrawChar(lcdLastRightPos, 7*FH, 'b');
|
||||||
lcdDrawSolidHorizontalLine(0, 7*FH-2, lcdLastPos+6, FORCE);
|
lcdDrawSolidHorizontalLine(0, 7*FH-2, lcdLastRightPos+6, FORCE);
|
||||||
lcdDrawVerticalLine(lcdLastPos+6, 7*FH-2, FH+2, SOLID, FORCE);
|
lcdDrawVerticalLine(lcdLastRightPos+6, 7*FH-2, FH+2, SOLID, FORCE);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
BIN
radio/src/tests/arm_unsigned_128x64.png
Normal file
BIN
radio/src/tests/arm_unsigned_128x64.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 328 B |
|
@ -106,6 +106,13 @@ TEST(outdezNAtt, test_unsigned)
|
||||||
lcdDrawNumber(0, 0, 65530, LEFT);
|
lcdDrawNumber(0, 0, 65530, LEFT);
|
||||||
EXPECT_TRUE(checkScreenshot("unsigned")) << "Unsigned numbers will be bad displayed";
|
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
|
#else
|
||||||
TEST(outdezNAtt, test_unsigned)
|
TEST(outdezNAtt, test_unsigned)
|
||||||
{
|
{
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 365 B After Width: | Height: | Size: 349 B |
Binary file not shown.
Before Width: | Height: | Size: 355 B After Width: | Height: | Size: 340 B |
Loading…
Add table
Add a link
Reference in a new issue