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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user