Taranis 128x64
This commit is contained in:
committed by
Raphael Coeffic
parent
352c273d32
commit
cf06efea87
@@ -21,12 +21,22 @@
|
||||
|
||||
#include <limits.h>
|
||||
#include <memory.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "lcd.h"
|
||||
#include "thirdparty/libopenui/src/bitfield.h"
|
||||
#include "gui/common/stdlcd/fonts.h"
|
||||
#include "gui/common/stdlcd/utf8.h"
|
||||
|
||||
#if !defined(SIMU)
|
||||
#define assert(x)
|
||||
#else
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
#if !defined(BOOT)
|
||||
#include "opentx.h"
|
||||
#endif
|
||||
|
||||
pixel_t displayBuf[DISPLAY_BUFFER_SIZE] __DMA;
|
||||
|
||||
void lcdClear()
|
||||
|
||||
@@ -63,6 +63,8 @@ enum GVarFields {
|
||||
|
||||
#define GVAR_2ND_COLUMN (12*FW)
|
||||
|
||||
static const char* _str_units[] = { "-", "%" };
|
||||
|
||||
void menuModelGVarOne(event_t event)
|
||||
{
|
||||
GVarData * gvar = &g_model.gvars[s_currIdxSubMenu];
|
||||
@@ -87,7 +89,7 @@ void menuModelGVarOne(event_t event)
|
||||
break;
|
||||
|
||||
case GVAR_FIELD_UNIT:
|
||||
gvar->unit = editChoice(GVAR_2ND_COLUMN, y, STR_UNIT, "\001-%", gvar->unit, 0, 1, attr, event);
|
||||
gvar->unit = editChoice(GVAR_2ND_COLUMN, y, STR_UNIT, _str_units, gvar->unit, 0, 1, attr, event);
|
||||
break;
|
||||
|
||||
case GVAR_FIELD_PREC:
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user