Taranis 128x64

This commit is contained in:
Raphael Coeffic
2022-06-11 15:38:08 +02:00
committed by Raphael Coeffic
parent 352c273d32
commit cf06efea87
8 changed files with 38 additions and 12 deletions
+9 -6
View File
@@ -424,6 +424,8 @@ void editTimerCountdown(int timerIdx, coord_t y, LcdFlags attr, event_t event)
NUM_SWITCHES - 1, /* Switch warning */
#endif
static const char* _pots_warn_modes[] = { "OFF", "Man", "Auto" };
void menuModelSetup(event_t event)
{
int8_t old_editMode = s_editMode;
@@ -781,9 +783,9 @@ void menuModelSetup(event_t event)
case ITEM_MODEL_SETUP_SWITCHES_WARNING1:
{
#define FIRSTSW_STR STR_VSRCRAW+(MIXSRC_FIRST_SWITCH-MIXSRC_Rud+1)*length
#define FIRSTSW_STR (&STR_VSRCRAW[MIXSRC_FIRST_SWITCH-MIXSRC_FIRST_STICK+1])
uint8_t switchWarningsCount = getSwitchWarningsCount();
uint8_t length = STR_VSRCRAW[0];
//uint8_t length = STR_VSRCRAW[0];
horzpos_t l_posHorz = menuHorizontalPosition;
if (i>=NUM_BODY_LINES-2 && getSwitchWarningsCount() > MAX_SWITCH_PER_LINE*(NUM_BODY_LINES-i)) {
@@ -856,7 +858,7 @@ void menuModelSetup(event_t event)
c = (" " STR_CHAR_UP "-" STR_CHAR_DOWN)[states & 0x03];
lcdDrawSizedText(
MODEL_SETUP_2ND_COLUMN + qr.rem * ((2 * FW) + 1),
y + FH * qr.quot, FIRSTSW_STR + (i * length) + 3, 1,
y + FH * qr.quot, FIRSTSW_STR[i] + sizeof(STR_CHAR_SWITCH) - 1, 1,
attr && (menuHorizontalPosition == current) ? INVERS : 0);
lcdDrawChar(lcdNextPos, y + FH * qr.quot, c);
++current;
@@ -873,7 +875,7 @@ void menuModelSetup(event_t event)
case ITEM_MODEL_SETUP_POTS_WARNING:
lcdDrawTextAlignedLeft(y, STR_POTWARNING);
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, "\004""OFF\0""Man\0""Auto", g_model.potsWarnMode, (menuHorizontalPosition == 0) ? attr : 0);
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, _pots_warn_modes, g_model.potsWarnMode, (menuHorizontalPosition == 0) ? attr : 0);
if (attr && (menuHorizontalPosition == 0)) {
CHECK_INCDEC_MODELVAR(event, g_model.potsWarnMode, POTS_WARN_OFF, POTS_WARN_AUTO);
storageDirty(EE_MODEL);
@@ -910,8 +912,9 @@ void menuModelSetup(event_t event)
flags |= INVERS;
}
// TODO add a new function
lcdDrawSizedText(x, y, STR_VSRCRAW+2+STR_VSRCRAW[0]*(NUM_STICKS+1+i), STR_VSRCRAW[0]-1, flags);
// skip "---" (+1) and source symbol (+2)
const char* source = STR_VSRCRAW[NUM_STICKS + 1 + i] + 2;
lcdDrawSizedText(x, y, source, UINT8_MAX, flags);
x = lcdNextPos+3;
}
}