mirror of
https://github.com/opentx/opentx.git
synced 2025-07-17 21:35:27 +03:00
[Horus] Refactoring continued
This commit is contained in:
parent
fb371cf5b7
commit
ab0272c16c
116 changed files with 1042 additions and 1269 deletions
|
@ -512,7 +512,7 @@ void AudioQueue::start()
|
|||
#define CODEC_ID_PCM_ALAW 6
|
||||
#define CODEC_ID_PCM_MULAW 7
|
||||
|
||||
#ifndef SIMU
|
||||
#if !defined(SIMU)
|
||||
void audioTask(void* pdata)
|
||||
{
|
||||
while (!audioQueue.started()) {
|
||||
|
@ -521,8 +521,9 @@ void audioTask(void* pdata)
|
|||
|
||||
setSampleRate(AUDIO_SAMPLE_RATE);
|
||||
|
||||
#if defined(SDCARD)
|
||||
TRACE("unexpectedShutdown = %d", unexpectedShutdown);
|
||||
#if !defined(EEPROM)
|
||||
AUDIO_TADA();
|
||||
#elif defined(SDCARD)
|
||||
if (!unexpectedShutdown) {
|
||||
sdInit();
|
||||
AUDIO_TADA();
|
||||
|
|
|
@ -46,7 +46,7 @@ void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr);
|
|||
|
||||
#if !defined(CPUM64)
|
||||
#define DEFAULT_SCROLLBAR_X (LCD_W-1)
|
||||
void lcdDrawScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
|
||||
void drawScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
|
||||
#endif
|
||||
|
||||
#define SET_SCROLLBAR_X(x)
|
||||
|
|
|
@ -208,7 +208,7 @@ void lcd_putc(coord_t x, coord_t y, const unsigned char c)
|
|||
lcdDrawChar(x, y, c, 0);
|
||||
}
|
||||
|
||||
void lcd_putsnAtt(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdFlags flags)
|
||||
void lcdDrawTextWithLen(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdFlags flags)
|
||||
{
|
||||
const coord_t orig_x = x;
|
||||
#if defined(CPUARM)
|
||||
|
@ -283,17 +283,17 @@ void lcd_putsnAtt(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdFlags
|
|||
|
||||
void lcd_putsn(coord_t x, coord_t y, const pm_char * s, uint8_t len)
|
||||
{
|
||||
lcd_putsnAtt(x, y, s, len, 0);
|
||||
lcdDrawTextWithLen(x, y, s, len, 0);
|
||||
}
|
||||
|
||||
void lcd_putsAtt(coord_t x, coord_t y, const pm_char * s, LcdFlags flags)
|
||||
void lcdDrawText(coord_t x, coord_t y, const pm_char * s, LcdFlags flags)
|
||||
{
|
||||
lcd_putsnAtt(x, y, s, 255, flags);
|
||||
lcdDrawTextWithLen(x, y, s, 255, flags);
|
||||
}
|
||||
|
||||
void lcd_puts(coord_t x, coord_t y, const pm_char * s)
|
||||
{
|
||||
lcd_putsAtt(x, y, s, 0);
|
||||
lcdDrawText(x, y, s, 0);
|
||||
}
|
||||
|
||||
void lcd_putsLeft(coord_t y, const pm_char * s)
|
||||
|
@ -302,11 +302,11 @@ void lcd_putsLeft(coord_t y, const pm_char * s)
|
|||
}
|
||||
|
||||
#if !defined(BOOT)
|
||||
void lcd_putsiAtt(coord_t x, coord_t y, const pm_char * s,uint8_t idx, LcdFlags flags)
|
||||
void lcdDrawTextAtIndex(coord_t x, coord_t y, const pm_char * s,uint8_t idx, LcdFlags flags)
|
||||
{
|
||||
uint8_t length;
|
||||
length = pgm_read_byte(s++);
|
||||
lcd_putsnAtt(x, y, s+length*idx, length, flags & ~(BSS|ZCHAR));
|
||||
lcdDrawTextWithLen(x, y, s+length*idx, length, flags & ~(BSS|ZCHAR));
|
||||
}
|
||||
|
||||
#if defined(CPUARM)
|
||||
|
@ -656,14 +656,14 @@ void putsVBat(coord_t x, coord_t y, LcdFlags att)
|
|||
|
||||
void putsStrIdx(coord_t x, coord_t y, const pm_char *str, uint8_t idx, LcdFlags att)
|
||||
{
|
||||
lcd_putsAtt(x, y, str, att & ~LEADING0);
|
||||
lcdDrawText(x, y, str, att & ~LEADING0);
|
||||
lcd_outdezNAtt(lcdNextPos, y, idx, att|LEFT, 2);
|
||||
}
|
||||
|
||||
void putsMixerSource(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
||||
{
|
||||
if (idx < MIXSRC_THR)
|
||||
lcd_putsiAtt(x, y, STR_VSRCRAW, idx, att);
|
||||
lcdDrawTextAtIndex(x, y, STR_VSRCRAW, idx, att);
|
||||
else if (idx < MIXSRC_SW1)
|
||||
putsSwitches(x, y, idx-MIXSRC_THR+1+3*(1), att);
|
||||
else if (idx <= MIXSRC_LAST_LOGICAL_SWITCH)
|
||||
|
@ -678,24 +678,24 @@ void putsMixerSource(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
|||
putsStrIdx(x, y, STR_GV, idx-MIXSRC_GVAR1+1, att);
|
||||
#endif
|
||||
else if (idx < MIXSRC_FIRST_TELEM) {
|
||||
lcd_putsiAtt(x, y, STR_VSRCRAW, idx-MIXSRC_Rud+1-(MIXSRC_SW1-MIXSRC_THR)-NUM_LOGICAL_SWITCH-NUM_TRAINER-NUM_CHNOUT-MAX_GVARS, att);
|
||||
lcdDrawTextAtIndex(x, y, STR_VSRCRAW, idx-MIXSRC_Rud+1-(MIXSRC_SW1-MIXSRC_THR)-NUM_LOGICAL_SWITCH-NUM_TRAINER-NUM_CHNOUT-MAX_GVARS, att);
|
||||
}
|
||||
#if defined(CPUARM)
|
||||
else {
|
||||
idx -= MIXSRC_FIRST_TELEM;
|
||||
div_t qr = div(idx, 3);
|
||||
lcd_putsnAtt(x, y, g_model.telemetrySensors[qr.quot].label, ZLEN(g_model.telemetrySensors[qr.quot].label), ZCHAR|att);
|
||||
lcdDrawTextWithLen(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);
|
||||
}
|
||||
#else
|
||||
else
|
||||
lcd_putsiAtt(x, y, STR_VTELEMCHNS, idx-MIXSRC_FIRST_TELEM+1, att);
|
||||
lcdDrawTextAtIndex(x, y, STR_VTELEMCHNS, idx-MIXSRC_FIRST_TELEM+1, att);
|
||||
#endif
|
||||
}
|
||||
|
||||
void putsChnLetter(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
||||
{
|
||||
lcd_putsiAtt(x, y, STR_RETA123, idx-1, att);
|
||||
lcdDrawTextAtIndex(x, y, STR_RETA123, idx-1, att);
|
||||
}
|
||||
|
||||
void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att)
|
||||
|
@ -706,14 +706,14 @@ void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att)
|
|||
putsStrIdx(x, y, STR_MODEL, id+1, att|LEADING0);
|
||||
}
|
||||
else {
|
||||
lcd_putsnAtt(x, y, name, sizeof(g_model.header.name), ZCHAR|att);
|
||||
lcdDrawTextWithLen(x, y, name, sizeof(g_model.header.name), ZCHAR|att);
|
||||
}
|
||||
}
|
||||
|
||||
void putsSwitches(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
||||
{
|
||||
if (idx == SWSRC_OFF)
|
||||
return lcd_putsiAtt(x, y, STR_OFFON, 0, att);
|
||||
return lcdDrawTextAtIndex(x, y, STR_OFFON, 0, att);
|
||||
if (idx < 0) {
|
||||
lcdDrawChar(x-2, y, '!', att);
|
||||
idx = -idx;
|
||||
|
@ -723,13 +723,13 @@ void putsSwitches(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
|||
return putsStrIdx(x, y, STR_FP, idx-SWSRC_FIRST_FLIGHT_MODE, att);
|
||||
}
|
||||
#endif
|
||||
return lcd_putsiAtt(x, y, STR_VSWITCHES, idx, att);
|
||||
return lcdDrawTextAtIndex(x, y, STR_VSWITCHES, idx, att);
|
||||
}
|
||||
|
||||
#if defined(FLIGHT_MODES)
|
||||
void putsFlightMode(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
||||
{
|
||||
if (idx==0) { lcd_putsiAtt(x, y, STR_MMMINV, 0, att); return; }
|
||||
if (idx==0) { lcdDrawTextAtIndex(x, y, STR_MMMINV, 0, att); return; }
|
||||
if (idx < 0) { lcdDrawChar(x-2, y, '!', att); idx = -idx; }
|
||||
if (att & CONDENSED)
|
||||
lcd_outdezNAtt(x+FW*1, y, idx-1, (att & ~CONDENSED), 1);
|
||||
|
@ -745,7 +745,7 @@ void putsCurve(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
|||
idx = -idx+CURVE_BASE-1;
|
||||
}
|
||||
if (idx < CURVE_BASE)
|
||||
lcd_putsiAtt(x, y, STR_VCURVEFUNC, idx, att);
|
||||
lcdDrawTextAtIndex(x, y, STR_VCURVEFUNC, idx, att);
|
||||
else
|
||||
putsStrIdx(x, y, STR_CV, idx-CURVE_BASE+1, att);
|
||||
}
|
||||
|
@ -754,7 +754,7 @@ void putsTimerMode(coord_t x, coord_t y, int8_t mode, LcdFlags att)
|
|||
{
|
||||
if (mode >= 0) {
|
||||
if (mode < TMRMODE_COUNT)
|
||||
return lcd_putsiAtt(x, y, STR_VTMRMODES, mode, att);
|
||||
return lcdDrawTextAtIndex(x, y, STR_VTMRMODES, mode, att);
|
||||
else
|
||||
mode -= (TMRMODE_COUNT-1);
|
||||
}
|
||||
|
@ -808,7 +808,7 @@ void putsValueWithUnit(coord_t x, coord_t y, lcdint_t val, uint8_t unit, LcdFlag
|
|||
// convertUnit(val, unit);
|
||||
lcd_outdezAtt(x, y, val, att & (~NO_UNIT));
|
||||
if (!(att & NO_UNIT) && unit != UNIT_RAW) {
|
||||
lcd_putsiAtt(lcdLastPos/*+1*/, y, STR_VTELEMUNIT, unit, 0);
|
||||
lcdDrawTextAtIndex(lcdLastPos/*+1*/, y, STR_VTELEMUNIT, unit, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -931,7 +931,7 @@ void putsValueWithUnit(coord_t x, coord_t y, lcdint_t val, uint8_t unit, LcdFlag
|
|||
convertUnit(val, unit);
|
||||
lcd_outdezAtt(x, y, val, att & (~NO_UNIT));
|
||||
if (!(att & NO_UNIT) && unit != UNIT_RAW) {
|
||||
lcd_putsiAtt(lcdLastPos/*+1*/, y, STR_VTELEMUNIT, unit, 0);
|
||||
lcdDrawTextAtIndex(lcdLastPos/*+1*/, y, STR_VTELEMUNIT, unit, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -164,9 +164,9 @@ typedef const char pm_char;
|
|||
|
||||
void lcd_putc(coord_t x, coord_t y, const unsigned char c);
|
||||
void lcdDrawChar(coord_t x, coord_t y, const unsigned char c, LcdFlags flags);
|
||||
void lcd_putsAtt(coord_t x, coord_t y, const pm_char * s, LcdFlags flags);
|
||||
void lcd_putsiAtt(coord_t x, coord_t y, const pm_char * s,uint8_t idx, LcdFlags flags);
|
||||
void lcd_putsnAtt(coord_t x, coord_t y, const pm_char * s,unsigned char len, LcdFlags flags);
|
||||
void lcdDrawText(coord_t x, coord_t y, const pm_char * s, LcdFlags flags);
|
||||
void lcdDrawTextAtIndex(coord_t x, coord_t y, const pm_char * s,uint8_t idx, LcdFlags flags);
|
||||
void lcdDrawTextWithLen(coord_t x, coord_t y, const pm_char * s,unsigned char len, LcdFlags flags);
|
||||
void lcd_puts(coord_t x, coord_t y, const pm_char * s);
|
||||
void lcd_putsn(coord_t x, coord_t y, const pm_char * s, unsigned char len);
|
||||
void lcd_putsLeft(coord_t y, const pm_char * s);
|
||||
|
|
|
@ -75,7 +75,7 @@ void menuCommonCalib(uint8_t event)
|
|||
|
||||
case 1:
|
||||
// SET MIDPOINT
|
||||
lcd_putsAtt(0*FW, MENU_HEADER_HEIGHT+FH, STR_SETMIDPOINT, INVERS);
|
||||
lcdDrawText(0*FW, MENU_HEADER_HEIGHT+FH, STR_SETMIDPOINT, INVERS);
|
||||
lcd_putsLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUWHENDONE);
|
||||
|
||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
||||
|
@ -88,7 +88,7 @@ void menuCommonCalib(uint8_t event)
|
|||
case 2:
|
||||
// MOVE STICKS/POTS
|
||||
STICK_SCROLL_DISABLE();
|
||||
lcd_putsAtt(0*FW, MENU_HEADER_HEIGHT+FH, STR_MOVESTICKSPOTS, INVERS);
|
||||
lcdDrawText(0*FW, MENU_HEADER_HEIGHT+FH, STR_MOVESTICKSPOTS, INVERS);
|
||||
lcd_putsLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUWHENDONE);
|
||||
|
||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
||||
|
|
|
@ -59,7 +59,7 @@ void menuGeneralDiagKeys(uint8_t event)
|
|||
|
||||
if (i<6) {
|
||||
y = i*FH+MENU_HEADER_HEIGHT+FH;
|
||||
lcd_putsiAtt(0, y, STR_VKEYS, (5-i), 0);
|
||||
lcdDrawTextAtIndex(0, y, STR_VKEYS, (5-i), 0);
|
||||
displayKeyState(5*FW+2, y, (EnumKeys)(KEY_MENU+(5-i)));
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ void menuGeneralDiagKeys(uint8_t event)
|
|||
#if defined(ROTARY_ENCODERS) || defined(ROTARY_ENCODER_NAVIGATION)
|
||||
for(uint8_t i=0; i<DIM(g_rotenc); i++) {
|
||||
coord_t y = MENU_HEADER_HEIGHT /* ??? + 1 ??? */ + i*FH;
|
||||
lcd_putsiAtt(14*FW, y, STR_VRENCODERS, i, 0);
|
||||
lcdDrawTextAtIndex(14*FW, y, STR_VRENCODERS, i, 0);
|
||||
lcd_outdezNAtt(18*FW, y, g_rotenc[i], LEFT|(switchState((EnumKeys)(BTN_REa+i)) ? INVERS : 0));
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -75,7 +75,7 @@ void menuGeneralHardware(uint8_t event)
|
|||
case ITEM_SETUP_HW_STICK_RV_GAIN:
|
||||
case ITEM_SETUP_HW_STICK_RH_GAIN:
|
||||
{
|
||||
lcd_putsiAtt(INDENT_WIDTH, y, PSTR("\002LVLHRVRH"), k-ITEM_SETUP_HW_STICK_LV_GAIN, 0);
|
||||
lcdDrawTextAtIndex(INDENT_WIDTH, y, PSTR("\002LVLHRVRH"), k-ITEM_SETUP_HW_STICK_LV_GAIN, 0);
|
||||
lcd_puts(INDENT_WIDTH+3*FW, y, PSTR("Gain"));
|
||||
uint8_t mask = (1<<(k-ITEM_SETUP_HW_STICK_LV_GAIN));
|
||||
uint8_t val = (g_eeGeneral.sticksGain & mask ? 1 : 0);
|
||||
|
|
|
@ -292,7 +292,7 @@ void menuGeneralSdManager(uint8_t _event)
|
|||
uint8_t attr = (m_posVert-1-s_pgOfs == i ? BSS|INVERS : BSS);
|
||||
if (reusableBuffer.sdmanager.lines[i][0]) {
|
||||
if (!reusableBuffer.sdmanager.lines[i][SD_SCREEN_FILE_LENGTH+1]) { lcdDrawChar(0, y, '[', attr); }
|
||||
lcd_putsAtt(lcdNextPos, y, reusableBuffer.sdmanager.lines[i], attr);
|
||||
lcdDrawText(lcdNextPos, y, reusableBuffer.sdmanager.lines[i], attr);
|
||||
if (!reusableBuffer.sdmanager.lines[i][SD_SCREEN_FILE_LENGTH+1]) { lcdDrawChar(lcdNextPos, y, ']', attr); }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ const pm_uchar sticks[] PROGMEM = {
|
|||
#if !defined(CPUM64)
|
||||
#define SLIDER_5POS(y, value, label, event, attr) { \
|
||||
int8_t tmp = value; \
|
||||
displaySlider(RADIO_SETUP_2ND_COLUMN, y, 2+tmp, 4, attr); \
|
||||
drawSlider(RADIO_SETUP_2ND_COLUMN, y, 2+tmp, 4, attr); \
|
||||
value = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, label, NULL, tmp, -2, +2, attr, event); \
|
||||
}
|
||||
#elif defined(GRAPHICS)
|
||||
|
@ -270,7 +270,7 @@ void menuGeneralSetup(uint8_t event)
|
|||
{
|
||||
lcd_putsLeft(y, STR_SPEAKER_VOLUME);
|
||||
uint8_t b = g_eeGeneral.speakerVolume+VOLUME_LEVEL_DEF;
|
||||
displaySlider(RADIO_SETUP_2ND_COLUMN, y, b, VOLUME_LEVEL_MAX, attr);
|
||||
drawSlider(RADIO_SETUP_2ND_COLUMN, y, b, VOLUME_LEVEL_MAX, attr);
|
||||
if (attr) {
|
||||
CHECK_INCDEC_GENVAR(event, b, 0, VOLUME_LEVEL_MAX);
|
||||
if (checkIncDec_Ret) {
|
||||
|
@ -306,7 +306,7 @@ void menuGeneralSetup(uint8_t event)
|
|||
#if defined(CPUARM)
|
||||
lcdDrawChar(RADIO_SETUP_2ND_COLUMN, y, '+', attr);
|
||||
lcd_outdezAtt(RADIO_SETUP_2ND_COLUMN+FW, y, g_eeGeneral.speakerPitch*15, attr|LEFT);
|
||||
lcd_putsAtt(lcdLastPos, y, "Hz", attr);
|
||||
lcdDrawText(lcdLastPos, y, "Hz", attr);
|
||||
#else
|
||||
lcd_outdezAtt(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.speakerPitch, attr|LEFT);
|
||||
#endif
|
||||
|
@ -326,19 +326,19 @@ void menuGeneralSetup(uint8_t event)
|
|||
case ITEM_SETUP_VARIO_PITCH:
|
||||
lcd_putsLeft(y, STR_PITCH_AT_ZERO);
|
||||
lcd_outdezAtt(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10), attr|LEFT);
|
||||
lcd_putsAtt(lcdLastPos, y, "Hz", attr);
|
||||
lcdDrawText(lcdLastPos, y, "Hz", attr);
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioPitch, -40, 40);
|
||||
break;
|
||||
case ITEM_SETUP_VARIO_RANGE:
|
||||
lcd_putsLeft(y, STR_PITCH_AT_MAX);
|
||||
lcd_outdezAtt(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10)+VARIO_FREQUENCY_RANGE+(g_eeGeneral.varioRange*10), attr|LEFT);
|
||||
lcd_putsAtt(lcdLastPos, y, "Hz", attr);
|
||||
lcdDrawText(lcdLastPos, y, "Hz", attr);
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRange, -80, 80);
|
||||
break;
|
||||
case ITEM_SETUP_VARIO_REPEAT:
|
||||
lcd_putsLeft(y, STR_REPEAT_AT_ZERO);
|
||||
lcd_outdezAtt(RADIO_SETUP_2ND_COLUMN, y, VARIO_REPEAT_ZERO+(g_eeGeneral.varioRepeat*10), attr|LEFT);
|
||||
lcd_putsAtt(lcdLastPos, y, STR_MS, attr);
|
||||
lcdDrawText(lcdLastPos, y, STR_MS, attr);
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRepeat, -30, 50);
|
||||
break;
|
||||
#endif
|
||||
|
@ -501,7 +501,7 @@ void menuGeneralSetup(uint8_t event)
|
|||
#if defined(CPUARM)
|
||||
case ITEM_SETUP_LANGUAGE:
|
||||
lcd_putsLeft(y, STR_VOICELANG);
|
||||
lcd_putsAtt(RADIO_SETUP_2ND_COLUMN, y, currentLanguagePack->name, attr);
|
||||
lcdDrawText(RADIO_SETUP_2ND_COLUMN, y, currentLanguagePack->name, attr);
|
||||
if (attr) {
|
||||
currentLanguagePackIdx = checkIncDec(event, currentLanguagePackIdx, 0, DIM(languagePacks)-2, EE_GENERAL);
|
||||
if (checkIncDec_Ret) {
|
||||
|
@ -538,7 +538,7 @@ void menuGeneralSetup(uint8_t event)
|
|||
case ITEM_SETUP_SWITCHES_DELAY:
|
||||
lcd_putsLeft(y, STR_SWITCHES_DELAY);
|
||||
lcd_outdezAtt(RADIO_SETUP_2ND_COLUMN, y, 10*SWITCHES_DELAY(), attr|LEFT);
|
||||
lcd_putsAtt(lcdLastPos, y, STR_MS, attr);
|
||||
lcdDrawText(lcdLastPos, y, STR_MS, attr);
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.switchesDelay, -15, +15);
|
||||
break;
|
||||
#endif
|
||||
|
|
|
@ -68,7 +68,7 @@ void menuGeneralTrainer(uint8_t event)
|
|||
|
||||
switch(j) {
|
||||
case 0:
|
||||
lcd_putsiAtt(4*FW, y, STR_TRNMODE, td->mode, attr);
|
||||
lcdDrawTextAtIndex(4*FW, y, STR_TRNMODE, td->mode, attr);
|
||||
if (attr&BLINK) CHECK_INCDEC_GENVAR(event, td->mode, 0, 2);
|
||||
break;
|
||||
|
||||
|
@ -78,7 +78,7 @@ void menuGeneralTrainer(uint8_t event)
|
|||
break;
|
||||
|
||||
case 2:
|
||||
lcd_putsiAtt(12*FW, y, STR_TRNCHN, td->srcChn, attr);
|
||||
lcdDrawTextAtIndex(12*FW, y, STR_TRNCHN, td->srcChn, attr);
|
||||
if (attr&BLINK) CHECK_INCDEC_GENVAR(event, td->srcChn, 0, 3);
|
||||
break;
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ void menuGeneralTrainer(uint8_t event)
|
|||
|
||||
attr = (m_posVert==6) ? INVERS : 0;
|
||||
if (attr) s_editMode = 0;
|
||||
lcd_putsAtt(0*FW, MENU_HEADER_HEIGHT+1+6*FH, STR_CAL, attr);
|
||||
lcdDrawText(0*FW, MENU_HEADER_HEIGHT+1+6*FH, STR_CAL, attr);
|
||||
for (uint8_t i=0; i<4; i++) {
|
||||
uint8_t x = (i*TRAINER_CALIB_POS+16)*FW/2;
|
||||
#if defined (PPM_UNIT_PERCENT_PREC1)
|
||||
|
|
|
@ -142,7 +142,7 @@ void editName(coord_t x, coord_t y, char *name, uint8_t size, uint8_t event, uin
|
|||
mode = FIXEDWIDTH;
|
||||
}
|
||||
|
||||
lcd_putsnAtt(x, y, name, size, ZCHAR | mode);
|
||||
lcdDrawTextWithLen(x, y, name, size, ZCHAR | mode);
|
||||
|
||||
if (active) {
|
||||
uint8_t cur = editNameCursorPos;
|
||||
|
|
|
@ -189,7 +189,7 @@ void menuModelCurveOne(uint8_t event)
|
|||
lcd_putsLeft(7*FH, STR_TYPE);
|
||||
uint8_t attr = (s_editMode <= 0 ? INVERS : 0);
|
||||
lcd_outdezAtt(5*FW-2, 7*FH, crv.points, LEFT|attr);
|
||||
lcd_putsAtt(lcdLastPos, 7*FH, crv.custom ? PSTR("pt'") : PSTR("pt"), attr);
|
||||
lcdDrawText(lcdLastPos, 7*FH, crv.custom ? PSTR("pt'") : PSTR("pt"), attr);
|
||||
|
||||
DrawCurve();
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
|||
|
||||
case 1:
|
||||
if (CFN_SWITCH(cfn)) {
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_2ND_COLUMN, y, STR_VFSWFUNC, func, attr);
|
||||
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_2ND_COLUMN, y, STR_VFSWFUNC, func, attr);
|
||||
if (active) {
|
||||
#if defined(CPUARM)
|
||||
CFN_FUNC(cfn) = checkIncDec(event, CFN_FUNC(cfn), 0, FUNC_MAX-1, eeFlags, isAssignableFunctionAvailable);
|
||||
|
@ -167,7 +167,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
|||
#if defined(CPUARM)
|
||||
else if (func == FUNC_SET_TIMER) {
|
||||
maxParam = MAX_TIMERS-1;
|
||||
lcd_putsiAtt(lcdNextPos, y, STR_VFSWRESET, CFN_TIMER_INDEX(cfn), attr);
|
||||
lcdDrawTextAtIndex(lcdNextPos, y, STR_VFSWRESET, CFN_TIMER_INDEX(cfn), attr);
|
||||
if (active) CFN_TIMER_INDEX(cfn) = checkIncDec(event, CFN_TIMER_INDEX(cfn), 0, maxParam, eeFlags);
|
||||
break;
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
|||
#endif
|
||||
if (func == FUNC_RESET) {
|
||||
val_max = FUNC_RESET_PARAM_LAST;
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_VFSWRESET, CFN_PARAM(cfn), attr);
|
||||
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_VFSWRESET, CFN_PARAM(cfn), attr);
|
||||
}
|
||||
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
||||
else if (func == FUNC_OVERRIDE_CHANNEL) {
|
||||
|
@ -206,7 +206,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
|||
#if defined(CPUARM)
|
||||
else if (func >= FUNC_SET_FAILSAFE && func <= FUNC_BIND) {
|
||||
val_max = NUM_MODULES-1;
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, "\004Int.Ext.", CFN_PARAM(cfn), attr);
|
||||
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, "\004Int.Ext.", CFN_PARAM(cfn), attr);
|
||||
}
|
||||
#endif
|
||||
#if defined(CPUARM)
|
||||
|
@ -218,7 +218,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
|||
#if defined(AUDIO)
|
||||
else if (func == FUNC_PLAY_SOUND) {
|
||||
val_max = AU_FRSKY_LAST-AU_FRSKY_FIRST-1;
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_FUNCSOUNDS, val_displayed, attr);
|
||||
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_FUNCSOUNDS, val_displayed, attr);
|
||||
}
|
||||
#endif
|
||||
#if defined(HAPTIC)
|
||||
|
@ -231,9 +231,9 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
|||
else if (func == FUNC_PLAY_TRACK || func == FUNC_BACKGND_MUSIC || func == FUNC_PLAY_SCRIPT) {
|
||||
coord_t x = (func == FUNC_PLAY_TRACK ? MODEL_CUSTOM_FUNC_2ND_COLUMN + FW + FW*strlen(TR_PLAY_TRACK) : MODEL_CUSTOM_FUNC_3RD_COLUMN);
|
||||
if (ZEXIST(cfn->play.name))
|
||||
lcd_putsnAtt(x, y, cfn->play.name, sizeof(cfn->play.name), attr);
|
||||
lcdDrawTextWithLen(x, y, cfn->play.name, sizeof(cfn->play.name), attr);
|
||||
else
|
||||
lcd_putsiAtt(x, y, STR_VCSWFUNC, 0, attr);
|
||||
lcdDrawTextAtIndex(x, y, STR_VCSWFUNC, 0, attr);
|
||||
if (active && event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
s_editMode = 0;
|
||||
char directory[256];
|
||||
|
@ -304,7 +304,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
|||
lcd_putc(lcdLastPos, y, 's');
|
||||
}
|
||||
else {
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_MMMINV, 0, attr);
|
||||
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_MMMINV, 0, attr);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -328,7 +328,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
|||
break;
|
||||
default: // FUNC_ADJUST_GVAR_INC
|
||||
val_max = 1;
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, PSTR("\003-=1+=1"), val_displayed, attr);
|
||||
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, PSTR("\003-=1+=1"), val_displayed, attr);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -369,7 +369,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
|||
}
|
||||
#if defined(CPUARM)
|
||||
else if (CFN_PLAY_REPEAT(cfn) == CFN_PLAY_REPEAT_NOSTART) {
|
||||
lcd_putsAtt(MODEL_CUSTOM_FUNC_4TH_COLUMN_ONOFF, y, "!-", attr);
|
||||
lcdDrawText(MODEL_CUSTOM_FUNC_4TH_COLUMN_ONOFF, y, "!-", attr);
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
|
|
|
@ -177,7 +177,7 @@ void menuModelPhaseOne(uint8_t event)
|
|||
putsFlightMode(11*FW, y, p+1, posHorz==1 ? attr : 0);
|
||||
}
|
||||
else {
|
||||
lcd_putsAtt(11*FW, y, STR_OWN, posHorz==1 ? attr : 0);
|
||||
lcdDrawText(11*FW, y, STR_OWN, posHorz==1 ? attr : 0);
|
||||
}
|
||||
if (attr && s_currIdx>0 && posHorz==1 && (editMode>0 || p1valdiff)) {
|
||||
if (v < GVAR_MAX) v = GVAR_MAX;
|
||||
|
@ -253,7 +253,7 @@ void menuModelFlightModesAll(uint8_t event)
|
|||
FlightModeData *p = flightModeAddress(i);
|
||||
putsFlightMode(0, y, i+1, att|(getFlightMode()==i ? BOLD : 0));
|
||||
|
||||
lcd_putsnAtt(4*FW+NAME_OFS, y, p->name, sizeof(p->name), ZCHAR);
|
||||
lcdDrawTextWithLen(4*FW+NAME_OFS, y, p->name, sizeof(p->name), ZCHAR);
|
||||
if (i == 0) {
|
||||
lcd_puts((5+LEN_FLIGHT_MODE_NAME)*FW+SWITCH_OFS, y, STR_DEFAULT);
|
||||
}
|
||||
|
|
|
@ -327,7 +327,7 @@ void menuModelExpoOne(uint8_t event)
|
|||
ed->curveParam = GVAR_MENU_ITEM(EXPO_ONE_2ND_COLUMN, y, ed->curveParam, -100, 100, attr, 0, event);
|
||||
}
|
||||
else {
|
||||
lcd_putsAtt(EXPO_ONE_2ND_COLUMN-3*FW, y, STR_NA, attr);
|
||||
lcdDrawText(EXPO_ONE_2ND_COLUMN-3*FW, y, STR_NA, attr);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -346,7 +346,7 @@ void menuModelExpoOne(uint8_t event)
|
|||
}
|
||||
}
|
||||
else {
|
||||
lcd_putsAtt(EXPO_ONE_2ND_COLUMN-3*FW, y, STR_NA, attr);
|
||||
lcdDrawText(EXPO_ONE_2ND_COLUMN-3*FW, y, STR_NA, attr);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
@ -541,7 +541,7 @@ void menuModelMixOne(uint8_t event)
|
|||
uint8_t not_stick = (md2->srcRaw > NUM_STICKS);
|
||||
int8_t carryTrim = -md2->carryTrim;
|
||||
lcd_putsColumnLeft(COLUMN_X, y, STR_TRIM);
|
||||
lcd_putsiAtt((not_stick ? COLUMN_X+MIXES_2ND_COLUMN : COLUMN_X+6*FW-3), y, STR_VMIXTRIMS, (not_stick && carryTrim == 0) ? 0 : carryTrim+1, m_posHorz==0 ? attr : 0);
|
||||
lcdDrawTextAtIndex((not_stick ? COLUMN_X+MIXES_2ND_COLUMN : COLUMN_X+6*FW-3), y, STR_VMIXTRIMS, (not_stick && carryTrim == 0) ? 0 : carryTrim+1, m_posHorz==0 ? attr : 0);
|
||||
if (attr && m_posHorz==0 && (not_stick || editMode>0)) md2->carryTrim = -checkIncDecModel(event, carryTrim, not_stick ? TRIM_ON : -TRIM_OFF, -TRIM_AIL);
|
||||
if (!not_stick) {
|
||||
lcd_puts(COLUMN_X+MIXES_2ND_COLUMN, y, STR_DREX);
|
||||
|
@ -574,7 +574,7 @@ void menuModelMixOne(uint8_t event)
|
|||
}
|
||||
}
|
||||
else {
|
||||
lcd_putsAtt(COLUMN_X+MIXES_2ND_COLUMN, y, PSTR("Diff"), m_posHorz==0 ? attr : 0);
|
||||
lcdDrawText(COLUMN_X+MIXES_2ND_COLUMN, y, PSTR("Diff"), m_posHorz==0 ? attr : 0);
|
||||
md2->curveParam = GVAR_MENU_ITEM(COLUMN_X+MIXES_2ND_COLUMN+5*FW, y, curveParam, -100, 100, LEFT|(m_posHorz==1 ? attr : 0), 0, editMode>0 ? event : 0);
|
||||
if (attr && editMode>0 && m_posHorz==0) {
|
||||
int8_t tmp = 0;
|
||||
|
@ -601,7 +601,7 @@ void menuModelMixOne(uint8_t event)
|
|||
if (md2->mixWarn)
|
||||
lcd_outdezAtt(COLUMN_X+MIXES_2ND_COLUMN, y, md2->mixWarn, attr|LEFT);
|
||||
else
|
||||
lcd_putsAtt(COLUMN_X+MIXES_2ND_COLUMN, y, STR_OFF, attr);
|
||||
lcdDrawText(COLUMN_X+MIXES_2ND_COLUMN, y, STR_OFF, attr);
|
||||
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, md2->mixWarn, 3);
|
||||
break;
|
||||
case MIX_FIELD_MLTPX:
|
||||
|
@ -708,7 +708,7 @@ void displayMixInfos(coord_t y, MixData *md)
|
|||
void displayMixLine(coord_t y, MixData *md)
|
||||
{
|
||||
if (md->name[0]) {
|
||||
lcd_putsnAtt(EXPO_LINE_NAME_POS, y, md->name, sizeof(md->name), ZCHAR);
|
||||
lcdDrawTextWithLen(EXPO_LINE_NAME_POS, y, md->name, sizeof(md->name), ZCHAR);
|
||||
}
|
||||
else {
|
||||
displayMixInfos(y, md);
|
||||
|
@ -734,7 +734,7 @@ void displayExpoLine(coord_t y, ExpoData *ed)
|
|||
displayExpoInfos(y, ed);
|
||||
|
||||
if (ed->name[0]) {
|
||||
lcd_putsnAtt(EXPO_LINE_NAME_POS, y, ed->name, sizeof(ed->name), ZCHAR);
|
||||
lcdDrawTextWithLen(EXPO_LINE_NAME_POS, y, ed->name, sizeof(ed->name), ZCHAR);
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
@ -867,29 +867,29 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
|||
case EVT_ROTARY_LEFT:
|
||||
case EVT_ROTARY_RIGHT:
|
||||
#endif
|
||||
case EVT_KEY_FIRST(KEY_MOVE_UP):
|
||||
case EVT_KEY_REPT(KEY_MOVE_UP):
|
||||
case EVT_KEY_FIRST(KEY_MOVE_DOWN):
|
||||
case EVT_KEY_REPT(KEY_MOVE_DOWN):
|
||||
case EVT_KEY_FIRST(KEY_UP):
|
||||
case EVT_KEY_REPT(KEY_UP):
|
||||
case EVT_KEY_FIRST(KEY_DOWN):
|
||||
case EVT_KEY_REPT(KEY_DOWN):
|
||||
if (s_copyMode) {
|
||||
uint8_t key = (event & 0x1f);
|
||||
uint8_t next_ofs = ((IS_ROTARY_UP(event) || key==KEY_MOVE_UP) ? s_copyTgtOfs - 1 : s_copyTgtOfs + 1);
|
||||
uint8_t next_ofs = ((IS_ROTARY_LEFT(event) || key==KEY_UP) ? s_copyTgtOfs - 1 : s_copyTgtOfs + 1);
|
||||
|
||||
if (s_copyTgtOfs==0 && s_copyMode==COPY_MODE) {
|
||||
// insert a mix on the same channel (just above / just below)
|
||||
if (reachExpoMixCountLimit(expo)) break;
|
||||
copyExpoMix(expo, s_currIdx);
|
||||
if (IS_ROTARY_DOWN(event) || key==KEY_MOVE_DOWN) s_currIdx++;
|
||||
if (IS_ROTARY_RIGHT(event) || key==KEY_DOWN) s_currIdx++;
|
||||
else if (sub-s_pgOfs >= 6) s_pgOfs++;
|
||||
}
|
||||
else if (next_ofs==0 && s_copyMode==COPY_MODE) {
|
||||
// delete the mix
|
||||
deleteExpoMix(expo, s_currIdx);
|
||||
if (IS_ROTARY_UP(event) || key==KEY_MOVE_UP) s_currIdx--;
|
||||
if (IS_ROTARY_LEFT(event) || key==KEY_UP) s_currIdx--;
|
||||
}
|
||||
else {
|
||||
// only swap the mix with its neighbor
|
||||
if (!swapExpoMix(expo, s_currIdx, IS_ROTARY_UP(event) || key==KEY_MOVE_UP)) break;
|
||||
if (!swapExpoMix(expo, s_currIdx, IS_ROTARY_LEFT(event) || key==KEY_UP)) break;
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
|
||||
|
@ -945,7 +945,7 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
|||
}
|
||||
}
|
||||
else {
|
||||
if (mixCnt > 0) lcd_putsiAtt(FW, y, STR_VMLTPX2, md->mltpx, 0);
|
||||
if (mixCnt > 0) lcdDrawTextAtIndex(FW, y, STR_VMLTPX2, md->mltpx, 0);
|
||||
|
||||
putsMixerSource(MIX_LINE_SRC_POS, y, md->srcRaw, 0);
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ void menuModelLimits(uint8_t event)
|
|||
if (k==NUM_CHNOUT) {
|
||||
// last line available - add the "copy trim menu" line
|
||||
uint8_t attr = (sub==NUM_CHNOUT) ? INVERS : 0;
|
||||
lcd_putsAtt(CENTER_OFS, y, STR_TRIMS2OFFSETS, s_noHi ? 0 : attr);
|
||||
lcdDrawText(CENTER_OFS, y, STR_TRIMS2OFFSETS, s_noHi ? 0 : attr);
|
||||
if (attr) {
|
||||
s_editMode = 0;
|
||||
if (event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
|
@ -211,7 +211,7 @@ void menuModelLimits(uint8_t event)
|
|||
#if defined(PPM_CENTER_ADJUSTABLE)
|
||||
lcdDrawChar(LIMITS_REVERT_POS, y, revert ? 127 : 126, attr);
|
||||
#else
|
||||
lcd_putsiAtt(LIMITS_REVERT_POS, y, STR_MMMINV, revert, attr);
|
||||
lcdDrawTextAtIndex(LIMITS_REVERT_POS, y, STR_MMMINV, revert, attr);
|
||||
#endif
|
||||
if (active) {
|
||||
uint8_t revert_new = checkIncDecModel(event, revert, 0, 1);
|
||||
|
|
|
@ -77,9 +77,9 @@ void putsEdgeDelayParam(coord_t x, coord_t y, LogicalSwitchData *cs, uint8_t lat
|
|||
lcd_outdezAtt(x, y, lswTimerValue(cs->v2), LEFT|PREC1|lattr);
|
||||
lcd_putc(lcdLastPos, y, ':');
|
||||
if (cs->v3 < 0)
|
||||
lcd_putsAtt(lcdLastPos+3, y, "<<", rattr);
|
||||
lcdDrawText(lcdLastPos+3, y, "<<", rattr);
|
||||
else if (cs->v3 == 0)
|
||||
lcd_putsAtt(lcdLastPos+3, y, "--", rattr);
|
||||
lcdDrawText(lcdLastPos+3, y, "--", rattr);
|
||||
else
|
||||
lcd_outdezAtt(lcdLastPos+3, y, lswTimerValue(cs->v2+cs->v3), LEFT|PREC1|rattr);
|
||||
lcd_putc(lcdLastPos, y, ']');
|
||||
|
@ -114,7 +114,7 @@ void menuModelLogicalSwitchOne(uint8_t event)
|
|||
switch(i) {
|
||||
case LS_FIELD_FUNCTION:
|
||||
lcd_putsLeft(y, STR_FUNC);
|
||||
lcd_putsiAtt(CSWONE_2ND_COLUMN, y, STR_VCSWFUNC, cs->func, attr);
|
||||
lcdDrawTextAtIndex(CSWONE_2ND_COLUMN, y, STR_VCSWFUNC, cs->func, attr);
|
||||
if (attr) {
|
||||
cs->func = checkIncDec(event, cs->func, 0, LS_FUNC_MAX, EE_MODEL, isLogicalSwitchFunctionAvailable);
|
||||
uint8_t new_cstate = lswFamily(cs->func);
|
||||
|
@ -222,7 +222,7 @@ void menuModelLogicalSwitchOne(uint8_t event)
|
|||
if (cs->duration > 0)
|
||||
lcd_outdezAtt(CSWONE_2ND_COLUMN, y, cs->duration, attr|PREC1|LEFT);
|
||||
else
|
||||
lcd_putsiAtt(CSWONE_2ND_COLUMN, y, STR_MMMINV, 0, attr);
|
||||
lcdDrawTextAtIndex(CSWONE_2ND_COLUMN, y, STR_MMMINV, 0, attr);
|
||||
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, cs->duration, MAX_LS_DURATION);
|
||||
break;
|
||||
case LS_FIELD_DELAY:
|
||||
|
@ -230,7 +230,7 @@ void menuModelLogicalSwitchOne(uint8_t event)
|
|||
if (cs->delay > 0)
|
||||
lcd_outdezAtt(CSWONE_2ND_COLUMN, y, cs->delay, attr|PREC1|LEFT);
|
||||
else
|
||||
lcd_putsiAtt(CSWONE_2ND_COLUMN, y, STR_MMMINV, 0, attr);
|
||||
lcdDrawTextAtIndex(CSWONE_2ND_COLUMN, y, STR_MMMINV, 0, attr);
|
||||
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, cs->delay, MAX_LS_DELAY);
|
||||
break;
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ void menuModelLogicalSwitches(uint8_t event)
|
|||
|
||||
if (cs->func > 0) {
|
||||
// CSW func
|
||||
lcd_putsiAtt(CSW_1ST_COLUMN, y, STR_VCSWFUNC, cs->func, 0);
|
||||
lcdDrawTextAtIndex(CSW_1ST_COLUMN, y, STR_VCSWFUNC, cs->func, 0);
|
||||
|
||||
// CSW params
|
||||
uint8_t cstate = lswFamily(cs->func);
|
||||
|
@ -333,7 +333,7 @@ void menuModelLogicalSwitches(uint8_t event)
|
|||
putsSwitches(0, y, sw, (getSwitch(sw) ? BOLD : 0) | ((sub==k && CURSOR_ON_LINE()) ? INVERS : 0));
|
||||
|
||||
// CSW func
|
||||
lcd_putsiAtt(CSW_1ST_COLUMN, y, STR_VCSWFUNC, cs->func, horz==0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(CSW_1ST_COLUMN, y, STR_VCSWFUNC, cs->func, horz==0 ? attr : 0);
|
||||
|
||||
// CSW params
|
||||
uint8_t cstate = lswFamily(cs->func);
|
||||
|
@ -476,7 +476,7 @@ void menuModelLogicalSwitches(uint8_t event)
|
|||
if (cs->duration > 0)
|
||||
lcd_outdezAtt(CSW_5TH_COLUMN, y, cs->duration, (horz==LS_FIELD_DURATION ? attr : 0)|PREC1|LEFT);
|
||||
else
|
||||
lcd_putsiAtt(CSW_5TH_COLUMN, y, STR_MMMINV, 0, horz==LS_FIELD_DURATION ? attr : 0);
|
||||
lcdDrawTextAtIndex(CSW_5TH_COLUMN, y, STR_MMMINV, 0, horz==LS_FIELD_DURATION ? attr : 0);
|
||||
|
||||
// CSW delay
|
||||
if (cstate == LS_FAMILY_EDGE) {
|
||||
|
@ -489,7 +489,7 @@ void menuModelLogicalSwitches(uint8_t event)
|
|||
lcd_outdezAtt(CSW_6TH_COLUMN, y, cs->delay, (horz==LS_FIELD_DELAY ? attr : 0)|PREC1|LEFT);
|
||||
}
|
||||
else {
|
||||
lcd_putsiAtt(CSW_6TH_COLUMN, y, STR_MMMINV, 0, horz==LS_FIELD_DELAY ? attr : 0);
|
||||
lcdDrawTextAtIndex(CSW_6TH_COLUMN, y, STR_MMMINV, 0, horz==LS_FIELD_DELAY ? attr : 0);
|
||||
}
|
||||
|
||||
if (attr && horz == LS_FIELD_V3 && cstate != LS_FAMILY_EDGE) {
|
||||
|
|
|
@ -290,10 +290,10 @@ void menuModelSelect(uint8_t event)
|
|||
// no break
|
||||
#endif
|
||||
|
||||
case EVT_KEY_FIRST(KEY_MOVE_UP):
|
||||
case EVT_KEY_REPT(KEY_MOVE_UP):
|
||||
case EVT_KEY_FIRST(KEY_MOVE_DOWN):
|
||||
case EVT_KEY_REPT(KEY_MOVE_DOWN):
|
||||
case EVT_KEY_FIRST(KEY_UP):
|
||||
case EVT_KEY_REPT(KEY_UP):
|
||||
case EVT_KEY_FIRST(KEY_DOWN):
|
||||
case EVT_KEY_REPT(KEY_DOWN):
|
||||
if (s_copyMode) {
|
||||
int8_t next_ofs = s_copyTgtOfs + oldSub - m_posVert;
|
||||
if (next_ofs == MAX_MODELS || next_ofs == -MAX_MODELS)
|
||||
|
@ -302,7 +302,7 @@ void menuModelSelect(uint8_t event)
|
|||
if (s_copySrcRow < 0 && s_copyMode==COPY_MODE) {
|
||||
s_copySrcRow = oldSub;
|
||||
// find a hole (in the first empty slot above / below)
|
||||
sub = eeFindEmptyModel(s_copySrcRow, IS_ROTARY_DOWN(event) || event==EVT_KEY_FIRST(KEY_MOVE_DOWN));
|
||||
sub = eeFindEmptyModel(s_copySrcRow, IS_ROTARY_RIGHT(event) || event==EVT_KEY_FIRST(KEY_DOWN));
|
||||
if (sub < 0) {
|
||||
// no free room for duplicating the model
|
||||
AUDIO_ERROR();
|
||||
|
|
|
@ -327,7 +327,7 @@ void menuModelSetup(uint8_t event)
|
|||
ON_OFF_MENU_ITEM(g_model.extendedTrims, MODEL_SETUP_2ND_COLUMN, y, STR_ETRIMS, attr, event);
|
||||
#else
|
||||
ON_OFF_MENU_ITEM(g_model.extendedTrims, MODEL_SETUP_2ND_COLUMN, y, STR_ETRIMS, m_posHorz<=0 ? attr : 0, event==EVT_KEY_BREAK(KEY_ENTER) ? event : 0);
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+3*FW, y, STR_RESET_BTN, m_posHorz>0 && !s_noHi ? attr : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+3*FW, y, STR_RESET_BTN, m_posHorz>0 && !s_noHi ? attr : 0);
|
||||
if (attr && m_posHorz>0) {
|
||||
s_editMode = 0;
|
||||
if (event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
|
@ -453,7 +453,7 @@ void menuModelSetup(uint8_t event)
|
|||
}
|
||||
lcdDrawChar(MODEL_SETUP_2ND_COLUMN+i*FW, y, (swactive || (attr & BLINK)) ? c : '-', attr);
|
||||
#if !defined(CPUM64)
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+(NUM_SWITCHES*FW), y, PSTR("<]"), (m_posHorz == NUM_SWITCHES-1 && !s_noHi) ? line : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+(NUM_SWITCHES*FW), y, PSTR("<]"), (m_posHorz == NUM_SWITCHES-1 && !s_noHi) ? line : 0);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
@ -464,7 +464,7 @@ void menuModelSetup(uint8_t event)
|
|||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS; i++) {
|
||||
// TODO flash saving, \001 not needed in STR_RETA123
|
||||
coord_t x = MODEL_SETUP_2ND_COLUMN+i*FW;
|
||||
lcd_putsiAtt(x, y, STR_RETA123, i, ((m_posHorz==i) && attr) ? BLINK|INVERS : (((g_model.beepANACenter & ((BeepANACenter)1<<i)) || (attr && CURSOR_ON_LINE())) ? INVERS : 0 ) );
|
||||
lcdDrawTextAtIndex(x, y, STR_RETA123, i, ((m_posHorz==i) && attr) ? BLINK|INVERS : (((g_model.beepANACenter & ((BeepANACenter)1<<i)) || (attr && CURSOR_ON_LINE())) ? INVERS : 0 ) );
|
||||
}
|
||||
if (attr && CURSOR_ON_CELL) {
|
||||
if (event==EVT_KEY_BREAK(KEY_ENTER) || p1valdiff) {
|
||||
|
@ -498,11 +498,11 @@ void menuModelSetup(uint8_t event)
|
|||
|
||||
case ITEM_MODEL_EXTERNAL_MODULE_MODE:
|
||||
lcd_putsLeft(y, STR_MODE);
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, STR_TARANIS_PROTOCOLS, g_model.moduleData[EXTERNAL_MODULE].type, m_posHorz==0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_TARANIS_PROTOCOLS, g_model.moduleData[EXTERNAL_MODULE].type, m_posHorz==0 ? attr : 0);
|
||||
if (IS_MODULE_XJT(EXTERNAL_MODULE))
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN+5*FW, y, STR_XJT_PROTOCOLS, 1+g_model.moduleData[EXTERNAL_MODULE].rfProtocol, m_posHorz==1 ? attr : 0);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN+5*FW, y, STR_XJT_PROTOCOLS, 1+g_model.moduleData[EXTERNAL_MODULE].rfProtocol, m_posHorz==1 ? attr : 0);
|
||||
else if (IS_MODULE_DSM2(EXTERNAL_MODULE))
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN+5*FW, y, STR_DSM_PROTOCOLS, g_model.moduleData[EXTERNAL_MODULE].rfProtocol, m_posHorz==1 ? attr : 0);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN+5*FW, y, STR_DSM_PROTOCOLS, g_model.moduleData[EXTERNAL_MODULE].rfProtocol, m_posHorz==1 ? attr : 0);
|
||||
if (attr && (editMode>0 || p1valdiff)) {
|
||||
switch (m_posHorz) {
|
||||
case 0:
|
||||
|
@ -540,7 +540,7 @@ void menuModelSetup(uint8_t event)
|
|||
ModuleData & moduleData = g_model.moduleData[moduleIdx];
|
||||
lcd_putsLeft(y, STR_CHANNELRANGE);
|
||||
if ((int8_t)PORT_CHANNELS_ROWS(moduleIdx) >= 0) {
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN, y, STR_CH, m_posHorz==0 ? attr : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, STR_CH, m_posHorz==0 ? attr : 0);
|
||||
lcd_outdezAtt(lcdLastPos, y, moduleData.channelsStart+1, LEFT | (m_posHorz==0 ? attr : 0));
|
||||
lcd_putc(lcdLastPos, y, '-');
|
||||
lcd_outdezAtt(lcdLastPos + FW+1, y, moduleData.channelsStart+NUM_CHANNELS(moduleIdx), LEFT | (m_posHorz==1 ? attr : 0));
|
||||
|
@ -616,8 +616,8 @@ void menuModelSetup(uint8_t event)
|
|||
checkModelIdUnique(g_eeGeneral.currModel, moduleIdx);
|
||||
}
|
||||
}
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+xOffsetBind, y, STR_MODULE_BIND, l_posHorz==1 ? attr : 0);
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+MODEL_SETUP_RANGE_OFS+xOffsetBind, y, STR_MODULE_RANGE, l_posHorz==2 ? attr : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+xOffsetBind, y, STR_MODULE_BIND, l_posHorz==1 ? attr : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+MODEL_SETUP_RANGE_OFS+xOffsetBind, y, STR_MODULE_RANGE, l_posHorz==2 ? attr : 0);
|
||||
uint8_t newFlag = 0;
|
||||
if (attr && l_posHorz>0 && s_editMode>0) {
|
||||
if (l_posHorz == 1)
|
||||
|
@ -650,8 +650,8 @@ void menuModelSetup(uint8_t event)
|
|||
ModuleData & moduleData = g_model.moduleData[moduleIdx];
|
||||
lcd_putsLeft(y, TR_FAILSAFE);
|
||||
if (IS_MODULE_XJT(moduleIdx)) {
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, STR_VFAILSAFE, moduleData.failsafeMode, m_posHorz==0 ? attr : 0);
|
||||
if (moduleData.failsafeMode == FAILSAFE_CUSTOM) lcd_putsAtt(MODEL_SETUP_2ND_COLUMN + MODEL_SETUP_SET_FAILSAFE_OFS, y, STR_SET, m_posHorz==1 ? attr : 0);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VFAILSAFE, moduleData.failsafeMode, m_posHorz==0 ? attr : 0);
|
||||
if (moduleData.failsafeMode == FAILSAFE_CUSTOM) lcdDrawText(MODEL_SETUP_2ND_COLUMN + MODEL_SETUP_SET_FAILSAFE_OFS, y, STR_SET, m_posHorz==1 ? attr : 0);
|
||||
if (attr) {
|
||||
if (moduleData.failsafeMode != FAILSAFE_CUSTOM)
|
||||
m_posHorz = 0;
|
||||
|
@ -680,9 +680,9 @@ void menuModelSetup(uint8_t event)
|
|||
#if !defined(CPUARM)
|
||||
case ITEM_MODEL_PPM1_PROTOCOL:
|
||||
lcd_putsLeft(y, NO_INDENT(STR_PROTO));
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, STR_VPROTOS, protocol, m_posHorz<=0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VPROTOS, protocol, m_posHorz<=0 ? attr : 0);
|
||||
if (IS_PPM_PROTOCOL(protocol)) {
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN+7*FW, y, STR_NCHANNELS, g_model.ppmNCH+2, m_posHorz!=0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN+7*FW, y, STR_NCHANNELS, g_model.ppmNCH+2, m_posHorz!=0 ? attr : 0);
|
||||
}
|
||||
else if (m_posHorz>0 && attr) {
|
||||
MOVE_CURSOR_FROM_HERE();
|
||||
|
@ -704,8 +704,8 @@ void menuModelSetup(uint8_t event)
|
|||
#if 0
|
||||
case ITEM_MODEL_PPM2_PROTOCOL:
|
||||
lcd_putsLeft(y, PSTR("Port2"));
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, STR_VPROTOS, 0, 0);
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+4*FW+3, y, STR_CH, m_posHorz<=0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VPROTOS, 0, 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+4*FW+3, y, STR_CH, m_posHorz<=0 ? attr : 0);
|
||||
lcd_outdezAtt(lcdLastPos, y, g_model.moduleData[1].channelsStart+1, LEFT | (m_posHorz<=0 ? attr : 0));
|
||||
lcd_putc(lcdLastPos, y, '-');
|
||||
lcd_outdezAtt(lcdLastPos + FW+1, y, g_model.moduleData[1].channelsStart+8+g_model.moduleData[1].channelsCount, LEFT | (m_posHorz!=0 ? attr : 0));
|
||||
|
@ -781,7 +781,7 @@ void menuModelSetup(uint8_t event)
|
|||
}
|
||||
#if defined(PXX)
|
||||
if (protocol == PROTO_PXX) {
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+4*FW, y, STR_SYNCMENU, m_posHorz!=0 ? attr : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+4*FW, y, STR_SYNCMENU, m_posHorz!=0 ? attr : 0);
|
||||
uint8_t newFlag = 0;
|
||||
if (attr && m_posHorz>0 && editMode>0) {
|
||||
// send reset code
|
||||
|
@ -792,7 +792,7 @@ void menuModelSetup(uint8_t event)
|
|||
#endif
|
||||
#if defined(DSM2)
|
||||
if (IS_DSM2_PROTOCOL(protocol)) {
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+4*FW, y, STR_MODULE_RANGE, m_posHorz!=0 ? attr : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+4*FW, y, STR_MODULE_RANGE, m_posHorz!=0 ? attr : 0);
|
||||
moduleFlag[0] = (attr && m_posHorz>0 && editMode>0) ? MODULE_RANGECHECK : 0; // [MENU] key toggles range check mode
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -355,7 +355,7 @@ void menuModelSensor(uint8_t event)
|
|||
case SENSOR_FIELD_UNIT:
|
||||
lcd_putsLeft(y, "Unit");
|
||||
// TODO flash saving with selectMenuItem where I copied those 2 lines?
|
||||
lcd_putsiAtt(SENSOR_2ND_COLUMN, y, STR_VTELEMUNIT, sensor->unit, attr);
|
||||
lcdDrawTextAtIndex(SENSOR_2ND_COLUMN, y, STR_VTELEMUNIT, sensor->unit, attr);
|
||||
if (attr) {
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, sensor->unit, UNIT_MAX);
|
||||
if (checkIncDec_Ret) {
|
||||
|
@ -570,7 +570,7 @@ void menuModelTelemetry(uint8_t event)
|
|||
int index = k-ITEM_TELEMETRY_SENSOR1;
|
||||
lcd_outdezAtt(INDENT_WIDTH, y, index+1, LEFT|attr);
|
||||
lcdDrawChar(lcdLastPos, y, ':', attr);
|
||||
lcd_putsnAtt(3*FW, y, g_model.telemetrySensors[index].label, TELEM_LABEL_LEN, ZCHAR);
|
||||
lcdDrawTextWithLen(3*FW, y, g_model.telemetrySensors[index].label, TELEM_LABEL_LEN, ZCHAR);
|
||||
if (telemetryItems[index].isFresh()) {
|
||||
lcd_putc(16*FW, y, '*');
|
||||
}
|
||||
|
@ -583,7 +583,7 @@ void menuModelTelemetry(uint8_t event)
|
|||
if (isOld) lcd_putc(lcdLastPos, y, ']');
|
||||
}
|
||||
else {
|
||||
lcd_putsAtt(TELEM_COL2, y, "---", 0); // TODO shortcut
|
||||
lcdDrawText(TELEM_COL2, y, "---", 0); // TODO shortcut
|
||||
}
|
||||
if (attr) {
|
||||
s_editMode = 0;
|
||||
|
@ -616,7 +616,7 @@ void menuModelTelemetry(uint8_t event)
|
|||
break;
|
||||
|
||||
case ITEM_TELEMETRY_DISCOVER_SENSORS:
|
||||
lcd_putsAtt(0, y, allowNewSensors ? STR_STOP_DISCOVER_SENSORS : STR_DISCOVER_SENSORS, attr);
|
||||
lcdDrawText(0, y, allowNewSensors ? STR_STOP_DISCOVER_SENSORS : STR_DISCOVER_SENSORS, attr);
|
||||
if (attr && event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
s_editMode = 0;
|
||||
allowNewSensors = !allowNewSensors;
|
||||
|
@ -624,7 +624,7 @@ void menuModelTelemetry(uint8_t event)
|
|||
break;
|
||||
|
||||
case ITEM_TELEMETRY_NEW_SENSOR:
|
||||
lcd_putsAtt(0, y, STR_TELEMETRY_NEWSENSOR, attr);
|
||||
lcdDrawText(0, y, STR_TELEMETRY_NEWSENSOR, attr);
|
||||
if (attr && event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
s_editMode = 0;
|
||||
int res = availableTelemetryIndex();
|
||||
|
@ -639,7 +639,7 @@ void menuModelTelemetry(uint8_t event)
|
|||
break;
|
||||
|
||||
case ITEM_TELEMETRY_DELETE_ALL_SENSORS:
|
||||
lcd_putsAtt(0, y, STR_DELETE_ALL_SENSORS, attr);
|
||||
lcdDrawText(0, y, STR_DELETE_ALL_SENSORS, attr);
|
||||
s_editMode = 0;
|
||||
if (attr && event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
killEvents(KEY_ENTER);
|
||||
|
@ -664,7 +664,7 @@ void menuModelTelemetry(uint8_t event)
|
|||
case ITEM_TELEMETRY_A2_RANGE:
|
||||
lcd_putsLeft(y, STR_RANGE);
|
||||
putsTelemetryChannelValue(TELEM_COL2, y, dest, 255-channel.offset, (m_posHorz<=0 ? attr : 0)|NO_UNIT|LEFT);
|
||||
lcd_putsiAtt(lcdLastPos, y, STR_VTELEMUNIT, channel.type, m_posHorz!=0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(lcdLastPos, y, STR_VTELEMUNIT, channel.type, m_posHorz!=0 ? attr : 0);
|
||||
if (attr && (s_editMode>0 || p1valdiff)) {
|
||||
if (m_posHorz == 0) {
|
||||
uint16_t ratio = checkIncDec(event, channel.ratio, 0, 256, EE_MODEL);
|
||||
|
@ -700,8 +700,8 @@ void menuModelTelemetry(uint8_t event)
|
|||
{
|
||||
uint8_t alarm = ((k==ITEM_TELEMETRY_A1_ALARM1 || k==ITEM_TELEMETRY_A2_ALARM1) ? 0 : 1);
|
||||
lcd_putsLeft(y, STR_ALARM);
|
||||
lcd_putsiAtt(TELEM_COL2, y, STR_VALARM, ALARM_LEVEL(ch, alarm), m_posHorz<=0 ? attr : 0);
|
||||
lcd_putsiAtt(TELEM_COL2+4*FW, y, STR_VALARMFN, ALARM_GREATER(ch, alarm), (CURSOR_ON_LINE() || m_posHorz==1) ? attr : 0);
|
||||
lcdDrawTextAtIndex(TELEM_COL2, y, STR_VALARM, ALARM_LEVEL(ch, alarm), m_posHorz<=0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(TELEM_COL2+4*FW, y, STR_VALARMFN, ALARM_GREATER(ch, alarm), (CURSOR_ON_LINE() || m_posHorz==1) ? attr : 0);
|
||||
putsTelemetryChannelValue(TELEM_COL2+6*FW, y, dest, channel.alarms_value[alarm], ((CURSOR_ON_LINE() || m_posHorz==2) ? attr : 0) | LEFT);
|
||||
|
||||
if (attr && (s_editMode>0 || p1valdiff)) {
|
||||
|
@ -735,7 +735,7 @@ void menuModelTelemetry(uint8_t event)
|
|||
case ITEM_TELEMETRY_RSSI_ALARM2: {
|
||||
uint8_t alarm = k-ITEM_TELEMETRY_RSSI_ALARM1;
|
||||
lcd_putsLeft(y, STR_ALARM);
|
||||
lcd_putsiAtt(TELEM_COL2, y, STR_VALARM, ((2+alarm+g_model.frsky.rssiAlarms[alarm].level)%4), m_posHorz<=0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(TELEM_COL2, y, STR_VALARM, ((2+alarm+g_model.frsky.rssiAlarms[alarm].level)%4), m_posHorz<=0 ? attr : 0);
|
||||
lcd_putc(TELEM_COL2+4*FW, y, '<');
|
||||
lcd_outdezNAtt(TELEM_COL2+6*FW, y, getRssiAlarmValue(alarm), LEFT|(m_posHorz!=0 ? attr : 0), 3);
|
||||
|
||||
|
@ -760,7 +760,7 @@ void menuModelTelemetry(uint8_t event)
|
|||
|
||||
case ITEM_TELEMETRY_USR_PROTO:
|
||||
lcd_putsLeft(y, STR_PROTO);
|
||||
lcd_putsiAtt(TELEM_COL2, y, STR_VTELPROTO, g_model.frsky.usrProto, attr);
|
||||
lcdDrawTextAtIndex(TELEM_COL2, y, STR_VTELPROTO, g_model.frsky.usrProto, attr);
|
||||
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, g_model.frsky.usrProto, USR_PROTO_LAST);
|
||||
break;
|
||||
|
||||
|
@ -773,13 +773,13 @@ void menuModelTelemetry(uint8_t event)
|
|||
|
||||
case ITEM_TELEMETRY_USR_VOLTAGE_SOURCE:
|
||||
lcd_putsLeft(y, STR_VOLTAGE);
|
||||
lcd_putsiAtt(TELEM_COL2, y, STR_AMPSRC, g_model.frsky.voltsSource+1, attr);
|
||||
lcdDrawTextAtIndex(TELEM_COL2, y, STR_AMPSRC, g_model.frsky.voltsSource+1, attr);
|
||||
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, g_model.frsky.voltsSource, FRSKY_VOLTS_SOURCE_LAST);
|
||||
break;
|
||||
|
||||
case ITEM_TELEMETRY_USR_CURRENT_SOURCE:
|
||||
lcd_putsLeft(y, STR_CURRENT);
|
||||
lcd_putsiAtt(TELEM_COL2, y, STR_AMPSRC, g_model.frsky.currentSource, attr);
|
||||
lcdDrawTextAtIndex(TELEM_COL2, y, STR_AMPSRC, g_model.frsky.currentSource, attr);
|
||||
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, g_model.frsky.currentSource, FRSKY_CURRENT_SOURCE_LAST);
|
||||
break;
|
||||
|
||||
|
@ -807,7 +807,7 @@ void menuModelTelemetry(uint8_t event)
|
|||
g_model.frsky.varioSource = checkIncDec(event, g_model.frsky.varioSource, 0, MAX_SENSORS, EE_MODEL|NO_INCDEC_MARKS, isSensorAvailable);
|
||||
}
|
||||
#else
|
||||
lcd_putsiAtt(TELEM_COL2, y, STR_VARIOSRC, g_model.frsky.varioSource, attr);
|
||||
lcdDrawTextAtIndex(TELEM_COL2, y, STR_VARIOSRC, g_model.frsky.varioSource, attr);
|
||||
if (attr) CHECK_INCDEC_MODELVAR(event, g_model.frsky.varioSource, 0, VARIO_SOURCE_LAST);
|
||||
#endif
|
||||
break;
|
||||
|
@ -938,7 +938,7 @@ void menuModelTelemetry(uint8_t event)
|
|||
}
|
||||
}
|
||||
#else
|
||||
lcd_putsiAtt(TELEM_COL1, y, STR_VTELEMCHNS, barSource, m_posHorz==0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(TELEM_COL1, y, STR_VTELEMCHNS, barSource, m_posHorz==0 ? attr : 0);
|
||||
if (barSource) {
|
||||
putsTelemetryChannelValue(TELEM_BARS_COLMIN, y, barSource-1, convertBarTelemValue(barSource, bar.barMin), (m_posHorz==1 ? attr : 0) | LEFT);
|
||||
putsTelemetryChannelValue(TELEM_BARS_COLMAX, y, barSource-1, convertBarTelemValue(barSource, 255-bar.barMax), (m_posHorz==2 ? attr : 0) | LEFT);
|
||||
|
@ -994,7 +994,7 @@ void menuModelTelemetry(uint8_t event)
|
|||
CHECK_INCDEC_MODELVAR_ZERO_CHECK(event, value, MIXSRC_LAST_TELEM, isSourceAvailable);
|
||||
}
|
||||
#else
|
||||
lcd_putsiAtt(pos[c], y, STR_VTELEMCHNS, value, cellAttr);
|
||||
lcdDrawTextAtIndex(pos[c], y, STR_VTELEMCHNS, value, cellAttr);
|
||||
if (cellAttr && (s_editMode>0 || p1valdiff)) {
|
||||
CHECK_INCDEC_MODELVAR_ZERO_CHECK(event, value, (lineIndex==3 && c==0) ? TELEM_STATUS_MAX : TELEM_DISPLAY_MAX, isTelemetrySourceAvailable);
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ void menuModelTemplates(uint8_t event)
|
|||
for (uint8_t i=0; i<LCD_LINES-1 && k<TMPL_COUNT; i++) {
|
||||
k = i+s_pgOfs;
|
||||
lcd_outdezNAtt(3*FW, y, k, (sub==k ? INVERS : 0)|LEADING0, 2);
|
||||
lcd_putsiAtt(4*FW, y, STR_VTEMPLATES, k, (sub==k ? INVERS : 0));
|
||||
lcdDrawTextAtIndex(4*FW, y, STR_VTEMPLATES, k, (sub==k ? INVERS : 0));
|
||||
y+=FH;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,12 +112,12 @@ void menuTraceBuffer(uint8_t event);
|
|||
#endif
|
||||
|
||||
#if !defined(CPUM64)
|
||||
void displaySlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr);
|
||||
void drawSlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr);
|
||||
#elif defined(GRAPHICS)
|
||||
void display5posSlider(coord_t x, coord_t y, uint8_t value, uint8_t attr);
|
||||
#define displaySlider(x, y, value, max, attr) lcd_outdezAtt(x, y, value, attr|LEFT)
|
||||
#define drawSlider(x, y, value, max, attr) lcd_outdezAtt(x, y, value, attr|LEFT)
|
||||
#else
|
||||
#define displaySlider(x, y, value, max, attr) lcd_outdezAtt(x, y, value, attr|LEFT)
|
||||
#define drawSlider(x, y, value, max, attr) lcd_outdezAtt(x, y, value, attr|LEFT)
|
||||
#endif
|
||||
|
||||
#if defined(NAVIGATION_POT1)
|
||||
|
@ -419,26 +419,39 @@ void displayWarning(uint8_t event);
|
|||
extern char s_text_file[TEXT_FILENAME_MAXLEN];
|
||||
void menuTextView(uint8_t event);
|
||||
void pushMenuTextView(const char *filename);
|
||||
bool modelHasNotes();
|
||||
void pushModelNotes();
|
||||
#endif
|
||||
|
||||
#define LABEL(...) (uint8_t)-1
|
||||
|
||||
#define KEY_MOVE_UP KEY_UP
|
||||
#define KEY_MOVE_DOWN KEY_DOWN
|
||||
#define KEY_ENTER KEY_MENU
|
||||
|
||||
#define CURSOR_MOVED_LEFT(event) (IS_ROTARY_LEFT(event) || EVT_KEY_MASK(event) == KEY_LEFT)
|
||||
#define CURSOR_MOVED_RIGHT(event) (IS_ROTARY_RIGHT(event) || EVT_KEY_MASK(event) == KEY_RIGHT)
|
||||
#define CASE_EVT_ROTARY_MOVE_RIGHT CASE_EVT_ROTARY_RIGHT
|
||||
#define CASE_EVT_ROTARY_MOVE_LEFT CASE_EVT_ROTARY_LEFT
|
||||
#define IS_ROTARY_MOVE_RIGHT IS_ROTARY_RIGHT
|
||||
#define IS_ROTARY_MOVE_LEFT IS_ROTARY_LEFT
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
#define IS_ROTARY_LEFT(evt) (evt == EVT_ROTARY_LEFT)
|
||||
#define IS_ROTARY_RIGHT(evt) (evt == EVT_ROTARY_RIGHT)
|
||||
#define IS_ROTARY_BREAK(evt) (evt == EVT_ROTARY_BREAK)
|
||||
#define IS_ROTARY_LONG(evt) (evt == EVT_ROTARY_LONG)
|
||||
#define IS_ROTARY_EVENT(evt) (EVT_KEY_MASK(evt) >= 0x0e)
|
||||
#define CASE_EVT_ROTARY_BREAK case EVT_ROTARY_BREAK:
|
||||
#define CASE_EVT_ROTARY_LONG case EVT_ROTARY_LONG:
|
||||
#define CASE_EVT_ROTARY_LEFT case EVT_ROTARY_LEFT:
|
||||
#define CASE_EVT_ROTARY_RIGHT case EVT_ROTARY_RIGHT:
|
||||
void repeatLastCursorMove(uint8_t event);
|
||||
#define REPEAT_LAST_CURSOR_MOVE() { if (EVT_KEY_MASK(event) >= 0x0e) putEvent(event); else repeatLastCursorMove(event); }
|
||||
#define MOVE_CURSOR_FROM_HERE() if (m_posHorz > 0) REPEAT_LAST_CURSOR_MOVE()
|
||||
#else
|
||||
#define IS_ROTARY_LEFT(evt) (0)
|
||||
#define IS_ROTARY_RIGHT(evt) (0)
|
||||
#define IS_ROTARY_BREAK(evt) (0)
|
||||
#define IS_ROTARY_LONG(evt) (0)
|
||||
#define IS_ROTARY_EVENT(evt) (0)
|
||||
#define CASE_EVT_ROTARY_BREAK
|
||||
#define CASE_EVT_ROTARY_LONG
|
||||
#define CASE_EVT_ROTARY_LEFT
|
||||
#define CASE_EVT_ROTARY_RIGHT
|
||||
void repeatLastCursorMove(uint8_t event);
|
||||
#define REPEAT_LAST_CURSOR_MOVE() repeatLastCursorMove(event)
|
||||
#define MOVE_CURSOR_FROM_HERE() REPEAT_LAST_CURSOR_MOVE()
|
||||
|
|
|
@ -551,7 +551,7 @@ void check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
|||
if (!horTab || s_editMode>0) break;
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
CASE_EVT_ROTARY_MOVE_RIGHT
|
||||
CASE_EVT_ROTARY_RIGHT
|
||||
if (s_editMode != 0) break;
|
||||
if (l_posHorz < maxcol) {
|
||||
l_posHorz++;
|
||||
|
@ -559,7 +559,7 @@ void check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
|||
}
|
||||
else {
|
||||
l_posHorz = 0;
|
||||
if (!IS_ROTARY_MOVE_RIGHT(event))
|
||||
if (!IS_ROTARY_RIGHT(event))
|
||||
break;
|
||||
}
|
||||
#else
|
||||
|
@ -592,13 +592,13 @@ void check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
|||
if (!horTab || s_editMode>0) break;
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
CASE_EVT_ROTARY_MOVE_LEFT
|
||||
CASE_EVT_ROTARY_LEFT
|
||||
if (s_editMode != 0) break;
|
||||
if (l_posHorz > 0) {
|
||||
l_posHorz--;
|
||||
break;
|
||||
}
|
||||
else if (IS_ROTARY_MOVE_LEFT(event) && s_editMode == 0) {
|
||||
else if (IS_ROTARY_LEFT(event) && s_editMode == 0) {
|
||||
l_posHorz = 0xff;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -77,11 +77,11 @@ void message(const pm_char *title, const pm_char *t, const char *last MESSAGE_SO
|
|||
#define MESSAGE_LCD_OFFSET 6*FW
|
||||
|
||||
#if defined(TRANSLATIONS_FR) || defined(TRANSLATIONS_IT) || defined(TRANSLATIONS_CZ)
|
||||
lcd_putsAtt(MESSAGE_LCD_OFFSET, 0, STR_WARNING, DBLSIZE);
|
||||
lcd_putsAtt(MESSAGE_LCD_OFFSET, 2*FH, title, DBLSIZE);
|
||||
lcdDrawText(MESSAGE_LCD_OFFSET, 0, STR_WARNING, DBLSIZE);
|
||||
lcdDrawText(MESSAGE_LCD_OFFSET, 2*FH, title, DBLSIZE);
|
||||
#else
|
||||
lcd_putsAtt(MESSAGE_LCD_OFFSET, 0, title, DBLSIZE);
|
||||
lcd_putsAtt(MESSAGE_LCD_OFFSET, 2*FH, STR_WARNING, DBLSIZE);
|
||||
lcdDrawText(MESSAGE_LCD_OFFSET, 0, title, DBLSIZE);
|
||||
lcdDrawText(MESSAGE_LCD_OFFSET, 2*FH, STR_WARNING, DBLSIZE);
|
||||
#endif
|
||||
|
||||
drawFilledRect(0, 0, LCD_W, 32);
|
||||
|
@ -103,7 +103,7 @@ void displayWarning(uint8_t event)
|
|||
s_warning_result = false;
|
||||
displayBox();
|
||||
if (s_warning_info) {
|
||||
lcd_putsnAtt(WARNING_LINE_X, WARNING_LINE_Y+FH, s_warning_info, s_warning_info_len, WARNING_INFO_FLAGS);
|
||||
lcdDrawTextWithLen(WARNING_LINE_X, WARNING_LINE_Y+FH, s_warning_info, s_warning_info_len, WARNING_INFO_FLAGS);
|
||||
}
|
||||
lcd_puts(WARNING_LINE_X, WARNING_LINE_Y+2*FH, s_warning_type == WARNING_TYPE_ASTERISK ? STR_EXIT : STR_POPUPS);
|
||||
switch (event) {
|
||||
|
@ -155,20 +155,20 @@ const char * displayMenu(uint8_t event)
|
|||
lcdDrawRect(MENU_X, y, MENU_W, display_count * (FH+1) + 2);
|
||||
|
||||
for (uint8_t i=0; i<display_count; i++) {
|
||||
lcd_putsAtt(MENU_X+6, i*(FH+1) + y + 2, s_menu[i], s_menu_flags);
|
||||
lcdDrawText(MENU_X+6, i*(FH+1) + y + 2, s_menu[i], s_menu_flags);
|
||||
if (i == s_menu_item) drawFilledRect(MENU_X+1, i*(FH+1) + y + 1, MENU_W-2, 9);
|
||||
}
|
||||
|
||||
if (s_menu_count > display_count) {
|
||||
lcdDrawScrollbar(MENU_X+MENU_W-1, y+1, MENU_MAX_LINES * (FH+1), s_menu_offset, s_menu_count, MENU_MAX_LINES);
|
||||
drawScrollbar(MENU_X+MENU_W-1, y+1, MENU_MAX_LINES * (FH+1), s_menu_offset, s_menu_count, MENU_MAX_LINES);
|
||||
}
|
||||
|
||||
switch(event) {
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
CASE_EVT_ROTARY_LEFT
|
||||
#endif
|
||||
case EVT_KEY_FIRST(KEY_MOVE_UP):
|
||||
case EVT_KEY_REPT(KEY_MOVE_UP):
|
||||
case EVT_KEY_FIRST(KEY_UP):
|
||||
case EVT_KEY_REPT(KEY_UP):
|
||||
if (s_menu_item > 0) {
|
||||
s_menu_item--;
|
||||
}
|
||||
|
@ -192,8 +192,8 @@ const char * displayMenu(uint8_t event)
|
|||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
CASE_EVT_ROTARY_RIGHT
|
||||
#endif
|
||||
case EVT_KEY_FIRST(KEY_MOVE_DOWN):
|
||||
case EVT_KEY_REPT(KEY_MOVE_DOWN):
|
||||
case EVT_KEY_FIRST(KEY_DOWN):
|
||||
case EVT_KEY_REPT(KEY_DOWN):
|
||||
if (s_menu_item < display_count - 1 && s_menu_offset + s_menu_item + 1 < s_menu_count) {
|
||||
s_menu_item++;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ void menuAboutView(uint8_t event)
|
|||
break;
|
||||
}
|
||||
|
||||
lcd_putsAtt(17, 0, STR_ABOUTUS, DBLSIZE|INVERS);
|
||||
lcdDrawText(17, 0, STR_ABOUTUS, DBLSIZE|INVERS);
|
||||
lcd_hline(17, 16, LCD_W-17);
|
||||
lcd_img(8, 0, about_bmp, 0);
|
||||
LcdFlags att = 0;
|
||||
|
@ -92,67 +92,67 @@ void menuAboutView(uint8_t event)
|
|||
switch (screenIndex) {
|
||||
case ABOUT_OPENTX:
|
||||
case ABOUT_END:
|
||||
lcd_putsAtt(ABOUT_X, 22, STR_ABOUT_OPENTX_1, SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X, 30, STR_ABOUT_OPENTX_2, SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X, 38, STR_ABOUT_OPENTX_3, SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X, 46, STR_ABOUT_OPENTX_4, SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X, 54, STR_ABOUT_OPENTX_5, SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 22, STR_ABOUT_OPENTX_1, SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 30, STR_ABOUT_OPENTX_2, SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 38, STR_ABOUT_OPENTX_3, SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 46, STR_ABOUT_OPENTX_4, SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 54, STR_ABOUT_OPENTX_5, SMLSIZE);
|
||||
screenDuration = 255;
|
||||
break;
|
||||
|
||||
case ABOUT_BERTRAND:
|
||||
lcd_putsAtt(ABOUT_X, 24, STR_ABOUT_BERTRAND_1, att);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_BERTRAND_2, att|SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_BERTRAND_3, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 24, STR_ABOUT_BERTRAND_1, att);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_BERTRAND_2, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_BERTRAND_3, att|SMLSIZE);
|
||||
break;
|
||||
|
||||
case ABOUT_ANDRE:
|
||||
lcd_putsAtt(ABOUT_X, 24, STR_ABOUT_ANDRE_1, att);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_ANDRE_2, att|SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_ANDRE_3, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 24, STR_ABOUT_ANDRE_1, att);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_ANDRE_2, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_ANDRE_3, att|SMLSIZE);
|
||||
break;
|
||||
|
||||
case ABOUT_MIKE:
|
||||
lcd_putsAtt(ABOUT_X, 24, STR_ABOUT_MIKE_1, att);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_MIKE_2, att|SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_MIKE_3, att|SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 52, STR_ABOUT_MIKE_4, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 24, STR_ABOUT_MIKE_1, att);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_MIKE_2, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_MIKE_3, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 52, STR_ABOUT_MIKE_4, att|SMLSIZE);
|
||||
break;
|
||||
|
||||
case ABOUT_KJELL:
|
||||
lcd_putsAtt(ABOUT_X, 24, STR_ABOUT_KJELL_1, att);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_KJELL_2, att|SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_KJELL_3, att|SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 52, STR_ABOUT_KJELL_4, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 24, STR_ABOUT_KJELL_1, att);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_KJELL_2, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_KJELL_3, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 52, STR_ABOUT_KJELL_4, att|SMLSIZE);
|
||||
break;
|
||||
|
||||
case ABOUT_MARTIN:
|
||||
lcd_putsAtt(ABOUT_X, 24, STR_ABOUT_MARTIN_1, att);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_MARTIN_2, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 24, STR_ABOUT_MARTIN_1, att);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_MARTIN_2, att|SMLSIZE);
|
||||
break;
|
||||
|
||||
case ABOUT_ROMOLO:
|
||||
lcd_putsAtt(ABOUT_X, 24, STR_ABOUT_ROMOLO_1, att);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_ROMOLO_2, att|SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_ROMOLO_3, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 24, STR_ABOUT_ROMOLO_1, att);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_ROMOLO_2, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_ROMOLO_3, att|SMLSIZE);
|
||||
break;
|
||||
|
||||
case ABOUT_ROB:
|
||||
lcd_putsAtt(ABOUT_X, 24, STR_ABOUT_ROB_1, att);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_ROB_2, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 24, STR_ABOUT_ROB_1, att);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_ROB_2, att|SMLSIZE);
|
||||
break;
|
||||
|
||||
case ABOUT_HARDWARE:
|
||||
lcd_putsAtt(ABOUT_X, 24, STR_ABOUT_HARDWARE_1, att);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_HARDWARE_2, att|SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_HARDWARE_3, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 24, STR_ABOUT_HARDWARE_1, att);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_HARDWARE_2, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_HARDWARE_3, att|SMLSIZE);
|
||||
break;
|
||||
|
||||
case ABOUT_PARENTS:
|
||||
lcd_putsAtt(ABOUT_X, 24, STR_ABOUT_PARENTS_1, att);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_PARENTS_2, att|SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_PARENTS_3, att|SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 52, STR_ABOUT_PARENTS_4, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 24, STR_ABOUT_PARENTS_1, att);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_PARENTS_2, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_PARENTS_3, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 52, STR_ABOUT_PARENTS_4, att|SMLSIZE);
|
||||
screenDuration = 255;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -191,7 +191,7 @@ void displayTimers()
|
|||
uint8_t len = zlen(g_model.timers[0].name, LEN_TIMER_NAME);
|
||||
if (len > 0) {
|
||||
xLabel += (LEN_TIMER_NAME-len)*FW;
|
||||
lcd_putsnAtt(xLabel, FH*3, g_model.timers[0].name, len, ZCHAR);
|
||||
lcdDrawTextWithLen(xLabel, FH*3, g_model.timers[0].name, len, ZCHAR);
|
||||
}
|
||||
else {
|
||||
putsTimerMode(xLabel, FH*3, g_model.timers[0].mode);
|
||||
|
@ -434,7 +434,7 @@ void menuMainView(uint8_t event)
|
|||
{
|
||||
// Flight Mode Name
|
||||
uint8_t mode = mixerCurrentFlightMode;
|
||||
lcd_putsnAtt(PHASE_X, PHASE_Y, g_model.flightModeData[mode].name, sizeof(g_model.flightModeData[mode].name), ZCHAR|PHASE_FLAGS);
|
||||
lcdDrawTextWithLen(PHASE_X, PHASE_Y, g_model.flightModeData[mode].name, sizeof(g_model.flightModeData[mode].name), ZCHAR|PHASE_FLAGS);
|
||||
|
||||
// Model Name
|
||||
putsModelName(MODELNAME_X, MODELNAME_Y, g_model.header.name, g_eeGeneral.currModel, BIGSIZE);
|
||||
|
@ -575,8 +575,8 @@ void menuMainView(uint8_t event)
|
|||
s_gvar_timer--;
|
||||
s_warning = STR_GLOBAL_VAR;
|
||||
displayBox();
|
||||
lcd_putsnAtt(16, 5*FH, g_model.gvars[s_gvar_last].name, LEN_GVAR_NAME, ZCHAR);
|
||||
lcd_putsAtt(16+7*FW, 5*FH, PSTR("[\010]"), BOLD);
|
||||
lcdDrawTextWithLen(16, 5*FH, g_model.gvars[s_gvar_last].name, LEN_GVAR_NAME, ZCHAR);
|
||||
lcdDrawText(16+7*FW, 5*FH, PSTR("[\010]"), BOLD);
|
||||
lcd_outdezAtt(16+7*FW+4*FW+FW/2, 5*FH, GVAR_VALUE(s_gvar_last, getGVarFlightPhase(mixerCurrentFlightMode, s_gvar_last)), BOLD);
|
||||
s_warning = NULL;
|
||||
}
|
||||
|
@ -585,7 +585,7 @@ void menuMainView(uint8_t event)
|
|||
#if defined(DSM2)
|
||||
if (moduleFlag[0] == MODULE_BIND) {
|
||||
// Issue 98
|
||||
lcd_putsAtt(15*FW, 0, PSTR("BIND"), 0);
|
||||
lcdDrawText(15*FW, 0, PSTR("BIND"), 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -182,13 +182,13 @@ void print_mav_mode(uint8_t x, uint8_t y, uint32_t custom_mode, uint8_t attr) //
|
|||
uint8_t mode = (uint8_t) custom_mode;
|
||||
switch (telemetry_data.type_autopilot) {
|
||||
case MAVLINK_ARDUCOPTER:
|
||||
lcd_putsiAtt(x,y,STR_MAVLINK_AC_MODES,mode,attr);
|
||||
lcdDrawTextAtIndex(x,y,STR_MAVLINK_AC_MODES,mode,attr);
|
||||
break;
|
||||
case MAVLINK_ARDUPLANE:
|
||||
lcd_putsiAtt(x,y,STR_MAVLINK_AP_MODES,ap_modes_lut[custom_mode],attr);
|
||||
lcdDrawTextAtIndex(x,y,STR_MAVLINK_AP_MODES,ap_modes_lut[custom_mode],attr);
|
||||
break;
|
||||
default:
|
||||
lcd_putsAtt (FW, y, PSTR("INV. MAV TYPE"), attr);
|
||||
lcdDrawText (FW, y, PSTR("INV. MAV TYPE"), attr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ void print_mav_mode(uint8_t x, uint8_t y, uint32_t custom_mode, uint8_t attr) //
|
|||
*/
|
||||
void mav_title(const pm_char * s, uint8_t index)
|
||||
{
|
||||
lcd_putsAtt(0, 0, PSTR("MAVLINK"), INVERS);
|
||||
lcdDrawText(0, 0, PSTR("MAVLINK"), INVERS);
|
||||
lcd_puts(10 * FW, 0, s);
|
||||
displayScreenIndex(index, MAX_MAVLINK_MENU, INVERS);
|
||||
lcd_putc(7 * FW, 0, (mav_heartbeat > 0) ? '*' : ' ');
|
||||
|
@ -236,9 +236,9 @@ void menuTelemetryMavlinkInfos(void) {
|
|||
*/
|
||||
if (telemetry_data.status) {
|
||||
|
||||
lcd_putsnAtt(x1, y, STR_MAVLINK_MODE, 4, 0);
|
||||
lcdDrawTextWithLen(x1, y, STR_MAVLINK_MODE, 4, 0);
|
||||
if (telemetry_data.active)
|
||||
lcd_putsnAtt(x2, y, PSTR("A"), 1, 0);
|
||||
lcdDrawTextWithLen(x2, y, PSTR("A"), 1, 0);
|
||||
lcd_outdezAtt(xnum, y, telemetry_data.mode, 0);
|
||||
|
||||
y += FH;
|
||||
|
@ -298,7 +298,7 @@ void menuTelemetryMavlinkFlightMode(void) {
|
|||
x = 0;
|
||||
|
||||
if (telemetry_data.active)
|
||||
lcd_putsAtt (FW, y, STR_MAVLINK_ARMED, DBLSIZE);
|
||||
lcdDrawText (FW, y, STR_MAVLINK_ARMED, DBLSIZE);
|
||||
}
|
||||
|
||||
/*! \brief Batterystatus dislplay
|
||||
|
@ -400,9 +400,9 @@ void menuTelemetryMavlinkGPS(void) {
|
|||
xnum2 = xnum + 11 * FWNUM;
|
||||
y = FH;
|
||||
|
||||
lcd_putsnAtt(x1, y, STR_MAVLINK_GPS, 3, 0);
|
||||
lcdDrawTextWithLen(x1, y, STR_MAVLINK_GPS, 3, 0);
|
||||
if (telemetry_data.fix_type < 2) {
|
||||
lcd_putsnAtt(xnum, y, STR_MAVLINK_NO_FIX, 6, 0);
|
||||
lcdDrawTextWithLen(xnum, y, STR_MAVLINK_NO_FIX, 6, 0);
|
||||
} else {
|
||||
lcd_outdezNAtt(xnum, y, telemetry_data.fix_type, 0, 3);
|
||||
lcd_puts(xnum, y, PSTR("D"));
|
||||
|
@ -419,19 +419,19 @@ void menuTelemetryMavlinkGPS(void) {
|
|||
lcd_puts(x1, y, STR_MAVLINK_LAT);
|
||||
lcd_outdezFloat(xnum, y, telemetry_data.loc_current.lat, 2);
|
||||
|
||||
lcd_putsnAtt(x2, y, STR_MAVLINK_LON, 3, 0);
|
||||
lcdDrawTextWithLen(x2, y, STR_MAVLINK_LON, 3, 0);
|
||||
lcd_outdezFloat(xnum2, y, telemetry_data.loc_current.lon, 2);
|
||||
|
||||
y += FH;
|
||||
lcd_putsnAtt(x1, y, STR_MAVLINK_ALTITUDE, 3, 0);
|
||||
lcdDrawTextWithLen(x1, y, STR_MAVLINK_ALTITUDE, 3, 0);
|
||||
lcd_outdezAtt(xnum, y, telemetry_data.loc_current.gps_alt, 0);
|
||||
|
||||
y += FH;
|
||||
lcd_putsnAtt(x1, y, STR_MAVLINK_COURSE, 6, 0);
|
||||
lcdDrawTextWithLen(x1, y, STR_MAVLINK_COURSE, 6, 0);
|
||||
lcd_outdezFloat(xnum, y, telemetry_data.course, 2);
|
||||
|
||||
y += FH;
|
||||
lcd_putsnAtt(x1, y, PSTR("V"), 1, 0);
|
||||
lcdDrawTextWithLen(x1, y, PSTR("V"), 1, 0);
|
||||
lcd_outdezAtt(xnum, y, telemetry_data.v, 0);
|
||||
//}
|
||||
}
|
||||
|
|
|
@ -174,13 +174,13 @@ void menuStatisticsDebug(uint8_t event)
|
|||
lcd_putsLeft(MENU_DEBUG_Y_COPROC, STR_COPROC_TEMP);
|
||||
|
||||
if (Coproc_read==0) {
|
||||
lcd_putsAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, PSTR("Co Proc NACK"),INVERS);
|
||||
lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, PSTR("Co Proc NACK"),INVERS);
|
||||
}
|
||||
else if (Coproc_read==0x81) {
|
||||
lcd_putsAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, PSTR("Inst.TinyApp"),INVERS);
|
||||
lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, PSTR("Inst.TinyApp"),INVERS);
|
||||
}
|
||||
else if (Coproc_read<3) {
|
||||
lcd_putsAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, PSTR("Upgr.TinyApp"),INVERS);
|
||||
lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, PSTR("Upgr.TinyApp"),INVERS);
|
||||
}
|
||||
else {
|
||||
putsValueWithUnit(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_COPROC, Coproc_temp, UNIT_TEMPERATURE, LEFT);
|
||||
|
|
|
@ -66,7 +66,7 @@ void displayRssiLine()
|
|||
drawFilledRect(66+36-v, 58, v, 5, (rssi < getRssiAlarmValue(0)) ? DOTTED : SOLID);
|
||||
}
|
||||
else {
|
||||
lcd_putsAtt(7*FW, STATUS_BAR_Y, STR_NODATA, BLINK);
|
||||
lcdDrawText(7*FW, STATUS_BAR_Y, STR_NODATA, BLINK);
|
||||
lcd_status_line();
|
||||
}
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ void displayVoltagesScreen()
|
|||
{
|
||||
// Volts / Amps / Watts / mAh
|
||||
uint8_t analog = 0;
|
||||
lcd_putsiAtt(0, 2*FH, STR_AMPSRC, g_model.frsky.voltsSource+1, 0);
|
||||
lcdDrawTextAtIndex(0, 2*FH, STR_AMPSRC, g_model.frsky.voltsSource+1, 0);
|
||||
switch (g_model.frsky.voltsSource) {
|
||||
case FRSKY_VOLTS_SOURCE_A1:
|
||||
case FRSKY_VOLTS_SOURCE_A2:
|
||||
|
@ -172,7 +172,7 @@ void displayVoltagesScreen()
|
|||
}
|
||||
|
||||
if (g_model.frsky.currentSource) {
|
||||
lcd_putsiAtt(0, 4*FH, STR_AMPSRC, g_model.frsky.currentSource, 0);
|
||||
lcdDrawTextAtIndex(0, 4*FH, STR_AMPSRC, g_model.frsky.currentSource, 0);
|
||||
switch(g_model.frsky.currentSource) {
|
||||
case FRSKY_CURRENT_SOURCE_A1:
|
||||
case FRSKY_CURRENT_SOURCE_A2:
|
||||
|
@ -259,7 +259,7 @@ bool displayGaugesTelemetryScreen(FrSkyScreenData & screen)
|
|||
#if defined(CPUARM)
|
||||
putsMixerSource(0, y+barHeight-5, source, 0);
|
||||
#else
|
||||
lcd_putsiAtt(0, y+barHeight-5, STR_VTELEMCHNS, source, 0);
|
||||
lcdDrawTextAtIndex(0, y+barHeight-5, STR_VTELEMCHNS, source, 0);
|
||||
#endif
|
||||
lcdDrawRect(BAR_LEFT, y, BAR_WIDTH+1, barHeight+2);
|
||||
#if defined(CPUARM)
|
||||
|
@ -422,7 +422,7 @@ bool displayNumbersTelemetryScreen(FrSkyScreenData & screen)
|
|||
field = field-TELEM_TIMER1+TELEM_T1;
|
||||
}
|
||||
|
||||
lcd_putsiAtt(pos[j], 1+FH+2*FH*i, STR_VTELEMCHNS, field, 0);
|
||||
lcdDrawTextAtIndex(pos[j], 1+FH+2*FH*i, STR_VTELEMCHNS, field, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -138,7 +138,7 @@ void menuTextView(uint8_t event)
|
|||
}
|
||||
|
||||
for (int i=0; i<LCD_LINES-1; i++) {
|
||||
lcd_putsAtt(0, i*FH+FH+1, s_text_screen[i], FIXEDWIDTH);
|
||||
lcdDrawText(0, i*FH+FH+1, s_text_screen[i], FIXEDWIDTH);
|
||||
}
|
||||
|
||||
char *title = s_text_file;
|
||||
|
@ -151,7 +151,7 @@ void menuTextView(uint8_t event)
|
|||
lcd_invert_line(0);
|
||||
|
||||
if (lines_count > LCD_LINES-1) {
|
||||
lcdDrawScrollbar(LCD_W-1, FH, LCD_H-FH, s_pgOfs, lines_count, LCD_LINES-1);
|
||||
drawScrollbar(LCD_W-1, FH, LCD_H-FH, s_pgOfs, lines_count, LCD_LINES-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ void menu_lcd_onoff(coord_t x, coord_t y, uint8_t value, LcdFlags attr)
|
|||
lcd_square(x, y, 7);
|
||||
#else
|
||||
/* ON / OFF version */
|
||||
lcd_putsiAtt(x, y, STR_OFFON, value, attr ? INVERS:0) ;
|
||||
lcdDrawTextAtIndex(x, y, STR_OFFON, value, attr ? INVERS:0) ;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr)
|
|||
}
|
||||
|
||||
#if !defined(CPUM64)
|
||||
void lcdDrawScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible)
|
||||
void drawScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible)
|
||||
{
|
||||
lcdDrawVerticalLine(x, y, h, DOTTED);
|
||||
coord_t yofs = (h * offset) / count;
|
||||
|
@ -85,13 +85,13 @@ void lcdDrawScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t
|
|||
|
||||
void title(const pm_char * s)
|
||||
{
|
||||
lcd_putsAtt(0, 0, s, INVERS);
|
||||
lcdDrawText(0, 0, s, INVERS);
|
||||
}
|
||||
|
||||
select_menu_value_t selectMenuItem(coord_t x, coord_t y, const pm_char *label, const pm_char *values, select_menu_value_t value, select_menu_value_t min, select_menu_value_t max, LcdFlags attr, uint8_t event)
|
||||
{
|
||||
lcd_putsColumnLeft(x, y, label);
|
||||
if (values) lcd_putsiAtt(x, y, values, value-min, attr);
|
||||
if (values) lcdDrawTextAtIndex(x, y, values, value-min, attr);
|
||||
if (attr) value = checkIncDec(event, value, min, max, (g_menuPos[0] == 0) ? EE_MODEL : EE_GENERAL);
|
||||
return value;
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ int8_t switchMenuItem(coord_t x, coord_t y, int8_t value, LcdFlags attr, uint8_t
|
|||
}
|
||||
|
||||
#if !defined(CPUM64)
|
||||
void displaySlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr)
|
||||
void drawSlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr)
|
||||
{
|
||||
lcd_putc(x+(value*4*FW)/max, y, '$');
|
||||
lcd_hline(x, y+3, 5*FW-1, FORCE);
|
||||
|
@ -256,7 +256,7 @@ void drawStatusLine()
|
|||
}
|
||||
|
||||
drawFilledRect(0, LCD_H-statusLineHeight, LCD_W, FH, SOLID, ERASE);
|
||||
lcd_putsAtt(5, LCD_H+1-statusLineHeight, statusLineMsg, BSS);
|
||||
lcdDrawText(5, LCD_H+1-statusLineHeight, statusLineMsg, BSS);
|
||||
drawFilledRect(0, LCD_H-statusLineHeight, LCD_W, FH, SOLID);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,11 +68,11 @@
|
|||
|
||||
void displaySplash();
|
||||
void displayScreenIndex(uint8_t index, uint8_t count);
|
||||
void lcdDrawScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
|
||||
void drawScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
|
||||
void drawHeader(int index);
|
||||
void drawFooter();
|
||||
#define drawStatusLine(...)
|
||||
void displayProgressBar(const char *label);
|
||||
void drawProgressBar(const char *label);
|
||||
void updateProgressBar(int num, int den);
|
||||
|
||||
// Header bitmaps
|
||||
|
|
|
@ -151,19 +151,21 @@ int getTextWidth(const pm_char * s, int len, LcdFlags flags)
|
|||
{
|
||||
const uint16_t * specs = fontspecsTable[FONTSIZE(flags) >> 8];
|
||||
int result = 0;
|
||||
for (int i=0; (len==0 || i<len) && (*s!='\0'); ++i) {
|
||||
for (int i=0; len==0 || i<len; ++i) {
|
||||
char c;
|
||||
if (flags & ZCHAR)
|
||||
c = idx2char(*s);
|
||||
else
|
||||
c = pgm_read_byte(s);
|
||||
if (c == '\0')
|
||||
break;
|
||||
result += getCharWidth(c, specs);
|
||||
++s;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void lcd_putsnAtt(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdFlags flags)
|
||||
void lcdDrawTextWithLen(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdFlags flags)
|
||||
{
|
||||
int width = getTextWidth(s, len, flags);
|
||||
int height = getFontHeight(flags);
|
||||
|
@ -228,17 +230,17 @@ void lcd_putsnAtt(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdFlags
|
|||
|
||||
void lcd_putsn(coord_t x, coord_t y, const pm_char * s, uint8_t len)
|
||||
{
|
||||
lcd_putsnAtt(x, y, s, len, TEXT_COLOR);
|
||||
lcdDrawTextWithLen(x, y, s, len, TEXT_COLOR);
|
||||
}
|
||||
|
||||
void lcd_putsAtt(coord_t x, coord_t y, const pm_char * s, LcdFlags flags)
|
||||
void lcdDrawText(coord_t x, coord_t y, const pm_char * s, LcdFlags flags)
|
||||
{
|
||||
lcd_putsnAtt(x, y, s, 255, flags);
|
||||
lcdDrawTextWithLen(x, y, s, 255, flags);
|
||||
}
|
||||
|
||||
void lcd_puts(coord_t x, coord_t y, const pm_char * s)
|
||||
{
|
||||
lcd_putsAtt(x, y, s, 0);
|
||||
lcdDrawText(x, y, s, 0);
|
||||
}
|
||||
|
||||
void lcd_putsLeft(coord_t y, const pm_char * s)
|
||||
|
@ -249,14 +251,14 @@ void lcd_putsLeft(coord_t y, const pm_char * s)
|
|||
void lcd_putsCenter(coord_t y, const pm_char * s, LcdFlags attr)
|
||||
{
|
||||
int x = (LCD_W - getTextWidth(s)) / 2;
|
||||
lcd_putsAtt(x, y, s, attr);
|
||||
lcdDrawText(x, y, s, attr);
|
||||
}
|
||||
|
||||
void lcd_putsiAtt(coord_t x, coord_t y, const pm_char * s,uint8_t idx, LcdFlags flags)
|
||||
void lcdDrawTextAtIndex(coord_t x, coord_t y, const pm_char * s,uint8_t idx, LcdFlags flags)
|
||||
{
|
||||
uint8_t length;
|
||||
length = pgm_read_byte(s++);
|
||||
lcd_putsnAtt(x, y, s+length*idx, length, flags & ~ZCHAR);
|
||||
lcdDrawTextWithLen(x, y, s+length*idx, length, flags & ~ZCHAR);
|
||||
}
|
||||
|
||||
void lcd_outhex4(coord_t x, coord_t y, uint32_t val, LcdFlags flags)
|
||||
|
@ -272,7 +274,7 @@ void lcd_outhex4(coord_t x, coord_t y, uint32_t val, LcdFlags flags)
|
|||
x -= getTextWidth(s);
|
||||
else
|
||||
flags -= LEFT;
|
||||
lcd_putsAtt(x, y, s, flags);
|
||||
lcdDrawText(x, y, s, flags);
|
||||
}
|
||||
|
||||
void lcd_outdez8(coord_t x, coord_t y, int8_t val)
|
||||
|
@ -323,7 +325,7 @@ void lcd_outdezNAtt(coord_t x, coord_t y, lcdint_t val, LcdFlags flags, int len,
|
|||
strncpy(&str[32], suffix, 16);
|
||||
}
|
||||
flags &= ~(LEADING0|LEFT);
|
||||
lcd_putsAtt(x, y, s, flags);
|
||||
lcdDrawText(x, y, s, flags);
|
||||
}
|
||||
|
||||
#if !defined(BOOT)
|
||||
|
@ -447,7 +449,7 @@ void putsTimer(coord_t x, coord_t y, putstime_t tme, LcdFlags att)
|
|||
char str[10]; // "-00:00:00"
|
||||
getTimerString(str, tme, att);
|
||||
att &= ~LEFT;
|
||||
lcd_putsAtt(x, y, str, att);
|
||||
lcdDrawText(x, y, str, att);
|
||||
}
|
||||
|
||||
// TODO to be optimized with putsValueWithUnit
|
||||
|
@ -466,13 +468,13 @@ void putsStrIdx(coord_t x, coord_t y, const pm_char *str, int idx, LcdFlags att,
|
|||
// TODO quick & dirty, dangerous
|
||||
char s[32];
|
||||
sprintf(s, "%s%s%d", prefix, str, abs(idx));
|
||||
lcd_putsAtt(x, y, s, att);
|
||||
lcdDrawText(x, y, s, att);
|
||||
}
|
||||
|
||||
void putsMixerSource(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
||||
{
|
||||
if (idx == 0) {
|
||||
lcd_putsiAtt(x, y, STR_VSRCRAW, 0, att); // TODO macro
|
||||
lcdDrawTextAtIndex(x, y, STR_VSRCRAW, 0, att); // TODO macro
|
||||
}
|
||||
else if (idx <= MIXSRC_LAST_INPUT) {
|
||||
char s[32] = "\323";
|
||||
|
@ -483,7 +485,7 @@ void putsMixerSource(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
|||
else {
|
||||
sprintf(s+1, "%02d", idx);
|
||||
}
|
||||
lcd_putsAtt(x, y, s, att);
|
||||
lcdDrawText(x, y, s, att);
|
||||
}
|
||||
|
||||
else if (idx <= MIXSRC_LAST_LUA) {
|
||||
|
@ -492,7 +494,7 @@ void putsMixerSource(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
|||
if (qr.quot < MAX_SCRIPTS && qr.rem < scriptInputsOutputs[qr.quot].outputsCount) {
|
||||
lcdDrawChar(x+2, y+1, '1'+qr.quot, TINSIZE);
|
||||
lcdDrawSolidFilledRect(x, y, 7, 7);
|
||||
lcd_putsnAtt(x+8, y, scriptInputsOutputs[qr.quot].outputs[qr.rem].name, att & STREXPANDED ? 9 : 4, att);
|
||||
lcdDrawTextWithLen(x+8, y, scriptInputsOutputs[qr.quot].outputs[qr.rem].name, att & STREXPANDED ? 9 : 4, att);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
@ -505,19 +507,19 @@ void putsMixerSource(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
|||
else if (idx < MIXSRC_LAST_POT) {
|
||||
idx = idx-MIXSRC_Rud;
|
||||
if (ZEXIST(g_eeGeneral.anaNames[idx]))
|
||||
lcd_putsnAtt(x, y, g_eeGeneral.anaNames[idx], LEN_ANA_NAME, ZCHAR|att);
|
||||
lcdDrawTextWithLen(x, y, g_eeGeneral.anaNames[idx], LEN_ANA_NAME, ZCHAR|att);
|
||||
else
|
||||
lcd_putsiAtt(x, y, STR_VSRCRAW, idx+1, att);
|
||||
lcdDrawTextAtIndex(x, y, STR_VSRCRAW, idx+1, att);
|
||||
}
|
||||
else if (idx >= MIXSRC_FIRST_SWITCH && idx < MIXSRC_FIRST_LOGICAL_SWITCH) {
|
||||
idx = idx-MIXSRC_FIRST_SWITCH;
|
||||
if (ZEXIST(g_eeGeneral.switchNames[idx]))
|
||||
lcd_putsnAtt(x, y, g_eeGeneral.switchNames[idx], LEN_SWITCH_NAME, ZCHAR|att);
|
||||
lcdDrawTextWithLen(x, y, g_eeGeneral.switchNames[idx], LEN_SWITCH_NAME, ZCHAR|att);
|
||||
else
|
||||
lcd_putsiAtt(x, y, STR_VSRCRAW, idx+MIXSRC_FIRST_SWITCH-MIXSRC_Rud+1, att);
|
||||
lcdDrawTextAtIndex(x, y, STR_VSRCRAW, idx+MIXSRC_FIRST_SWITCH-MIXSRC_Rud+1, att);
|
||||
}
|
||||
else if (idx < MIXSRC_SW1)
|
||||
lcd_putsiAtt(x, y, STR_VSRCRAW, idx-MIXSRC_Rud+1, att);
|
||||
lcdDrawTextAtIndex(x, y, STR_VSRCRAW, idx-MIXSRC_Rud+1, att);
|
||||
else if (idx <= MIXSRC_LAST_LOGICAL_SWITCH)
|
||||
putsSwitches(x, y, SWSRC_SW1+idx-MIXSRC_SW1, att);
|
||||
else if (idx < MIXSRC_CH1)
|
||||
|
@ -527,14 +529,14 @@ void putsMixerSource(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
|||
#if 0
|
||||
if (ZEXIST(g_model.limitData[idx-MIXSRC_CH1].name) && (att & STREXPANDED)) {
|
||||
lcdDrawChar(lcdNextPos, y, ' ', att);
|
||||
lcd_putsnAtt(lcdNextPos+3, y, g_model.limitData[idx-MIXSRC_CH1].name, LEN_CHANNEL_NAME, ZCHAR|att);
|
||||
lcdDrawTextWithLen(lcdNextPos+3, y, g_model.limitData[idx-MIXSRC_CH1].name, LEN_CHANNEL_NAME, ZCHAR|att);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if (idx <= MIXSRC_LAST_GVAR)
|
||||
putsStrIdx(x, y, STR_GV, idx-MIXSRC_GVAR1+1, att);
|
||||
else if (idx < MIXSRC_FIRST_TELEM) {
|
||||
lcd_putsiAtt(x, y, STR_VSRCRAW, idx-MIXSRC_Rud+1-NUM_LOGICAL_SWITCH-NUM_TRAINER-NUM_CHNOUT-MAX_GVARS, att);
|
||||
lcdDrawTextAtIndex(x, y, STR_VSRCRAW, idx-MIXSRC_Rud+1-NUM_LOGICAL_SWITCH-NUM_TRAINER-NUM_CHNOUT-MAX_GVARS, att);
|
||||
}
|
||||
else {
|
||||
idx -= MIXSRC_FIRST_TELEM;
|
||||
|
@ -543,13 +545,13 @@ void putsMixerSource(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
|||
int pos = zchar2str(s, g_model.telemetrySensors[qr.quot].label, sizeof(g_model.telemetrySensors[qr.quot].label));
|
||||
if (qr.rem) s[pos++] = (qr.rem==2 ? '+' : '-');
|
||||
s[pos] = '\0';
|
||||
lcd_putsAtt(x, y, s, att);
|
||||
lcdDrawText(x, y, s, att);
|
||||
}
|
||||
}
|
||||
|
||||
void putsChnLetter(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
||||
{
|
||||
lcd_putsiAtt(x, y, STR_RETA123, idx-1, att);
|
||||
lcdDrawTextAtIndex(x, y, STR_RETA123, idx-1, att);
|
||||
}
|
||||
|
||||
void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att)
|
||||
|
@ -560,17 +562,17 @@ void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att)
|
|||
putsStrIdx(x, y, STR_MODEL, id+1, att|LEADING0);
|
||||
}
|
||||
else {
|
||||
lcd_putsnAtt(x, y, name, sizeof(g_model.header.name), ZCHAR|att);
|
||||
lcdDrawTextWithLen(x, y, name, sizeof(g_model.header.name), ZCHAR|att);
|
||||
}
|
||||
}
|
||||
|
||||
void putsSwitches(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
||||
{
|
||||
if (idx == SWSRC_NONE) {
|
||||
return lcd_putsiAtt(x, y, STR_VSWITCHES, 0, att);
|
||||
return lcdDrawTextAtIndex(x, y, STR_VSWITCHES, 0, att);
|
||||
}
|
||||
else if (idx == SWSRC_OFF) {
|
||||
return lcd_putsiAtt(x, y, STR_OFFON, 0, att);
|
||||
return lcdDrawTextAtIndex(x, y, STR_OFFON, 0, att);
|
||||
}
|
||||
|
||||
char s[8];
|
||||
|
@ -591,29 +593,29 @@ void putsSwitches(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
|||
}
|
||||
s[pos++] = "\300-\301"[swinfo.rem];
|
||||
s[pos] = '\0';
|
||||
lcd_putsAtt(x, y, s, att);
|
||||
lcdDrawText(x, y, s, att);
|
||||
}
|
||||
/*else if (idx <= SWSRC_LAST_MULTIPOS_SWITCH) {
|
||||
div_t swinfo = div(idx - SWSRC_FIRST_MULTIPOS_SWITCH, XPOTS_MULTIPOS_COUNT);
|
||||
putsStrIdx(x, y, "S", swinfo.quot*10+swinfo.rem+11, att);
|
||||
}*/
|
||||
else if (idx <= SWSRC_LAST_TRIM) {
|
||||
lcd_putsiAtt(x, y, STR_VSWITCHES, idx-SWSRC_FIRST_TRIM+1, att);
|
||||
lcdDrawTextAtIndex(x, y, STR_VSWITCHES, idx-SWSRC_FIRST_TRIM+1, att);
|
||||
}
|
||||
else if (idx <= SWSRC_LAST_LOGICAL_SWITCH) {
|
||||
putsStrIdx(x, y, "L", idx-SWSRC_FIRST_LOGICAL_SWITCH+1, att);
|
||||
}
|
||||
else if (idx <= SWSRC_ONE) {
|
||||
lcd_putsiAtt(x, y, STR_VSWITCHES, idx-SWSRC_ON+1+(2*NUM_STICKS), att);
|
||||
lcdDrawTextAtIndex(x, y, STR_VSWITCHES, idx-SWSRC_ON+1+(2*NUM_STICKS), att);
|
||||
}
|
||||
else if (idx <= SWSRC_LAST_FLIGHT_MODE) {
|
||||
putsStrIdx(x, y, STR_FP, idx-SWSRC_FIRST_FLIGHT_MODE, att);
|
||||
}
|
||||
else if (idx == SWSRC_TELEMETRY_STREAMING) {
|
||||
lcd_putsAtt(x, y, "Tele", att);
|
||||
lcdDrawText(x, y, "Tele", att);
|
||||
}
|
||||
else {
|
||||
lcd_putsnAtt(x, y, g_model.telemetrySensors[idx-SWSRC_FIRST_SENSOR].label, TELEM_LABEL_LEN, ZCHAR|att);
|
||||
lcdDrawTextWithLen(x, y, g_model.telemetrySensors[idx-SWSRC_FIRST_SENSOR].label, TELEM_LABEL_LEN, ZCHAR|att);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -621,7 +623,7 @@ void putsSwitches(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
|||
void putsFlightMode(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
||||
{
|
||||
if (idx==0) {
|
||||
lcd_putsiAtt(x, y, STR_MMMINV, 0, att);
|
||||
lcdDrawTextAtIndex(x, y, STR_MMMINV, 0, att);
|
||||
}
|
||||
else {
|
||||
putsStrIdx(x, y, STR_FP, abs(idx)-1, att);
|
||||
|
@ -634,17 +636,17 @@ void putsCurveRef(coord_t x, coord_t y, CurveRef &curve, LcdFlags att)
|
|||
if (curve.value != 0) {
|
||||
switch (curve.type) {
|
||||
case CURVE_REF_DIFF:
|
||||
lcd_putsAtt(x, y, "D", att);
|
||||
lcdDrawText(x, y, "D", att);
|
||||
GVAR_MENU_ITEM(lcdNextPos, y, curve.value, -100, 100, LEFT|att, 0, 0);
|
||||
break;
|
||||
|
||||
case CURVE_REF_EXPO:
|
||||
lcd_putsAtt(x, y, "E", att);
|
||||
lcdDrawText(x, y, "E", att);
|
||||
GVAR_MENU_ITEM(lcdNextPos, y, curve.value, -100, 100, LEFT|att, 0, 0);
|
||||
break;
|
||||
|
||||
case CURVE_REF_FUNC:
|
||||
lcd_putsiAtt(x, y, STR_VCURVEFUNC, curve.value, att);
|
||||
lcdDrawTextAtIndex(x, y, STR_VCURVEFUNC, curve.value, att);
|
||||
break;
|
||||
|
||||
case CURVE_REF_CUSTOM:
|
||||
|
@ -657,7 +659,7 @@ void putsCurveRef(coord_t x, coord_t y, CurveRef &curve, LcdFlags att)
|
|||
void putsCurve(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
||||
{
|
||||
if (idx == 0) {
|
||||
return lcd_putsiAtt(x, y, STR_MMMINV, 0, att);
|
||||
return lcdDrawTextAtIndex(x, y, STR_MMMINV, 0, att);
|
||||
}
|
||||
bool neg = false;
|
||||
if (idx < 0) {
|
||||
|
@ -676,7 +678,7 @@ void putsTimerMode(coord_t x, coord_t y, int8_t mode, LcdFlags att)
|
|||
{
|
||||
if (mode >= 0) {
|
||||
if (mode < TMRMODE_COUNT)
|
||||
return lcd_putsiAtt(x, y, STR_VTMRMODES, mode, att);
|
||||
return lcdDrawTextAtIndex(x, y, STR_VTMRMODES, mode, att);
|
||||
else
|
||||
mode -= (TMRMODE_COUNT-1);
|
||||
}
|
||||
|
@ -690,13 +692,13 @@ void putsTrimMode(coord_t x, coord_t y, uint8_t phase, uint8_t idx, LcdFlags att
|
|||
unsigned int p = mode >> 1;
|
||||
|
||||
if (mode == TRIM_MODE_NONE) {
|
||||
lcd_putsAtt(x, y, "--", att);
|
||||
lcdDrawText(x, y, "--", att);
|
||||
}
|
||||
else {
|
||||
char s[2];
|
||||
s[0] = (mode % 2 == 0) ? ':' : '+';
|
||||
s[1] = '0'+p;
|
||||
lcd_putsnAtt(x, y, s, 2, att);
|
||||
lcdDrawTextWithLen(x, y, s, 2, att);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -908,7 +910,7 @@ void lcdDrawBitmap(coord_t x, coord_t y, const uint16_t * img, coord_t offset, c
|
|||
|
||||
void lcdDrawBlackOverlay()
|
||||
{
|
||||
lcdDrawFilledRect(0, 0, LCD_W, LCD_H, SOLID, TEXT_COLOR | (8<<24));
|
||||
// lcdDrawFilledRect(0, 0, LCD_W, LCD_H, SOLID, TEXT_COLOR | (8<<24));
|
||||
}
|
||||
|
||||
void lcdDrawCircle(int x0, int y0, int radius)
|
||||
|
|
|
@ -186,16 +186,15 @@ extern uint32_t CurrentFrameBuffer;
|
|||
|
||||
#define lcdRefreshWait()
|
||||
|
||||
|
||||
#define DISPLAY_END (displayBuf + DISPLAY_BUFFER_SIZE)
|
||||
#define ASSERT_IN_DISPLAY(p) assert((p) >= displayBuf && (p) < DISPLAY_END)
|
||||
|
||||
extern coord_t lcdNextPos;
|
||||
|
||||
void lcdDrawChar(coord_t x, coord_t y, const unsigned char c, LcdFlags attr=TEXT_COLOR);
|
||||
void lcd_putsAtt(coord_t x, coord_t y, const pm_char * s, LcdFlags attr=TEXT_COLOR);
|
||||
void lcd_putsiAtt(coord_t x, coord_t y, const pm_char * s, uint8_t idx, LcdFlags attr=TEXT_COLOR);
|
||||
void lcd_putsnAtt(coord_t x, coord_t y, const pm_char * s, unsigned char len, LcdFlags attr=TEXT_COLOR);
|
||||
void lcdDrawText(coord_t x, coord_t y, const pm_char * s, LcdFlags attr=TEXT_COLOR);
|
||||
void lcdDrawTextAtIndex(coord_t x, coord_t y, const pm_char * s, uint8_t idx, LcdFlags attr=TEXT_COLOR);
|
||||
void lcdDrawTextWithLen(coord_t x, coord_t y, const pm_char * s, unsigned char len, LcdFlags attr=TEXT_COLOR);
|
||||
void lcd_puts(coord_t x, coord_t y, const pm_char * s);
|
||||
void lcd_putsn(coord_t x, coord_t y, const pm_char * s, unsigned char len);
|
||||
void lcd_putsLeft(coord_t y, const pm_char * s);
|
||||
|
|
|
@ -82,8 +82,8 @@ enum EnumTabDiag {
|
|||
|
||||
const MenuFuncP_PROGMEM menuTabGeneral[] PROGMEM = {
|
||||
menuGeneralSetup,
|
||||
CASE_SDCARD(menuGeneralSdManager)
|
||||
CASE_CPUARM(menuGeneralCustomFunctions)
|
||||
menuGeneralSdManager,
|
||||
menuGeneralCustomFunctions,
|
||||
menuGeneralTrainer,
|
||||
menuGeneralCalib,
|
||||
menuGeneralVersion,
|
||||
|
|
|
@ -209,7 +209,13 @@ void menuGeneralSdManager(evt_t _event)
|
|||
break;
|
||||
|
||||
case EVT_KEY_BREAK(KEY_ENTER):
|
||||
if (s_editMode > 0) {
|
||||
if (m_posVert < 0) {
|
||||
if (reusableBuffer.sdmanager.count > 0) {
|
||||
m_posVert = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if (s_editMode > 0) {
|
||||
break;
|
||||
}
|
||||
else {
|
||||
|
@ -227,6 +233,9 @@ void menuGeneralSdManager(evt_t _event)
|
|||
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
killEvents(_event);
|
||||
if (m_posVert < 0) {
|
||||
break;
|
||||
}
|
||||
if (s_editMode == 0) {
|
||||
char *line = reusableBuffer.sdmanager.lines[index];
|
||||
char *ext = getFileExtension(line, SD_SCREEN_FILE_LENGTH+1);
|
||||
|
@ -348,10 +357,10 @@ void menuGeneralSdManager(evt_t _event)
|
|||
if (!reusableBuffer.sdmanager.lines[i][SD_SCREEN_FILE_LENGTH+1]) {
|
||||
char s[SD_SCREEN_FILE_LENGTH+1+2];
|
||||
sprintf(s, "[%s]", reusableBuffer.sdmanager.lines[i]);
|
||||
lcd_putsAtt(MENUS_MARGIN_LEFT, y, s, attr);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, s, attr);
|
||||
}
|
||||
else {
|
||||
lcd_putsAtt(MENUS_MARGIN_LEFT, y, reusableBuffer.sdmanager.lines[i], attr);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, reusableBuffer.sdmanager.lines[i], attr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
|
||||
#define SLIDER_5POS(y, value, label, event, attr) { \
|
||||
int8_t tmp = value; \
|
||||
displaySlider(RADIO_SETUP_2ND_COLUMN, y, 2+tmp, 4, attr); \
|
||||
drawSlider(RADIO_SETUP_2ND_COLUMN, y, 2+tmp, 4, attr); \
|
||||
value = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, label, NULL, tmp, -2, +2, attr, event); \
|
||||
}
|
||||
|
||||
|
@ -70,11 +70,11 @@ enum menuGeneralSetupItems {
|
|||
ITEM_SETUP_SPEAKER_PITCH,
|
||||
ITEM_SETUP_WAV_VOLUME,
|
||||
ITEM_SETUP_BACKGROUND_VOLUME,
|
||||
CASE_VARIO_CPUARM(ITEM_SETUP_VARIO_LABEL)
|
||||
CASE_VARIO_CPUARM(ITEM_SETUP_VARIO_VOLUME)
|
||||
CASE_VARIO_CPUARM(ITEM_SETUP_VARIO_PITCH)
|
||||
CASE_VARIO_CPUARM(ITEM_SETUP_VARIO_RANGE)
|
||||
CASE_VARIO_CPUARM(ITEM_SETUP_VARIO_REPEAT)
|
||||
CASE_VARIO(ITEM_SETUP_VARIO_LABEL)
|
||||
CASE_VARIO(ITEM_SETUP_VARIO_VOLUME)
|
||||
CASE_VARIO(ITEM_SETUP_VARIO_PITCH)
|
||||
CASE_VARIO(ITEM_SETUP_VARIO_RANGE)
|
||||
CASE_VARIO(ITEM_SETUP_VARIO_REPEAT)
|
||||
CASE_HAPTIC(ITEM_SETUP_HAPTIC_LABEL)
|
||||
CASE_HAPTIC(ITEM_SETUP_HAPTIC_MODE)
|
||||
CASE_HAPTIC(ITEM_SETUP_HAPTIC_LENGTH)
|
||||
|
@ -112,7 +112,7 @@ void menuGeneralSetup(evt_t event)
|
|||
|
||||
if ((m_posVert==ITEM_SETUP_DATE || m_posVert==ITEM_SETUP_TIME) &&
|
||||
(s_editMode>0) &&
|
||||
(event==EVT_KEY_FIRST(KEY_ENTER) || event==EVT_KEY_FIRST(KEY_EXIT) || IS_ROTARY_BREAK(event) || IS_ROTARY_LONG(event))) {
|
||||
(event==EVT_KEY_FIRST(KEY_ENTER) || event==EVT_KEY_BREAK(KEY_ENTER) || event==EVT_KEY_LONG(KEY_ENTER) || event==EVT_KEY_FIRST(KEY_EXIT))) {
|
||||
// set the date and time into RTC chip
|
||||
rtcSetTime(&t);
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ void menuGeneralSetup(evt_t event)
|
|||
}
|
||||
#endif
|
||||
|
||||
MENU(STR_MENURADIOSETUP, menuTabGeneral, e_Setup, ITEM_SETUP_MAX, DEFAULT_SCROLLBAR_X, { 2|NAVIGATION_LINE_BY_LINE, 2|NAVIGATION_LINE_BY_LINE, LABEL(SOUND), 0, 0, 0, 0, 0, 0, 0, CASE_VARIO_CPUARM(LABEL(VARIO)) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_HAPTIC(LABEL(HAPTIC)) CASE_HAPTIC(0) CASE_HAPTIC(0) CASE_HAPTIC(0) LABEL(ALARMS), 0, 0, 0, CASE_GPS(0) CASE_GPS(0) CASE_PXX(0) 0, 0, CASE_MAVLINK(0) 0, 0, 0, 0, 1/*to force edit mode*/ });
|
||||
MENU(STR_MENURADIOSETUP, menuTabGeneral, e_Setup, ITEM_SETUP_MAX, DEFAULT_SCROLLBAR_X, { 2|NAVIGATION_LINE_BY_LINE, 2|NAVIGATION_LINE_BY_LINE, LABEL(SOUND), 0, 0, 0, 0, 0, 0, 0, CASE_VARIO(LABEL(VARIO)) CASE_VARIO(0) CASE_VARIO(0) CASE_VARIO(0) CASE_VARIO(0) CASE_HAPTIC(LABEL(HAPTIC)) CASE_HAPTIC(0) CASE_HAPTIC(0) CASE_HAPTIC(0) LABEL(ALARMS), 0, 0, 0, CASE_GPS(0) CASE_GPS(0) CASE_PXX(0) 0, 0, CASE_MAVLINK(0) 0, 0, 0, 0, 1/*to force edit mode*/ });
|
||||
|
||||
int sub = m_posVert;
|
||||
|
||||
|
@ -145,8 +145,8 @@ void menuGeneralSetup(evt_t event)
|
|||
flags |= INVERS;
|
||||
lcdDrawSolidFilledRect(RADIO_SETUP_2ND_COLUMN-INVERT_HORZ_MARGIN, y-INVERT_VERT_MARGIN, 85, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR);
|
||||
}
|
||||
lcd_putsAtt(RADIO_SETUP_2ND_COLUMN+YEAR_SEPARATOR_OFFSET, y, "-", flags);
|
||||
lcd_putsAtt(RADIO_SETUP_2ND_COLUMN+MONTH_SEPARATOR_OFFSET, y, "-", flags);
|
||||
lcdDrawText(RADIO_SETUP_2ND_COLUMN+YEAR_SEPARATOR_OFFSET, y, "-", flags);
|
||||
lcdDrawText(RADIO_SETUP_2ND_COLUMN+MONTH_SEPARATOR_OFFSET, y, "-", flags);
|
||||
for (uint8_t j=0; j<3; j++) {
|
||||
uint8_t rowattr = (m_posHorz==j ? attr : 0);
|
||||
switch (j) {
|
||||
|
@ -184,22 +184,22 @@ void menuGeneralSetup(evt_t event)
|
|||
flags |= INVERS;
|
||||
lcdDrawSolidFilledRect(RADIO_SETUP_2ND_COLUMN-INVERT_HORZ_MARGIN, y-INVERT_VERT_MARGIN, 85, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR);
|
||||
}
|
||||
lcd_putsAtt(RADIO_SETUP_2ND_COLUMN+HOUR_SEPARATOR_OFFSET, y, ":", flags);
|
||||
lcd_putsAtt(RADIO_SETUP_2ND_COLUMN+MINUTE_SEPARATOR_OFFSET, y, ":", flags);
|
||||
lcdDrawText(RADIO_SETUP_2ND_COLUMN+HOUR_SEPARATOR_OFFSET, y, ":", flags);
|
||||
lcdDrawText(RADIO_SETUP_2ND_COLUMN+MINUTE_SEPARATOR_OFFSET, y, ":", flags);
|
||||
for (uint8_t j=0; j<3; j++) {
|
||||
uint8_t rowattr = (m_posHorz==j ? attr : 0);
|
||||
switch (j) {
|
||||
case 0:
|
||||
lcd_outdezNAtt(RADIO_SETUP_2ND_COLUMN, y, t.tm_hour, flags|rowattr|LEFT|LEADING0, 2);
|
||||
if (rowattr && s_editMode>0) t.tm_hour = checkIncDec(event, t.tm_hour, 0, 23, 0);
|
||||
lcd_outdezNAtt(RADIO_SETUP_2ND_COLUMN, y, t.tm_hour, flags|rowattr|LEFT|LEADING0, 2);
|
||||
break;
|
||||
case 1:
|
||||
lcd_outdezNAtt(RADIO_SETUP_2ND_COLUMN+MINUTE_OFFSET, y, t.tm_min, flags|rowattr|LEFT|LEADING0, 2);
|
||||
if (rowattr && s_editMode>0) t.tm_min = checkIncDec(event, t.tm_min, 0, 59, 0);
|
||||
lcd_outdezNAtt(RADIO_SETUP_2ND_COLUMN+MINUTE_OFFSET, y, t.tm_min, flags|rowattr|LEFT|LEADING0, 2);
|
||||
break;
|
||||
case 2:
|
||||
lcd_outdezNAtt(RADIO_SETUP_2ND_COLUMN+SECOND_OFFSET, y, t.tm_sec, flags|rowattr|LEFT|LEADING0, 2);
|
||||
if (rowattr && s_editMode>0) t.tm_sec = checkIncDec(event, t.tm_sec, 0, 59, 0);
|
||||
lcd_outdezNAtt(RADIO_SETUP_2ND_COLUMN+SECOND_OFFSET, y, t.tm_sec, flags|rowattr|LEFT|LEADING0, 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -245,7 +245,7 @@ void menuGeneralSetup(evt_t event)
|
|||
{
|
||||
lcd_putsLeft(y, STR_SPEAKER_VOLUME);
|
||||
uint8_t b = g_eeGeneral.speakerVolume+VOLUME_LEVEL_DEF;
|
||||
displaySlider(RADIO_SETUP_2ND_COLUMN, y, b, VOLUME_LEVEL_MAX, attr);
|
||||
drawSlider(RADIO_SETUP_2ND_COLUMN, y, b, VOLUME_LEVEL_MAX, attr);
|
||||
if (attr) {
|
||||
CHECK_INCDEC_GENVAR(event, b, 0, VOLUME_LEVEL_MAX);
|
||||
if (checkIncDec_Ret) {
|
||||
|
@ -409,7 +409,7 @@ void menuGeneralSetup(evt_t event)
|
|||
|
||||
case ITEM_SETUP_BACKLIGHT_COLOR:
|
||||
lcd_putsLeft(y, STR_BLCOLOR);
|
||||
displaySlider(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.backlightColor, 20, attr);
|
||||
drawSlider(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.backlightColor, 20, attr);
|
||||
if (attr) g_eeGeneral.backlightColor = checkIncDec(event, g_eeGeneral.backlightColor, 0, 20, EE_GENERAL | NO_INCDEC_MARKS);
|
||||
break;
|
||||
#endif
|
||||
|
@ -422,7 +422,7 @@ void menuGeneralSetup(evt_t event)
|
|||
lcd_outdezAtt(RADIO_SETUP_2ND_COLUMN, y, SPLASH_TIMEOUT/100, attr|LEFT, "s");
|
||||
}
|
||||
else {
|
||||
lcd_putsiAtt(RADIO_SETUP_2ND_COLUMN, y, STR_MMMINV, 0, attr); // TODO define
|
||||
lcdDrawTextAtIndex(RADIO_SETUP_2ND_COLUMN, y, STR_MMMINV, 0, attr); // TODO define
|
||||
}
|
||||
if (attr) g_eeGeneral.splashMode = -checkIncDecGen(event, -g_eeGeneral.splashMode, -3, 4);
|
||||
break;
|
||||
|
@ -445,7 +445,7 @@ void menuGeneralSetup(evt_t event)
|
|||
|
||||
case ITEM_SETUP_LANGUAGE:
|
||||
lcd_putsLeft(y, STR_VOICELANG);
|
||||
lcd_putsAtt(RADIO_SETUP_2ND_COLUMN, y, currentLanguagePack->name, attr);
|
||||
lcdDrawText(RADIO_SETUP_2ND_COLUMN, y, currentLanguagePack->name, attr);
|
||||
if (attr) {
|
||||
currentLanguagePackIdx = checkIncDec(event, currentLanguagePackIdx, 0, DIM(languagePacks)-2, EE_GENERAL);
|
||||
if (checkIncDec_Ret) {
|
||||
|
@ -491,7 +491,7 @@ void menuGeneralSetup(evt_t event)
|
|||
s[i] = STR_RETA123[channel_order(i+1)];
|
||||
}
|
||||
s[4] = '\0';
|
||||
lcd_putsAtt(RADIO_SETUP_2ND_COLUMN, y, s, attr);
|
||||
lcdDrawText(RADIO_SETUP_2ND_COLUMN, y, s, attr);
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.templateSetup, 0, 23);
|
||||
break;
|
||||
}
|
||||
|
@ -501,7 +501,7 @@ void menuGeneralSetup(evt_t event)
|
|||
lcd_putsLeft(y, NO_INDENT(STR_MODE));
|
||||
char s[2] = " ";
|
||||
s[0] = '1'+g_eeGeneral.stickMode;
|
||||
lcd_putsAtt(RADIO_SETUP_2ND_COLUMN, y, s, attr);
|
||||
lcdDrawText(RADIO_SETUP_2ND_COLUMN, y, s, attr);
|
||||
for (uint8_t i=0; i<4; i++) {
|
||||
putsMixerSource(RADIO_SETUP_2ND_COLUMN + 40 + 50*i, y, MIXSRC_Rud + pgm_read_byte(modn12x3 + 4*g_eeGeneral.stickMode + i));
|
||||
}
|
||||
|
|
|
@ -58,9 +58,9 @@ void menuGeneralTrainer(evt_t event)
|
|||
uint8_t attr;
|
||||
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
||||
|
||||
/* lcd_putsAtt(TRAINER_COLUMN_1, MENU_HEADER_HEIGHT+1, "Mode", HEADER_COLOR);
|
||||
lcd_putsAtt(TRAINER_COLUMN_2, MENU_HEADER_HEIGHT+1, "Weight", HEADER_COLOR);
|
||||
lcd_putsAtt(TRAINER_COLUMN_3, MENU_HEADER_HEIGHT+1, "Source", HEADER_COLOR);
|
||||
/* lcdDrawText(TRAINER_COLUMN_1, MENU_HEADER_HEIGHT+1, "Mode", HEADER_COLOR);
|
||||
lcdDrawText(TRAINER_COLUMN_2, MENU_HEADER_HEIGHT+1, "Weight", HEADER_COLOR);
|
||||
lcdDrawText(TRAINER_COLUMN_3, MENU_HEADER_HEIGHT+1, "Source", HEADER_COLOR);
|
||||
*/
|
||||
|
||||
y = MENU_CONTENT_TOP + FH;
|
||||
|
@ -78,7 +78,7 @@ void menuGeneralTrainer(evt_t event)
|
|||
|
||||
switch(j) {
|
||||
case 0:
|
||||
lcd_putsiAtt(TRAINER_COLUMN_1, y, STR_TRNMODE, td->mode, attr);
|
||||
lcdDrawTextAtIndex(TRAINER_COLUMN_1, y, STR_TRNMODE, td->mode, attr);
|
||||
if (attr&BLINK) CHECK_INCDEC_GENVAR(event, td->mode, 0, 2);
|
||||
break;
|
||||
|
||||
|
@ -88,7 +88,7 @@ void menuGeneralTrainer(evt_t event)
|
|||
break;
|
||||
|
||||
case 2:
|
||||
lcd_putsiAtt(TRAINER_COLUMN_3, y, STR_TRNCHN, td->srcChn, attr);
|
||||
lcdDrawTextAtIndex(TRAINER_COLUMN_3, y, STR_TRNCHN, td->srcChn, attr);
|
||||
if (attr&BLINK) CHECK_INCDEC_GENVAR(event, td->srcChn, 0, 3);
|
||||
break;
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ void menuGeneralTrainer(evt_t event)
|
|||
|
||||
attr = (sub==6) ? INVERS : 0;
|
||||
if (attr) s_editMode = 0;
|
||||
lcd_putsAtt(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 6*FH, STR_CAL, attr);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 6*FH, STR_CAL, attr);
|
||||
for (int i=0; i<4; i++) {
|
||||
#if defined (PPM_UNIT_PERCENT_PREC1)
|
||||
lcd_outdezAtt(TRAINER_COLUMN_1+i*TRAINER_COLUMN_WIDTH, MENU_CONTENT_TOP + 6*FH, (ppmInput[i]-g_eeGeneral.trainer.calib[i])*2, LEFT|PREC1);
|
||||
|
|
|
@ -79,7 +79,7 @@ void editCurveRef(coord_t x, coord_t y, CurveRef & curve, evt_t event, uint8_t a
|
|||
|
||||
uint8_t editDelay(const coord_t x, const coord_t y, const evt_t event, const uint8_t attr, const pm_char *str, uint8_t delay)
|
||||
{
|
||||
lcd_putsAtt(x+MENUS_MARGIN_LEFT, y, str, TEXT_COLOR);
|
||||
lcdDrawText(x+MENUS_MARGIN_LEFT, y, str, TEXT_COLOR);
|
||||
lcd_outdezAtt(x+MIXES_2ND_COLUMN, y, (10/DELAY_STEP)*delay, attr|PREC1|LEFT);
|
||||
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, delay, DELAY_MAX);
|
||||
return delay;
|
||||
|
@ -118,18 +118,19 @@ static uint8_t editNameCursorPos = 0;
|
|||
|
||||
void editName(coord_t x, coord_t y, char * name, uint8_t size, evt_t event, uint8_t active)
|
||||
{
|
||||
uint8_t mode = 0;
|
||||
uint8_t flags = 0;
|
||||
if (active && s_editMode <= 0) {
|
||||
mode = INVERS;
|
||||
flags = INVERS;
|
||||
}
|
||||
|
||||
if (!active || s_editMode <= 0) {
|
||||
if (zlen(name, size) == 0) {
|
||||
uint8_t len = zlen(name, size);
|
||||
if (len == 0) {
|
||||
char tmp[] = "---";
|
||||
lcd_putsnAtt(x, y, tmp, size, mode);
|
||||
lcdDrawTextWithLen(x, y, tmp, size, flags);
|
||||
}
|
||||
else {
|
||||
lcd_putsnAtt(x, y, name, size, ZCHAR | mode);
|
||||
lcdDrawTextWithLen(x, y, name, len, ZCHAR | flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -139,13 +140,20 @@ void editName(coord_t x, coord_t y, char * name, uint8_t size, evt_t event, uint
|
|||
int8_t c = name[cur];
|
||||
int8_t v = c;
|
||||
|
||||
if (IS_ROTARY_RIGHT(event) || IS_ROTARY_LEFT(event) || event==EVT_KEY_FIRST(KEY_DOWN) || event==EVT_KEY_FIRST(KEY_UP)
|
||||
|| event==EVT_KEY_REPT(KEY_DOWN) || event==EVT_KEY_REPT(KEY_UP)) {
|
||||
if (event==EVT_ROTARY_RIGHT || event==EVT_ROTARY_LEFT) {
|
||||
v = checkIncDec(event, abs(v), 0, ZCHAR_MAX, 0);
|
||||
if (c <= 0) v = -v;
|
||||
}
|
||||
|
||||
switch (event) {
|
||||
case EVT_KEY_BREAK(KEY_LEFT):
|
||||
if (cur>0) cur--;
|
||||
break;
|
||||
|
||||
case EVT_KEY_BREAK(KEY_RIGHT):
|
||||
if (cur<size-1) cur++;
|
||||
break;
|
||||
|
||||
case EVT_ROTARY_BREAK:
|
||||
if (s_editMode == EDIT_MODIFY_FIELD) {
|
||||
s_editMode = EDIT_MODIFY_STRING;
|
||||
|
@ -163,6 +171,10 @@ void editName(coord_t x, coord_t y, char * name, uint8_t size, evt_t event, uint
|
|||
killEvents(event);
|
||||
break;
|
||||
}
|
||||
// no break
|
||||
|
||||
case EVT_KEY_LONG(KEY_LEFT):
|
||||
case EVT_KEY_LONG(KEY_RIGHT):
|
||||
if (v>=-26 && v<=26) {
|
||||
v = -v; // toggle case
|
||||
if (event==EVT_KEY_LONG(KEY_LEFT))
|
||||
|
@ -176,11 +188,11 @@ void editName(coord_t x, coord_t y, char * name, uint8_t size, evt_t event, uint
|
|||
storageDirty(g_menuPos[0] == 0 ? EE_MODEL : EE_GENERAL);
|
||||
}
|
||||
|
||||
lcd_putsnAtt(x, y, name, size, ZCHAR | mode);
|
||||
lcdDrawTextWithLen(x, y, name, size, ZCHAR | flags);
|
||||
coord_t w = (editNameCursorPos == 0 ? 0 : getTextWidth(name, editNameCursorPos, ZCHAR));
|
||||
char s[] = { idx2char(v), '\0' };
|
||||
lcdDrawSolidFilledRect(x+w-1, y-INVERT_VERT_MARGIN, getTextWidth(s, 1)+1, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR);
|
||||
lcd_putsAtt(x+w, y, s, TEXT_INVERTED_COLOR);
|
||||
lcdDrawText(x+w, y, s, TEXT_INVERTED_COLOR);
|
||||
}
|
||||
else {
|
||||
cur = 0;
|
||||
|
|
|
@ -150,7 +150,7 @@ void menuModelCurveOne(evt_t event)
|
|||
|
||||
LcdFlags attr = (m_posVert==1 ? (s_editMode>0 ? INVERS|BLINK : INVERS) : 0);
|
||||
lcd_putsLeft(MENU_CONTENT_TOP + 2*FH, "Type");
|
||||
lcd_putsiAtt(MENUS_MARGIN_LEFT+INDENT_WIDTH, MENU_CONTENT_TOP + 3*FH, STR_CURVE_TYPES, crv.type, attr);
|
||||
lcdDrawTextAtIndex(MENUS_MARGIN_LEFT+INDENT_WIDTH, MENU_CONTENT_TOP + 3*FH, STR_CURVE_TYPES, crv.type, attr);
|
||||
if (attr) {
|
||||
uint8_t newType = checkIncDecModelZero(event, crv.type, CURVE_TYPE_LAST);
|
||||
if (newType != crv.type) {
|
||||
|
@ -187,7 +187,7 @@ void menuModelCurveOne(evt_t event)
|
|||
}
|
||||
|
||||
lcd_putsLeft(MENU_CONTENT_TOP + 6*FH, STR_SMOOTH);
|
||||
lcdDrawCheckBox(lcdNextPos + 10, MENU_CONTENT_TOP + 6*FH, crv.smooth, m_posVert==3 ? INVERS : 0);
|
||||
drawCheckBox(lcdNextPos + 10, MENU_CONTENT_TOP + 6*FH, crv.smooth, m_posVert==3 ? INVERS : 0);
|
||||
if (m_posVert==3) crv.smooth = checkIncDecModel(event, crv.smooth, 0, 1);
|
||||
|
||||
switch(event) {
|
||||
|
@ -212,8 +212,8 @@ void menuModelCurveOne(evt_t event)
|
|||
DrawCurve(6);
|
||||
}
|
||||
|
||||
// lcd_putsAtt(115, MENU_FOOTER_TOP, "X", HEADER_COLOR);
|
||||
// lcd_putsAtt(145, MENU_FOOTER_TOP, "Y", HEADER_COLOR);
|
||||
// lcdDrawText(115, MENU_FOOTER_TOP, "X", HEADER_COLOR);
|
||||
// lcdDrawText(145, MENU_FOOTER_TOP, "Y", HEADER_COLOR);
|
||||
|
||||
coord_t posY = MENU_CONTENT_TOP;
|
||||
attr = (s_editMode > 0 ? INVERS|BLINK : INVERS);
|
||||
|
@ -256,13 +256,13 @@ void menuModelCurveOne(evt_t event)
|
|||
}
|
||||
|
||||
if (5+crv.points > NUM_BODY_LINES) {
|
||||
lcdDrawScrollbar(250, DEFAULT_SCROLLBAR_Y, DEFAULT_SCROLLBAR_H, pointsOfs, 5+crv.points, NUM_BODY_LINES);
|
||||
drawScrollbar(250, DEFAULT_SCROLLBAR_Y, DEFAULT_SCROLLBAR_H, pointsOfs, 5+crv.points, NUM_BODY_LINES);
|
||||
}
|
||||
}
|
||||
|
||||
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, evt_t event, uint8_t attr)
|
||||
{
|
||||
lcd_putsiAtt(x, y, "\004DiffExpoFuncCstm", curve.type, (m_posHorz==0 ? attr : 0));
|
||||
lcdDrawTextAtIndex(x, y, "\004DiffExpoFuncCstm", curve.type, (m_posHorz==0 ? attr : 0));
|
||||
if (attr && m_posHorz==0) {
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, curve.type, CURVE_REF_CUSTOM);
|
||||
if (checkIncDec_Ret) curve.value = 0;
|
||||
|
@ -273,7 +273,7 @@ void editCurveRef(coord_t x, coord_t y, CurveRef & curve, evt_t event, uint8_t a
|
|||
curve.value = GVAR_MENU_ITEM(lcdNextPos+10, y, curve.value, -100, 100, m_posHorz==1 ? LEFT|attr : LEFT, 0, event);
|
||||
break;
|
||||
case CURVE_REF_FUNC:
|
||||
lcd_putsiAtt(lcdNextPos+10, y, STR_VCURVEFUNC, curve.value, (m_posHorz==1 ? attr : 0));
|
||||
lcdDrawTextAtIndex(lcdNextPos+10, y, STR_VCURVEFUNC, curve.value, (m_posHorz==1 ? attr : 0));
|
||||
if (attr && m_posHorz==1) CHECK_INCDEC_MODELVAR_ZERO(event, curve.value, CURVE_BASE-1);
|
||||
break;
|
||||
case CURVE_REF_CUSTOM:
|
||||
|
|
|
@ -150,17 +150,17 @@ void menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunc
|
|||
LcdFlags active = (attr && s_editMode>0);
|
||||
switch (j) {
|
||||
case 0:
|
||||
putsSwitches(MODEL_CUSTOM_FUNC_1ST_COLUMN, y, CFN_SWITCH(cfn), attr | ((functionsContext.activeSwitches & ((MASK_CFN_TYPE)1 << k)) ? BOLD : 0));
|
||||
if (active || AUTOSWITCH_ENTER_LONG()) CHECK_INCDEC_SWITCH(event, CFN_SWITCH(cfn), SWSRC_FIRST, SWSRC_LAST, eeFlags, isSwitchAvailableInCustomFunctions);
|
||||
putsSwitches(MODEL_CUSTOM_FUNC_1ST_COLUMN, y, CFN_SWITCH(cfn), attr | ((functionsContext.activeSwitches & ((MASK_CFN_TYPE)1 << k)) ? BOLD : 0));
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (CFN_SWITCH(cfn)) {
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_2ND_COLUMN, y, STR_VFSWFUNC, func, attr);
|
||||
if (active) {
|
||||
func = CFN_FUNC(cfn) = checkIncDec(event, CFN_FUNC(cfn), 0, FUNC_MAX-1, eeFlags, isAssignableFunctionAvailable);
|
||||
if (checkIncDec_Ret) CFN_RESET(cfn);
|
||||
}
|
||||
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_2ND_COLUMN, y, STR_VFSWFUNC, func, attr);
|
||||
}
|
||||
else {
|
||||
j = 4; // skip other fields
|
||||
|
@ -212,7 +212,7 @@ void menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunc
|
|||
int16_t val_max = 255;
|
||||
if (func == FUNC_RESET) {
|
||||
val_max = FUNC_RESET_PARAM_LAST;
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_VFSWRESET, CFN_PARAM(cfn), attr);
|
||||
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_VFSWRESET, CFN_PARAM(cfn), attr);
|
||||
}
|
||||
#if defined(OVERRIDE_CHANNEL_FUNCTION)
|
||||
else if (func == FUNC_OVERRIDE_CHANNEL) {
|
||||
|
@ -223,7 +223,7 @@ void menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunc
|
|||
#if defined(DANGEROUS_MODULE_FUNCTIONS)
|
||||
else if (func >= FUNC_RANGECHECK && func <= FUNC_MODULE_OFF) {
|
||||
val_max = NUM_MODULES-1;
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, "\004Int.Ext.", CFN_PARAM(cfn), attr);
|
||||
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, "\004Int.Ext.", CFN_PARAM(cfn), attr);
|
||||
}
|
||||
#endif
|
||||
else if (func == FUNC_SET_TIMER) {
|
||||
|
@ -232,7 +232,7 @@ void menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunc
|
|||
}
|
||||
else if (func == FUNC_PLAY_SOUND) {
|
||||
val_max = AU_FRSKY_LAST-AU_FRSKY_FIRST-1;
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_FUNCSOUNDS, val_displayed, attr);
|
||||
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_FUNCSOUNDS, val_displayed, attr);
|
||||
}
|
||||
#if defined(HAPTIC)
|
||||
else if (func == FUNC_HAPTIC) {
|
||||
|
@ -244,9 +244,9 @@ void menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunc
|
|||
else if (func == FUNC_PLAY_TRACK || func == FUNC_BACKGND_MUSIC || func == FUNC_PLAY_SCRIPT) {
|
||||
coord_t x = MODEL_CUSTOM_FUNC_3RD_COLUMN;
|
||||
if (ZEXIST(cfn->play.name))
|
||||
lcd_putsnAtt(x, y, cfn->play.name, sizeof(cfn->play.name), attr);
|
||||
lcdDrawTextWithLen(x, y, cfn->play.name, sizeof(cfn->play.name), attr);
|
||||
else
|
||||
lcd_putsiAtt(x, y, STR_VCSWFUNC, 0, attr);
|
||||
lcdDrawTextAtIndex(x, y, STR_VCSWFUNC, 0, attr);
|
||||
if (active && event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
s_editMode = 0;
|
||||
char directory[256];
|
||||
|
@ -284,12 +284,12 @@ void menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunc
|
|||
lcd_outdezAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|PREC1|LEFT, "s");
|
||||
}
|
||||
else {
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_MMMINV, 0, attr);
|
||||
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_MMMINV, 0, attr);
|
||||
}
|
||||
}
|
||||
#if defined(REVPLUS)
|
||||
else if (func == FUNC_BACKLIGHT) {
|
||||
displaySlider(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, CFN_PARAM(cfn), 100, attr);
|
||||
drawSlider(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, CFN_PARAM(cfn), 100, attr);
|
||||
INCDEC_SET_FLAG(eeFlags | NO_INCDEC_MARKS);
|
||||
val_min = 0;
|
||||
val_max = 100;
|
||||
|
@ -315,7 +315,7 @@ void menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunc
|
|||
break;
|
||||
default: // FUNC_ADJUST_GVAR_INC
|
||||
val_max = 1;
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, PSTR("\003-=1+=1"), val_displayed, attr);
|
||||
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, PSTR("\003-=1+=1"), val_displayed, attr);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -341,20 +341,20 @@ void menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunc
|
|||
|
||||
case 4:
|
||||
if (HAS_ENABLE_PARAM(func)) {
|
||||
lcdDrawCheckBox(MODEL_CUSTOM_FUNC_4TH_COLUMN_ONOFF, y, CFN_ACTIVE(cfn), attr);
|
||||
if (active) CFN_ACTIVE(cfn) = checkIncDec(event, CFN_ACTIVE(cfn), 0, 1, eeFlags);
|
||||
drawCheckBox(MODEL_CUSTOM_FUNC_4TH_COLUMN_ONOFF, y, CFN_ACTIVE(cfn), attr);
|
||||
}
|
||||
else if (HAS_REPEAT_PARAM(func)) {
|
||||
if (active) CFN_PLAY_REPEAT(cfn) = checkIncDec(event, CFN_PLAY_REPEAT(cfn)==CFN_PLAY_REPEAT_NOSTART?-1:CFN_PLAY_REPEAT(cfn), -1, 60/CFN_PLAY_REPEAT_MUL, eeFlags);
|
||||
if (CFN_PLAY_REPEAT(cfn) == 0) {
|
||||
lcd_putsAtt(MODEL_CUSTOM_FUNC_4TH_COLUMN+2, y, "1x", attr);
|
||||
lcdDrawText(MODEL_CUSTOM_FUNC_4TH_COLUMN+2, y, "1x", attr);
|
||||
}
|
||||
else if (CFN_PLAY_REPEAT(cfn) == CFN_PLAY_REPEAT_NOSTART) {
|
||||
lcd_putsAtt(MODEL_CUSTOM_FUNC_4TH_COLUMN-1, y, "!1x", attr);
|
||||
lcdDrawText(MODEL_CUSTOM_FUNC_4TH_COLUMN-1, y, "!1x", attr);
|
||||
}
|
||||
else {
|
||||
lcd_outdezAtt(MODEL_CUSTOM_FUNC_4TH_COLUMN+12, y, CFN_PLAY_REPEAT(cfn)*CFN_PLAY_REPEAT_MUL, attr, "s");
|
||||
}
|
||||
if (active) CFN_PLAY_REPEAT(cfn) = checkIncDec(event, CFN_PLAY_REPEAT(cfn)==CFN_PLAY_REPEAT_NOSTART?-1:CFN_PLAY_REPEAT(cfn), -1, 60/CFN_PLAY_REPEAT_MUL, eeFlags);
|
||||
}
|
||||
else if (attr) {
|
||||
REPEAT_LAST_CURSOR_MOVE();
|
||||
|
|
|
@ -62,12 +62,15 @@ bool isTrimModeAvailable(int mode)
|
|||
|
||||
void menuModelFlightModesAll(evt_t event)
|
||||
{
|
||||
MENU(STR_MENUFLIGHTPHASES, menuTabModel, e_FlightModesAll, MAX_FLIGHT_MODES+1, DEFAULT_SCROLLBAR_X, { NAVIGATION_LINE_BY_LINE|(ITEM_FLIGHT_MODES_LAST-1), NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, 0});
|
||||
MENU(STR_MENUFLIGHTPHASES, menuTabModel, e_FlightModesAll, MAX_FLIGHT_MODES+1, DEFAULT_SCROLLBAR_X, { NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, 0});
|
||||
|
||||
int sub = m_posVert;
|
||||
|
||||
horzpos_t posHorz = m_posHorz;
|
||||
if (sub==0 && posHorz > 0) { posHorz += 1; }
|
||||
if (sub==0 && posHorz == 1) {
|
||||
REPEAT_LAST_CURSOR_MOVE();
|
||||
posHorz = m_posHorz;
|
||||
}
|
||||
|
||||
if (sub<MAX_FLIGHT_MODES && posHorz>=0) {
|
||||
displayColumnHeader(STR_PHASES_HEADERS, posHorz);
|
||||
|
@ -119,11 +122,11 @@ void menuModelFlightModesAll(evt_t event)
|
|||
break;
|
||||
|
||||
case ITEM_FLIGHT_MODES_SWITCH:
|
||||
if (active) CHECK_INCDEC_MODELSWITCH(event, p->swtch, SWSRC_FIRST_IN_MIXES, SWSRC_LAST_IN_MIXES, isSwitchAvailableInMixes);
|
||||
if (k == 0)
|
||||
lcd_puts(FLIGHT_MODES_SWITCH_COLUMN, y, "N/A");
|
||||
else
|
||||
putsSwitches(FLIGHT_MODES_SWITCH_COLUMN, y, p->swtch, attr);
|
||||
if (active) CHECK_INCDEC_MODELSWITCH(event, p->swtch, SWSRC_FIRST_IN_MIXES, SWSRC_LAST_IN_MIXES, isSwitchAvailableInMixes);
|
||||
break;
|
||||
|
||||
case ITEM_FLIGHT_MODES_TRIM_RUD:
|
||||
|
@ -132,22 +135,22 @@ void menuModelFlightModesAll(evt_t event)
|
|||
case ITEM_FLIGHT_MODES_TRIM_AIL:
|
||||
{
|
||||
uint8_t t = j-ITEM_FLIGHT_MODES_TRIM_RUD;
|
||||
putsTrimMode(FLIGHT_MODES_TRIMS_COLUMN+j*FLIGHT_MODES_TRIM_WIDTH, y, k, t, attr);
|
||||
if (active) {
|
||||
trim_t & v = p->trim[t];
|
||||
v.mode = checkIncDec(event, v.mode==TRIM_MODE_NONE ? -1 : v.mode, -1, k==0 ? 0 : 2*MAX_FLIGHT_MODES-1, EE_MODEL, isTrimModeAvailable);
|
||||
}
|
||||
putsTrimMode(FLIGHT_MODES_TRIMS_COLUMN+j*FLIGHT_MODES_TRIM_WIDTH, y, k, t, attr);
|
||||
break;
|
||||
}
|
||||
|
||||
case ITEM_FLIGHT_MODES_FADE_IN:
|
||||
lcd_outdezAtt(FLIGHT_MODES_FADEIN_COLUMN, y, (10/DELAY_STEP)*p->fadeIn, attr|PREC1);
|
||||
if (active) p->fadeIn = checkIncDec(event, p->fadeIn, 0, DELAY_MAX, EE_MODEL|NO_INCDEC_MARKS);
|
||||
lcd_outdezAtt(FLIGHT_MODES_FADEIN_COLUMN, y, (10/DELAY_STEP)*p->fadeIn, attr|PREC1);
|
||||
break;
|
||||
|
||||
case ITEM_FLIGHT_MODES_FADE_OUT:
|
||||
lcd_outdezAtt(FLIGHT_MODES_FADEOUT_COLUMN, y, (10/DELAY_STEP)*p->fadeOut, attr|PREC1);
|
||||
if (active) p->fadeOut = checkIncDec(event, p->fadeOut, 0, DELAY_MAX, EE_MODEL|NO_INCDEC_MARKS);
|
||||
lcd_outdezAtt(FLIGHT_MODES_FADEOUT_COLUMN, y, (10/DELAY_STEP)*p->fadeOut, attr|PREC1);
|
||||
break;
|
||||
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ void displayFlightModes(coord_t x, coord_t y, FlightModesType value, uint8_t att
|
|||
if (attr && m_posHorz < 0) flags |= INVERS;
|
||||
char s[] = " ";
|
||||
s[0] = '0' + i;
|
||||
lcd_putsAtt(x, y, s, flags);
|
||||
lcdDrawText(x, y, s, flags);
|
||||
x += 12;
|
||||
}
|
||||
}
|
||||
|
@ -438,7 +438,7 @@ void menuModelExpoOne(evt_t event)
|
|||
uint8_t not_stick = (ed->srcRaw > MIXSRC_Ail);
|
||||
int8_t carryTrim = -ed->carryTrim;
|
||||
lcd_putsLeft(y, STR_TRIM);
|
||||
lcd_putsiAtt(EXPO_ONE_2ND_COLUMN, y, STR_VMIXTRIMS, (not_stick && carryTrim == 0) ? 0 : carryTrim+1, m_posHorz==0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(EXPO_ONE_2ND_COLUMN, y, STR_VMIXTRIMS, (not_stick && carryTrim == 0) ? 0 : carryTrim+1, m_posHorz==0 ? attr : 0);
|
||||
if (attr) ed->carryTrim = -checkIncDecModel(event, carryTrim, not_stick ? TRIM_ON : -TRIM_OFF, -TRIM_AIL);
|
||||
break;
|
||||
}
|
||||
|
@ -571,7 +571,7 @@ void menuModelMixOne(evt_t event)
|
|||
}
|
||||
case MIX_FIELD_TRIM:
|
||||
lcd_putsColumnLeft(x, y, STR_TRIM);
|
||||
lcdDrawCheckBox(x+MIXES_2ND_COLUMN, y, !md2->carryTrim, attr);
|
||||
drawCheckBox(x+MIXES_2ND_COLUMN, y, !md2->carryTrim, attr);
|
||||
if (attr) md2->carryTrim = !checkIncDecModel(event, !md2->carryTrim, 0, 1);
|
||||
break;
|
||||
#if defined(CURVES)
|
||||
|
@ -596,7 +596,7 @@ void menuModelMixOne(evt_t event)
|
|||
if (md2->mixWarn)
|
||||
lcd_outdezAtt(x+MIXES_2ND_COLUMN, y, md2->mixWarn, attr|LEFT);
|
||||
else
|
||||
lcd_putsAtt(x+MIXES_2ND_COLUMN, y, STR_OFF, attr);
|
||||
lcdDrawText(x+MIXES_2ND_COLUMN, y, STR_OFF, attr);
|
||||
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, md2->mixWarn, 3);
|
||||
break;
|
||||
#endif
|
||||
|
@ -681,7 +681,7 @@ void displayHeaderChannelName(uint8_t ch)
|
|||
{
|
||||
uint8_t len = zlen(g_model.limitData[ch-1].name, sizeof(g_model.limitData[ch-1].name));
|
||||
if (len) {
|
||||
lcd_putsnAtt(COLUMN_HEADER_X, MENU_FOOTER_TOP, g_model.limitData[ch-1].name, len, HEADER_COLOR|ZCHAR);
|
||||
lcdDrawTextWithLen(COLUMN_HEADER_X, MENU_FOOTER_TOP, g_model.limitData[ch-1].name, len, HEADER_COLOR|ZCHAR);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -697,7 +697,7 @@ void displayMixInfos(coord_t y, MixData *md)
|
|||
void displayMixLine(coord_t y, MixData *md)
|
||||
{
|
||||
if (md->name[0])
|
||||
lcd_putsnAtt(EXPO_LINE_NAME_POS, y, md->name, sizeof(md->name), ZCHAR);
|
||||
lcdDrawTextWithLen(EXPO_LINE_NAME_POS, y, md->name, sizeof(md->name), ZCHAR);
|
||||
displayMixInfos(y, md);
|
||||
displayFlightModes(MIX_LINE_FM_POS, y, md->flightModes, 0);
|
||||
}
|
||||
|
@ -721,7 +721,7 @@ void displayExpoLine(coord_t y, ExpoData *ed)
|
|||
displayFlightModes(EXPO_LINE_FM_POS, y, ed->flightModes, 0);
|
||||
|
||||
if (ed->name[0]) {
|
||||
lcd_putsnAtt(EXPO_LINE_NAME_POS, y, ed->name, sizeof(ed->name), ZCHAR);
|
||||
lcdDrawTextWithLen(EXPO_LINE_NAME_POS, y, ed->name, sizeof(ed->name), ZCHAR);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -782,7 +782,6 @@ void menuModelExpoMix(uint8_t expo, evt_t event)
|
|||
}
|
||||
// no break
|
||||
|
||||
CASE_EVT_ROTARY_BREAK
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
killEvents(event);
|
||||
if (s_copyTgtOfs) {
|
||||
|
@ -829,29 +828,29 @@ void menuModelExpoMix(uint8_t expo, evt_t event)
|
|||
killEvents(event);
|
||||
}
|
||||
break;
|
||||
case EVT_KEY_FIRST(KEY_MOVE_UP):
|
||||
case EVT_KEY_REPT(KEY_MOVE_UP):
|
||||
case EVT_KEY_FIRST(KEY_MOVE_DOWN):
|
||||
case EVT_KEY_REPT(KEY_MOVE_DOWN):
|
||||
case EVT_KEY_FIRST(KEY_UP):
|
||||
case EVT_KEY_REPT(KEY_UP):
|
||||
case EVT_KEY_FIRST(KEY_DOWN):
|
||||
case EVT_KEY_REPT(KEY_DOWN):
|
||||
if (s_copyMode) {
|
||||
uint8_t key = (event & 0x1f);
|
||||
uint8_t next_ofs = ((IS_ROTARY_UP(event) || key==KEY_MOVE_UP) ? s_copyTgtOfs - 1 : s_copyTgtOfs + 1);
|
||||
uint8_t next_ofs = ((event==EVT_ROTARY_LEFT || key==KEY_UP) ? s_copyTgtOfs - 1 : s_copyTgtOfs + 1);
|
||||
|
||||
if (s_copyTgtOfs==0 && s_copyMode==COPY_MODE) {
|
||||
// insert a mix on the same channel (just above / just below)
|
||||
if (reachExpoMixCountLimit(expo)) break;
|
||||
copyExpoMix(expo, s_currIdx);
|
||||
if (IS_ROTARY_DOWN(event) || key==KEY_MOVE_DOWN) s_currIdx++;
|
||||
if (event==EVT_ROTARY_RIGHT || key==KEY_DOWN) s_currIdx++;
|
||||
else if (sub-s_pgOfs >= 6) s_pgOfs++;
|
||||
}
|
||||
else if (next_ofs==0 && s_copyMode==COPY_MODE) {
|
||||
// delete the mix
|
||||
deleteExpoMix(expo, s_currIdx);
|
||||
if (IS_ROTARY_UP(event) || key==KEY_MOVE_UP) s_currIdx--;
|
||||
if (event==EVT_ROTARY_LEFT || key==KEY_UP) s_currIdx--;
|
||||
}
|
||||
else {
|
||||
// only swap the mix with its neighbor
|
||||
if (!swapExpoMix(expo, s_currIdx, IS_ROTARY_UP(event) || key==KEY_MOVE_UP)) break;
|
||||
if (!swapExpoMix(expo, s_currIdx, event==EVT_ROTARY_LEFT || key==KEY_UP)) break;
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
|
||||
|
@ -862,7 +861,7 @@ void menuModelExpoMix(uint8_t expo, evt_t event)
|
|||
|
||||
char str[6];
|
||||
sprintf(str, "%d/%d", getExpoMixCount(expo), expo ? MAX_EXPOS : MAX_MIXERS);
|
||||
lcd_putsAtt(MENU_TITLE_NEXT_POS, MENU_TITLE_TOP+2, str, HEADER_COLOR);
|
||||
lcdDrawText(MENU_TITLE_NEXT_POS, MENU_TITLE_TOP+2, str, HEADER_COLOR);
|
||||
|
||||
sub = m_posVert;
|
||||
s_currCh = 0;
|
||||
|
@ -907,7 +906,7 @@ void menuModelExpoMix(uint8_t expo, evt_t event)
|
|||
displayHeaderChannelName(ch);
|
||||
}
|
||||
|
||||
if (mixCnt > 0) lcd_putsiAtt(6, y, STR_VMLTPX2, md->mltpx, 0);
|
||||
if (mixCnt > 0) lcdDrawTextAtIndex(6, y, STR_VMLTPX2, md->mltpx, 0);
|
||||
|
||||
putsMixerSource(MIX_LINE_SRC_POS, y, md->srcRaw);
|
||||
|
||||
|
|
|
@ -71,9 +71,9 @@ enum LimitsItems {
|
|||
#define LIMITS_DIRECTION_POS 240
|
||||
#define LIMITS_MAX_POS 300
|
||||
#define LIMITS_REVERT_POS 320
|
||||
#define LIMITS_CURVE_POS 360
|
||||
#define LIMITS_PPM_CENTER_POS 450
|
||||
#define LIMITS_SYMETRICAL_POS 460
|
||||
#define LIMITS_CURVE_POS 350
|
||||
#define LIMITS_PPM_CENTER_POS 440
|
||||
#define LIMITS_SYMETRICAL_POS 450
|
||||
#else
|
||||
#define LIMITS_NAME_POS 44
|
||||
#define LIMITS_OFFSET_POS 136
|
||||
|
@ -155,7 +155,7 @@ void menuModelLimits(evt_t event)
|
|||
// last line available - add the "copy trim menu" line
|
||||
uint8_t attr = (sub==NUM_CHNOUT) ? INVERS : 0;
|
||||
// TODO CENTER attribute
|
||||
lcd_putsAtt(100, y, STR_TRIMS2OFFSETS, s_noHi ? 0 : attr);
|
||||
lcdDrawText(100, y, STR_TRIMS2OFFSETS, s_noHi ? 0 : attr);
|
||||
if (attr) {
|
||||
s_editMode = 0;
|
||||
if (event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
|
@ -238,9 +238,9 @@ void menuModelLimits(evt_t event)
|
|||
{
|
||||
uint8_t revert = ld->revert;
|
||||
#if defined(PPM_CENTER_ADJUSTABLE)
|
||||
lcd_putsAtt(LIMITS_REVERT_POS, y, revert ? "\177" : "\176", attr);
|
||||
lcdDrawText(LIMITS_REVERT_POS, y, revert ? "\177" : "\176", attr);
|
||||
#else
|
||||
lcd_putsiAtt(LIMITS_REVERT_POS, y, STR_MMMINV, revert, attr);
|
||||
lcdDrawTextAtIndex(LIMITS_REVERT_POS, y, STR_MMMINV, revert, attr);
|
||||
#endif
|
||||
if (active) {
|
||||
uint8_t revert_new = checkIncDecModel(event, revert, 0, 1);
|
||||
|
@ -278,7 +278,7 @@ void menuModelLimits(evt_t event)
|
|||
|
||||
#if defined(PPM_LIMITS_SYMETRICAL)
|
||||
case ITEM_LIMITS_SYMETRICAL:
|
||||
lcd_putsAtt(LIMITS_SYMETRICAL_POS, y, ld->symetrical ? "=" : "\306", attr);
|
||||
lcdDrawText(LIMITS_SYMETRICAL_POS, y, ld->symetrical ? "=" : "\306", attr);
|
||||
if (active) {
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, ld->symetrical, 1);
|
||||
}
|
||||
|
|
|
@ -71,9 +71,9 @@ void putsEdgeDelayParam(coord_t x, coord_t y, LogicalSwitchData *cs, uint8_t lat
|
|||
sprintf(s, "[%s:%s]", sleft, sright);
|
||||
lcd_puts(x-4, y, s);
|
||||
/* if (cs->v3 < 0)
|
||||
lcd_putsAtt(lcdLastPos+3, y, "<<", rattr);
|
||||
lcdDrawText(lcdLastPos+3, y, "<<", rattr);
|
||||
else if (cs->v3 == 0)
|
||||
lcd_putsAtt(lcdLastPos+3, y, "--", rattr); */
|
||||
lcdDrawText(lcdLastPos+3, y, "--", rattr); */
|
||||
}
|
||||
|
||||
void onLogicalSwitchesMenu(const char *result)
|
||||
|
@ -134,7 +134,7 @@ void menuModelLogicalSwitches(evt_t event)
|
|||
putsSwitches(MENUS_MARGIN_LEFT, y, sw, (getSwitch(sw) ? 0/*BOLD*/ : 0) | ((sub==k && CURSOR_ON_LINE()) ? INVERS : 0));
|
||||
|
||||
// CSW func
|
||||
lcd_putsiAtt(CSW_1ST_COLUMN, y, STR_VCSWFUNC, cs->func, horz==0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(CSW_1ST_COLUMN, y, STR_VCSWFUNC, cs->func, horz==0 ? attr : 0);
|
||||
|
||||
// CSW params
|
||||
unsigned int cstate = lswFamily(cs->func);
|
||||
|
@ -203,7 +203,7 @@ void menuModelLogicalSwitches(evt_t event)
|
|||
if (cs->duration > 0)
|
||||
lcd_outdezAtt(CSW_5TH_COLUMN, y, cs->duration, (horz==LS_FIELD_DURATION ? attr : 0)|PREC1|LEFT);
|
||||
else
|
||||
lcd_putsiAtt(CSW_5TH_COLUMN, y, STR_MMMINV, 0, horz==LS_FIELD_DURATION ? attr : 0);
|
||||
lcdDrawTextAtIndex(CSW_5TH_COLUMN, y, STR_MMMINV, 0, horz==LS_FIELD_DURATION ? attr : 0);
|
||||
|
||||
// CSW delay
|
||||
if (cstate == LS_FAMILY_EDGE) {
|
||||
|
@ -216,7 +216,7 @@ void menuModelLogicalSwitches(evt_t event)
|
|||
lcd_outdezAtt(CSW_6TH_COLUMN, y, cs->delay, (horz==LS_FIELD_DELAY ? attr : 0)|PREC1|LEFT);
|
||||
}
|
||||
else {
|
||||
lcd_putsiAtt(CSW_6TH_COLUMN, y, STR_MMMINV, 0, horz==LS_FIELD_DELAY ? attr : 0);
|
||||
lcdDrawTextAtIndex(CSW_6TH_COLUMN, y, STR_MMMINV, 0, horz==LS_FIELD_DELAY ? attr : 0);
|
||||
}
|
||||
|
||||
if (attr && horz == LS_FIELD_V3 && cstate != LS_FAMILY_EDGE) {
|
||||
|
|
|
@ -85,209 +85,22 @@ char *strAppendModelSize(char *dest, int size)
|
|||
return strAppend(dest, s);
|
||||
}
|
||||
|
||||
#define CATEGORIES_WIDTH 140
|
||||
|
||||
void menuModelSelect(evt_t event)
|
||||
{
|
||||
if (s_warning_result) {
|
||||
s_warning_result = 0;
|
||||
eeDeleteModel(m_posVert); // delete file
|
||||
s_copyMode = 0;
|
||||
event = EVT_ENTRY_UP;
|
||||
}
|
||||
// Header
|
||||
lcdDrawSolidFilledRect(0, 0, LCD_W, MENU_HEADER_HEIGHT, HEADER_BGCOLOR);
|
||||
lcdDrawBitmapPattern(0, 0, LBM_TOPMENU_POLYGON, TITLE_BGCOLOR);
|
||||
// lcdDrawBitmapPattern(4, 10, LBM_TOPMENU_OPENTX, MENU_TITLE_COLOR);
|
||||
drawTopmenuDatetime();
|
||||
|
||||
evt_t _event_ = event;
|
||||
event = (IS_ROTARY_BREAK(event) || IS_ROTARY_LONG(event) ? 0 : event);
|
||||
if ((s_copyMode && EVT_KEY_MASK(event) == KEY_EXIT) || event == EVT_KEY_BREAK(KEY_EXIT)) {
|
||||
event = 0;
|
||||
}
|
||||
// Categories
|
||||
lcdDrawSolidFilledRect(0, MENU_HEADER_HEIGHT, CATEGORIES_WIDTH, LCD_H-MENU_HEADER_HEIGHT-MENU_FOOTER_HEIGHT, TITLE_BGCOLOR);
|
||||
|
||||
int8_t oldSub = m_posVert;
|
||||
// Models
|
||||
lcdDrawSolidFilledRect(CATEGORIES_WIDTH, MENU_HEADER_HEIGHT, LCD_W-CATEGORIES_WIDTH, LCD_H-MENU_HEADER_HEIGHT-MENU_FOOTER_HEIGHT, TEXT_BGCOLOR);
|
||||
|
||||
// TODO SIMPLE_MENU(STR_MENUMODELSEL, menuTabModel, e_ModelSelect, MAX_MODELS, DEFAULT_SCROLLBAR_X);
|
||||
|
||||
if (s_editMode > 0) s_editMode = 0;
|
||||
|
||||
int8_t sub = m_posVert;
|
||||
|
||||
switch (_event_)
|
||||
{
|
||||
case EVT_ENTRY:
|
||||
m_posVert = sub = g_eeGeneral.currModel;
|
||||
if (sub >= NUM_BODY_LINES) s_pgOfs = sub-(NUM_BODY_LINES-1);
|
||||
s_copyMode = 0;
|
||||
s_editMode = EDIT_MODE_INIT;
|
||||
storageCheck(true);
|
||||
break;
|
||||
case EVT_KEY_LONG(KEY_EXIT):
|
||||
if (s_copyMode && s_copyTgtOfs == 0 && g_eeGeneral.currModel != sub && eeModelExists(sub)) {
|
||||
POPUP_CONFIRMATION(STR_DELETEMODEL);
|
||||
// SET_WARNING_INFO(modelHeaders[sub].name, sizeof(g_model.header.name), ZCHAR);
|
||||
killEvents(_event_);
|
||||
break;
|
||||
}
|
||||
// no break
|
||||
case EVT_KEY_BREAK(KEY_EXIT):
|
||||
if (s_copyMode) {
|
||||
sub = m_posVert = (s_copyMode == MOVE_MODE || s_copySrcRow<0) ? (MAX_MODELS+sub+s_copyTgtOfs) % MAX_MODELS : s_copySrcRow;
|
||||
s_copyMode = 0;
|
||||
}
|
||||
else {
|
||||
if (m_posVert != g_eeGeneral.currModel) {
|
||||
m_posVert = g_eeGeneral.currModel;
|
||||
s_pgOfs = 0;
|
||||
}
|
||||
else if (_event_ != EVT_KEY_LONG(KEY_EXIT)) {
|
||||
popMenu();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
case EVT_KEY_BREAK(KEY_ENTER):
|
||||
s_editMode = 0;
|
||||
if (READ_ONLY()) {
|
||||
if (g_eeGeneral.currModel != sub && eeModelExists(sub)) {
|
||||
selectModel(sub);
|
||||
}
|
||||
}
|
||||
else if (s_copyMode && (s_copyTgtOfs || s_copySrcRow>=0)) {
|
||||
storageCheck(true); // force writing of current model data before this is changed
|
||||
uint8_t cur = (MAX_MODELS + sub + s_copyTgtOfs) % MAX_MODELS;
|
||||
if (s_copyMode == COPY_MODE) {
|
||||
if (!eeCopyModel(cur, s_copySrcRow)) {
|
||||
cur = sub;
|
||||
}
|
||||
}
|
||||
|
||||
s_copySrcRow = g_eeGeneral.currModel; // to update the currModel value
|
||||
while (sub != cur) {
|
||||
uint8_t src = cur;
|
||||
cur = (s_copyTgtOfs > 0 ? cur+MAX_MODELS-1 : cur+1) % MAX_MODELS;
|
||||
eeSwapModels(src, cur);
|
||||
if (src == s_copySrcRow)
|
||||
s_copySrcRow = cur;
|
||||
else if (cur == s_copySrcRow)
|
||||
s_copySrcRow = src;
|
||||
}
|
||||
|
||||
if (s_copySrcRow != g_eeGeneral.currModel) {
|
||||
g_eeGeneral.currModel = s_copySrcRow;
|
||||
storageDirty(EE_GENERAL);
|
||||
}
|
||||
|
||||
s_copyMode = 0;
|
||||
_event_ = EVT_ENTRY_UP;
|
||||
}
|
||||
else if (_event_ == EVT_KEY_LONG(KEY_ENTER)) {
|
||||
s_copyMode = 0;
|
||||
killEvents(_event_);
|
||||
if (g_eeGeneral.currModel != sub) {
|
||||
if (eeModelExists(sub)) {
|
||||
MENU_ADD_ITEM(STR_SELECT_MODEL);
|
||||
MENU_ADD_SD_ITEM(STR_BACKUP_MODEL);
|
||||
MENU_ADD_ITEM(STR_COPY_MODEL);
|
||||
MENU_ADD_ITEM(STR_MOVE_MODEL);
|
||||
MENU_ADD_ITEM(STR_DELETE_MODEL);
|
||||
}
|
||||
else {
|
||||
MENU_ADD_ITEM(STR_CREATE_MODEL);
|
||||
MENU_ADD_ITEM(STR_RESTORE_MODEL);
|
||||
}
|
||||
}
|
||||
else {
|
||||
MENU_ADD_SD_ITEM(STR_BACKUP_MODEL);
|
||||
MENU_ADD_ITEM(STR_COPY_MODEL);
|
||||
MENU_ADD_ITEM(STR_MOVE_MODEL);
|
||||
}
|
||||
menuHandler = onModelSelectMenu;
|
||||
}
|
||||
else if (eeModelExists(sub)) {
|
||||
s_copyMode = (s_copyMode == COPY_MODE ? MOVE_MODE : COPY_MODE);
|
||||
s_copyTgtOfs = 0;
|
||||
s_copySrcRow = -1;
|
||||
}
|
||||
break;
|
||||
|
||||
#if 0
|
||||
case EVT_KEY_BREAK(KEY_PAGE):
|
||||
case EVT_KEY_LONG(KEY_PAGE):
|
||||
chainMenu(_event_ == EVT_KEY_BREAK(KEY_PAGE) ? menuModelSetup : menuTabModel[DIM(menuTabModel)-1]);
|
||||
killEvents(_event_);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case EVT_KEY_FIRST(KEY_MOVE_UP):
|
||||
case EVT_KEY_REPT(KEY_MOVE_UP):
|
||||
case EVT_KEY_FIRST(KEY_MOVE_DOWN):
|
||||
case EVT_KEY_REPT(KEY_MOVE_DOWN):
|
||||
if (s_copyMode) {
|
||||
int8_t next_ofs = s_copyTgtOfs + oldSub - m_posVert;
|
||||
if (next_ofs == MAX_MODELS || next_ofs == -MAX_MODELS)
|
||||
next_ofs = 0;
|
||||
|
||||
if (s_copySrcRow < 0 && s_copyMode==COPY_MODE) {
|
||||
s_copySrcRow = oldSub;
|
||||
// find a hole (in the first empty slot above / below)
|
||||
sub = eeFindEmptyModel(s_copySrcRow, IS_ROTARY_DOWN(_event_) || _event_==EVT_KEY_FIRST(KEY_MOVE_DOWN));
|
||||
if (sub < 0) {
|
||||
// no free room for duplicating the model
|
||||
AUDIO_ERROR();
|
||||
sub = oldSub;
|
||||
s_copyMode = 0;
|
||||
}
|
||||
next_ofs = 0;
|
||||
m_posVert = sub;
|
||||
}
|
||||
s_copyTgtOfs = next_ofs;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
for (int i=0; i<NUM_BODY_LINES; i++) {
|
||||
coord_t y = MENU_CONTENT_TOP + i*FH;
|
||||
int k = i+s_pgOfs;
|
||||
|
||||
LcdFlags flags = 0;
|
||||
if (sub==k && s_copyMode == 0) {
|
||||
flags |= TEXT_INVERTED_COLOR;
|
||||
lcdDrawSolidFilledRect(MENUS_MARGIN_LEFT-INVERT_HORZ_MARGIN, y-INVERT_VERT_MARGIN, 150, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR);
|
||||
}
|
||||
|
||||
char str[20];
|
||||
strAppendDigits(str, k+1);
|
||||
lcd_putsAtt(MENUS_MARGIN_LEFT, y, str, flags);
|
||||
|
||||
if (s_copyMode == MOVE_MODE || (s_copyMode == COPY_MODE && s_copySrcRow >= 0)) {
|
||||
if (k == sub) {
|
||||
if (s_copyMode == COPY_MODE) {
|
||||
k = s_copySrcRow;
|
||||
// lcdDrawRect(MENUS_MARGIN_LEFT-5, y-3, 170, 16, SOLID, YELLOW);
|
||||
}
|
||||
else {
|
||||
k = sub + s_copyTgtOfs;
|
||||
}
|
||||
}
|
||||
else if (s_copyTgtOfs < 0 && ((k < sub && k >= sub+s_copyTgtOfs) || (k-MAX_MODELS < sub && k-MAX_MODELS >= sub+s_copyTgtOfs)))
|
||||
k += 1;
|
||||
else if (s_copyTgtOfs > 0 && ((k > sub && k <= sub+s_copyTgtOfs) || (k+MAX_MODELS > sub && k+MAX_MODELS <= sub+s_copyTgtOfs)))
|
||||
k += MAX_MODELS-1;
|
||||
}
|
||||
|
||||
k %= MAX_MODELS;
|
||||
|
||||
if (eeModelExists(k)) {
|
||||
// TODO strcat_modelname(str, k);
|
||||
lcd_putsAtt(POS_MODEL_NAME, y, str, flags);
|
||||
if (k==g_eeGeneral.currModel && (s_copyMode!=COPY_MODE || s_copySrcRow<0 || i+s_pgOfs!=(vertpos_t)sub)) {
|
||||
lcd_puts(1, y, "*");
|
||||
}
|
||||
}
|
||||
else {
|
||||
lcd_putsAtt(POS_MODEL_NAME, y, "---", flags);
|
||||
}
|
||||
|
||||
if (s_copyMode && (vertpos_t)sub==i+s_pgOfs) {
|
||||
lcdDrawRect(MENUS_MARGIN_LEFT-INVERT_HORZ_MARGIN, y-INVERT_VERT_MARGIN, 150, INVERT_LINE_HEIGHT, s_copyMode == COPY_MODE ? SOLID : DOTTED, WARNING_COLOR);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO lcdDrawBitmap(200, 67, logos, 60*g_model.header.bitmap, 60);
|
||||
// Footer
|
||||
lcdDrawSolidFilledRect(0, MENU_FOOTER_TOP, LCD_W, MENU_FOOTER_HEIGHT, HEADER_BGCOLOR);
|
||||
}
|
||||
|
|
|
@ -102,11 +102,26 @@ void copySelection(char *dst, const char *src, uint8_t size)
|
|||
memcpy(dst, src, size);
|
||||
}
|
||||
|
||||
void onModelSetupBitmapMenu(const char *result)
|
||||
{
|
||||
if (result == STR_UPDATE_LIST) {
|
||||
if (!sdListFiles(BITMAPS_PATH, BITMAPS_EXT, sizeof(g_model.header.bitmap), NULL)) {
|
||||
POPUP_WARNING(STR_NO_BITMAPS_ON_SD);
|
||||
s_menu_flags = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// The user choosed a bmp file in the list
|
||||
copySelection(g_model.header.bitmap, result, sizeof(g_model.header.bitmap));
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
}
|
||||
|
||||
void editTimerMode(int timerIdx, coord_t y, LcdFlags attr, evt_t event)
|
||||
{
|
||||
TimerData * timer = &g_model.timers[timerIdx];
|
||||
if (attr && m_posHorz < 0) {
|
||||
lcdDrawSolidFilledRect(MODEL_SETUP_2ND_COLUMN-INVERT_HORZ_MARGIN, y-INVERT_VERT_MARGIN, 80+2*INVERT_HORZ_MARGIN, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR);
|
||||
lcdDrawSolidFilledRect(MODEL_SETUP_2ND_COLUMN-INVERT_HORZ_MARGIN, y-INVERT_VERT_MARGIN, 90+2*INVERT_HORZ_MARGIN, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR);
|
||||
}
|
||||
putsStrIdx(MENUS_MARGIN_LEFT, y, STR_TIMER, timerIdx+1);
|
||||
putsTimerMode(MODEL_SETUP_2ND_COLUMN, y, timer->mode, (m_posHorz<=0 ? attr : 0));
|
||||
|
@ -158,7 +173,7 @@ int getSwitchWarningsCount()
|
|||
void menuModelSetup(evt_t event)
|
||||
{
|
||||
horzpos_t l_posHorz = m_posHorz;
|
||||
#define IF_EXTERNAL_MODULE_ON(x) (g_model.externalModule == MODULE_TYPE_NONE ? HIDDEN_ROW : (uint8_t)(x))
|
||||
#define IF_EXTERNAL_MODULE_ON(x) (g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_NONE ? HIDDEN_ROW : (uint8_t)(x))
|
||||
#define IF_TRAINER_ON(x) (g_model.trainerMode == TRAINER_MODE_SLAVE ? (uint8_t)(x) : HIDDEN_ROW)
|
||||
#define IF_EXTERNAL_MODULE_XJT(x) (IS_MODULE_XJT(EXTERNAL_MODULE) ? (uint8_t)x : HIDDEN_ROW)
|
||||
#define IS_D8_RX(x) (g_model.moduleData[x].rfProtocol == RF_PROTO_D8)
|
||||
|
@ -208,8 +223,20 @@ void menuModelSetup(evt_t event)
|
|||
|
||||
case ITEM_MODEL_BITMAP:
|
||||
lcd_putsLeft(y, STR_BITMAP);
|
||||
lcd_outdezAtt(MODEL_SETUP_2ND_COLUMN, y, g_model.header.bitmap, LEFT|attr);
|
||||
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, g_model.header.bitmap, 3);
|
||||
if (ZEXIST(g_model.header.bitmap))
|
||||
lcdDrawTextWithLen(MODEL_SETUP_2ND_COLUMN, y, g_model.header.bitmap, sizeof(g_model.header.bitmap), attr);
|
||||
else
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VCSWFUNC, 0, attr);
|
||||
if (attr && event==EVT_KEY_BREAK(KEY_ENTER) && READ_ONLY_UNLOCKED()) {
|
||||
s_editMode = 0;
|
||||
if (sdListFiles(BITMAPS_PATH, BITMAPS_EXT, sizeof(g_model.header.bitmap), g_model.header.bitmap, LIST_NONE_SD_FILE)) {
|
||||
menuHandler = onModelSetupBitmapMenu;
|
||||
}
|
||||
else {
|
||||
POPUP_WARNING(STR_NO_BITMAPS_ON_SD);
|
||||
s_menu_flags = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_TIMER1:
|
||||
|
@ -282,7 +309,7 @@ void menuModelSetup(evt_t event)
|
|||
|
||||
case ITEM_MODEL_EXTENDED_TRIMS:
|
||||
ON_OFF_MENU_ITEM(g_model.extendedTrims, MODEL_SETUP_2ND_COLUMN, y, STR_ETRIMS, m_posHorz<=0 ? attr : 0, event==EVT_KEY_BREAK(KEY_ENTER) ? event : 0);
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+18, y, STR_RESET_BTN, m_posHorz>0 && !s_noHi ? attr : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+18, y, STR_RESET_BTN, m_posHorz>0 && !s_noHi ? attr : 0);
|
||||
if (attr && m_posHorz>0) {
|
||||
s_editMode = 0;
|
||||
if (event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
|
@ -391,7 +418,7 @@ void menuModelSetup(evt_t event)
|
|||
max = 2;
|
||||
}
|
||||
s[2] = '\0';
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+i*18, y, s, color|(m_posHorz==current ? attr : 0));
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+i*18, y, s, color|(m_posHorz==current ? attr : 0));
|
||||
if (attr && m_posHorz==current) CHECK_INCDEC_MODELVAR_ZERO(event, state, max);
|
||||
newStates |= (state << (3*i));
|
||||
++current;
|
||||
|
@ -423,13 +450,13 @@ void menuModelSetup(evt_t event)
|
|||
}
|
||||
}
|
||||
}
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, PSTR("\004""OFF\0""Man\0""Auto"), g_model.potsWarnMode, (m_posHorz == 0) ? attr : 0);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, PSTR("\004""OFF\0""Man\0""Auto"), g_model.potsWarnMode, (m_posHorz == 0) ? attr : 0);
|
||||
if (g_model.potsWarnMode) {
|
||||
coord_t x = MODEL_SETUP_2ND_COLUMN+30;
|
||||
for (int i=0; i<NUM_POTS; ++i) {
|
||||
LcdFlags flags = (((m_posHorz==i+1) && attr) ? INVERS : 0);
|
||||
flags |= (g_model.potsWarnEnabled & (1 << i)) ? TEXT_DISABLE_COLOR : TEXT_COLOR;
|
||||
lcd_putsiAtt(x, y, STR_VSRCRAW, NUM_STICKS+1+i, flags);
|
||||
lcdDrawTextAtIndex(x, y, STR_VSRCRAW, NUM_STICKS+1+i, flags);
|
||||
x += 20;
|
||||
}
|
||||
}
|
||||
|
@ -451,7 +478,7 @@ void menuModelSetup(evt_t event)
|
|||
LcdFlags flags = ((m_posHorz==i && attr) ? INVERS : 0);
|
||||
flags |= (g_model.beepANACenter & ((BeepANACenter)1<<i)) ? TEXT_COLOR : TEXT_DISABLE_COLOR;
|
||||
if (attr && m_posHorz < 0) flags |= INVERS;
|
||||
lcd_putsiAtt(x, y, STR_RETA123, i, flags);
|
||||
lcdDrawTextAtIndex(x, y, STR_RETA123, i, flags);
|
||||
}
|
||||
if (attr && CURSOR_ON_CELL) {
|
||||
if (event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
|
@ -466,7 +493,7 @@ void menuModelSetup(evt_t event)
|
|||
|
||||
case ITEM_MODEL_USE_GLOBAL_FUNCTIONS:
|
||||
lcd_putsLeft(y, "Use Global Funcs");
|
||||
lcdDrawCheckBox(MODEL_SETUP_2ND_COLUMN, y, !g_model.noGlobalFunctions, attr);
|
||||
drawCheckBox(MODEL_SETUP_2ND_COLUMN, y, !g_model.noGlobalFunctions, attr);
|
||||
if (attr) g_model.noGlobalFunctions = !checkIncDecModel(event, !g_model.noGlobalFunctions, 0, 1);
|
||||
break;
|
||||
|
||||
|
@ -480,19 +507,19 @@ void menuModelSetup(evt_t event)
|
|||
|
||||
case ITEM_MODEL_EXTERNAL_MODULE_MODE:
|
||||
lcd_putsLeft(y, STR_MODE);
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, STR_TARANIS_PROTOCOLS, g_model.externalModule, (m_posHorz==0 ? attr : 0));
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_TARANIS_PROTOCOLS, g_model.moduleData[EXTERNAL_MODULE].type, (m_posHorz==0 ? attr : 0));
|
||||
if (IS_MODULE_XJT(EXTERNAL_MODULE))
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN+40, y, STR_XJT_PROTOCOLS, 1+g_model.moduleData[EXTERNAL_MODULE].rfProtocol, (m_posHorz==1 ? attr : 0));
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN+40, y, STR_XJT_PROTOCOLS, 1+g_model.moduleData[EXTERNAL_MODULE].rfProtocol, (m_posHorz==1 ? attr : 0));
|
||||
else if (IS_MODULE_DSM2(EXTERNAL_MODULE))
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN+40, y, STR_DSM_PROTOCOLS, g_model.moduleData[EXTERNAL_MODULE].rfProtocol, (m_posHorz==1 ? attr : 0));
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN+40, y, STR_DSM_PROTOCOLS, g_model.moduleData[EXTERNAL_MODULE].rfProtocol, (m_posHorz==1 ? attr : 0));
|
||||
if (attr && s_editMode>0) {
|
||||
switch (m_posHorz) {
|
||||
case 0:
|
||||
g_model.externalModule = checkIncDec(event, g_model.externalModule, MODULE_TYPE_NONE, MODULE_TYPE_COUNT-1, EE_MODEL, isModuleAvailable);
|
||||
g_model.moduleData[EXTERNAL_MODULE].type = checkIncDec(event, g_model.moduleData[EXTERNAL_MODULE].type, MODULE_TYPE_NONE, MODULE_TYPE_COUNT-1, EE_MODEL, isModuleAvailable);
|
||||
if (checkIncDec_Ret) {
|
||||
g_model.moduleData[EXTERNAL_MODULE].rfProtocol = 0;
|
||||
g_model.moduleData[EXTERNAL_MODULE].channelsStart = 0;
|
||||
if (g_model.externalModule == MODULE_TYPE_PPM)
|
||||
if (g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_PPM)
|
||||
g_model.moduleData[EXTERNAL_MODULE].channelsCount = 0;
|
||||
else
|
||||
g_model.moduleData[EXTERNAL_MODULE].channelsCount = MAX_EXTERNAL_MODULE_CHANNELS();
|
||||
|
@ -532,7 +559,7 @@ void menuModelSetup(evt_t event)
|
|||
break;
|
||||
case 1:
|
||||
CHECK_INCDEC_MODELVAR(event, moduleData.channelsCount, -4, min<int8_t>(MAX_CHANNELS(moduleIdx), 32-8-moduleData.channelsStart));
|
||||
if ((k == ITEM_MODEL_EXTERNAL_MODULE_CHANNELS && g_model.externalModule == MODULE_TYPE_PPM)
|
||||
if ((k == ITEM_MODEL_EXTERNAL_MODULE_CHANNELS && g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_PPM)
|
||||
|| (k == ITEM_MODEL_TRAINER_CHANNELS)
|
||||
)
|
||||
SET_DEFAULT_PPM_FRAME_LENGTH(moduleIdx);
|
||||
|
@ -552,7 +579,7 @@ void menuModelSetup(evt_t event)
|
|||
lcd_putsLeft(y, STR_PPMFRAME);
|
||||
lcd_outdezAtt(MODEL_SETUP_2ND_COLUMN, y, (int16_t)moduleData.ppmFrameLength*5 + 225, (m_posHorz<=0 ? attr : 0) | PREC1|LEFT, STR_MS);
|
||||
lcd_outdezAtt(MODEL_SETUP_2ND_COLUMN+70, y, (moduleData.ppmDelay*50)+300, (CURSOR_ON_LINE() || m_posHorz==1) ? attr : 0, "us");
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+90, y, moduleData.ppmPulsePol ? "+" : "-", (CURSOR_ON_LINE() || m_posHorz==2) ? attr : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+90, y, moduleData.ppmPulsePol ? "+" : "-", (CURSOR_ON_LINE() || m_posHorz==2) ? attr : 0);
|
||||
|
||||
if (attr && s_editMode>0) {
|
||||
switch (m_posHorz) {
|
||||
|
@ -584,8 +611,8 @@ void menuModelSetup(evt_t event)
|
|||
if (attr && l_posHorz==0 && s_editMode>0) {
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, g_model.header.modelId[moduleIdx], IS_MODULE_DSM2(moduleIdx) ? 20 : 63);
|
||||
}
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+xOffsetBind, y, STR_MODULE_BIND, l_posHorz==1 ? attr : 0);
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+MODEL_SETUP_RANGE_OFS+xOffsetBind, y, STR_MODULE_RANGE, l_posHorz==2 ? attr : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+xOffsetBind, y, STR_MODULE_BIND, l_posHorz==1 ? attr : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+MODEL_SETUP_RANGE_OFS+xOffsetBind, y, STR_MODULE_RANGE, l_posHorz==2 ? attr : 0);
|
||||
uint8_t newFlag = 0;
|
||||
if (attr && l_posHorz>0 && s_editMode>0) {
|
||||
if (l_posHorz == 1)
|
||||
|
@ -606,8 +633,8 @@ void menuModelSetup(evt_t event)
|
|||
ModuleData & moduleData = g_model.moduleData[moduleIdx];
|
||||
lcd_putsLeft(y, TR_FAILSAFE);
|
||||
if (IS_MODULE_XJT(moduleIdx)) {
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, STR_VFAILSAFE, moduleData.failsafeMode, m_posHorz==0 ? attr : 0);
|
||||
if (moduleData.failsafeMode == FAILSAFE_CUSTOM) lcd_putsAtt(MODEL_SETUP_2ND_COLUMN + MODEL_SETUP_SET_FAILSAFE_OFS, y, STR_SET, m_posHorz==1 ? attr : 0);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VFAILSAFE, moduleData.failsafeMode, m_posHorz==0 ? attr : 0);
|
||||
if (moduleData.failsafeMode == FAILSAFE_CUSTOM) lcdDrawText(MODEL_SETUP_2ND_COLUMN + MODEL_SETUP_SET_FAILSAFE_OFS, y, STR_SET, m_posHorz==1 ? attr : 0);
|
||||
if (attr) {
|
||||
if (moduleData.failsafeMode != FAILSAFE_CUSTOM)
|
||||
m_posHorz = 0;
|
||||
|
@ -625,7 +652,7 @@ void menuModelSetup(evt_t event)
|
|||
}
|
||||
}
|
||||
else {
|
||||
lcdDrawSolidFilledRect(MODEL_SETUP_2ND_COLUMN, y, LCD_W-MODEL_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH, 8, TEXT_COLOR);
|
||||
lcdDrawSolidFilledRect(MODEL_SETUP_2ND_COLUMN, y, LCD_W-MODEL_SETUP_2ND_COLUMN-2, 8, TEXT_COLOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -654,7 +681,7 @@ void menuModelFailsafe(evt_t event)
|
|||
SEND_FAILSAFE_NOW(g_moduleIdx);
|
||||
}
|
||||
|
||||
SIMPLE_SUBMENU_NOTITLE(NUM_CHNOUT, 0);
|
||||
SIMPLE_SUBMENU_NOTITLE(NUM_CHNOUT);
|
||||
|
||||
#define COL_W (LCD_W/2)
|
||||
const uint8_t SLIDER_W = 64;
|
||||
|
@ -691,7 +718,7 @@ void menuModelFailsafe(evt_t event)
|
|||
}
|
||||
|
||||
if (lenLabel > 0)
|
||||
lcd_putsnAtt(x+1-ofs, y, g_model.limitData[ch].name, sizeof(g_model.limitData[ch].name), ZCHAR | SMLSIZE);
|
||||
lcdDrawTextWithLen(x+1-ofs, y, g_model.limitData[ch].name, sizeof(g_model.limitData[ch].name), ZCHAR | SMLSIZE);
|
||||
else
|
||||
putsChn(x+1-ofs, y, ch+1, SMLSIZE);
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ enum menuModelTelemetryItems {
|
|||
#endif
|
||||
#define VARIO_RANGE_ROWS 3
|
||||
|
||||
#define TELEMETRY_TYPE_ROWS (g_model.externalModule == MODULE_TYPE_PPM ? (uint8_t)0 : HIDDEN_ROW),
|
||||
#define TELEMETRY_TYPE_ROWS (g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_PPM ? (uint8_t)0 : HIDDEN_ROW),
|
||||
|
||||
#if defined(LUA)
|
||||
#define TELEMETRY_SCREEN_LINE(x) ((TELEMETRY_SCREEN_TYPE(x) == TELEMETRY_SCREEN_TYPE_NONE || TELEMETRY_SCREEN_TYPE(x) == TELEMETRY_SCREEN_TYPE_SCRIPT) ? HIDDEN_ROW : (uint8_t)2)
|
||||
|
@ -288,7 +288,7 @@ void menuModelSensor(evt_t event)
|
|||
case SENSOR_FIELD_UNIT:
|
||||
lcd_putsLeft(y, STR_UNIT);
|
||||
// TODO flash saving with selectMenuItem where I copied those 2 lines?
|
||||
lcd_putsiAtt(SENSOR_2ND_COLUMN, y, STR_VTELEMUNIT, sensor->unit, attr);
|
||||
lcdDrawTextAtIndex(SENSOR_2ND_COLUMN, y, STR_VTELEMUNIT, sensor->unit, attr);
|
||||
if (attr) {
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, sensor->unit, UNIT_MAX);
|
||||
if (checkIncDec_Ret) {
|
||||
|
@ -335,7 +335,7 @@ void menuModelSensor(evt_t event)
|
|||
lcd_putsLeft(y, "Ratio");
|
||||
if (attr) CHECK_INCDEC_MODELVAR(event, sensor->custom.ratio, 0, 30000);
|
||||
if (sensor->custom.ratio == 0)
|
||||
lcd_putsAtt(SENSOR_2ND_COLUMN, y, "-", attr);
|
||||
lcdDrawText(SENSOR_2ND_COLUMN, y, "-", attr);
|
||||
else
|
||||
lcd_outdezAtt(SENSOR_2ND_COLUMN, y, sensor->custom.ratio, LEFT|attr|PREC1);
|
||||
break;
|
||||
|
@ -377,7 +377,7 @@ void menuModelSensor(evt_t event)
|
|||
source = checkIncDec(event, source, -MAX_SENSORS, MAX_SENSORS, EE_MODEL|NO_INCDEC_MARKS, isSensorAvailable);
|
||||
}
|
||||
if (source < 0) {
|
||||
lcd_putsAtt(SENSOR_2ND_COLUMN, y, "-", attr);
|
||||
lcdDrawText(SENSOR_2ND_COLUMN, y, "-", attr);
|
||||
putsMixerSource(SENSOR_2ND_COLUMN+5, y, MIXSRC_FIRST_TELEM+3*(-1-source), attr);
|
||||
}
|
||||
else {
|
||||
|
@ -462,7 +462,7 @@ void menuModelTelemetry(evt_t event)
|
|||
if (k>=ITEM_TELEMETRY_SENSOR1 && k<ITEM_TELEMETRY_SENSOR1+MAX_SENSORS) {
|
||||
int index = k-ITEM_TELEMETRY_SENSOR1;
|
||||
lcd_outdezAtt(MENUS_MARGIN_LEFT+INDENT_WIDTH, y, index+1, LEFT|attr, ":");
|
||||
lcd_putsnAtt(60, y, g_model.telemetrySensors[index].label, TELEM_LABEL_LEN, ZCHAR);
|
||||
lcdDrawTextWithLen(60, y, g_model.telemetrySensors[index].label, TELEM_LABEL_LEN, ZCHAR);
|
||||
if (telemetryItems[index].isFresh()) {
|
||||
lcd_puts(100, y, "*");
|
||||
}
|
||||
|
@ -500,7 +500,7 @@ void menuModelTelemetry(evt_t event)
|
|||
break;
|
||||
|
||||
case ITEM_TELEMETRY_NEWSENSOR:
|
||||
lcd_putsAtt(MENUS_MARGIN_LEFT+INDENT_WIDTH, y, NO_INDENT(STR_TELEMETRY_NEWSENSOR), attr);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT+INDENT_WIDTH, y, NO_INDENT(STR_TELEMETRY_NEWSENSOR), attr);
|
||||
if (attr && event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
s_editMode = 0;
|
||||
int res = availableTelemetryIndex();
|
||||
|
@ -604,9 +604,9 @@ void menuModelTelemetry(evt_t event)
|
|||
// TODO better function name for ---
|
||||
// TODO function for these lines
|
||||
if (ZEXIST(scriptData.file))
|
||||
lcd_putsnAtt(TELEM_SCRTYPE_COL+70, y, scriptData.file, sizeof(scriptData.file), (m_posHorz==1 ? attr : 0));
|
||||
lcdDrawTextWithLen(TELEM_SCRTYPE_COL+70, y, scriptData.file, sizeof(scriptData.file), (m_posHorz==1 ? attr : 0));
|
||||
else
|
||||
lcd_putsiAtt(TELEM_SCRTYPE_COL+70, y, STR_VCSWFUNC, 0, (m_posHorz==1 ? attr : 0));
|
||||
lcdDrawTextAtIndex(TELEM_SCRTYPE_COL+70, y, STR_VCSWFUNC, 0, (m_posHorz==1 ? attr : 0));
|
||||
|
||||
if (m_posHorz==1 && attr && event==EVT_KEY_BREAK(KEY_ENTER) && READ_ONLY_UNLOCKED()) {
|
||||
s_editMode = 0;
|
||||
|
|
|
@ -48,7 +48,6 @@
|
|||
#define MENU_COLUMNS 2
|
||||
#endif
|
||||
|
||||
#define MENUS_SCROLLBAR_WIDTH 2
|
||||
#define MENU_COLUMN2_X 280
|
||||
|
||||
#define lcd_putsColumnLeft(x, y, str) lcd_puts((x > MENU_COLUMN2_X+MENUS_MARGIN_LEFT+68) ? MENU_COLUMN2_X+MENUS_MARGIN_LEFT : MENUS_MARGIN_LEFT, y, str)
|
||||
|
@ -66,7 +65,7 @@ extern vertpos_t s_pgOfs;
|
|||
extern uint8_t s_noHi;
|
||||
extern uint8_t calibrationState;
|
||||
|
||||
void lcdDrawCheckBox(coord_t x, coord_t y, uint8_t value, LcdFlags attr);
|
||||
void drawCheckBox(coord_t x, coord_t y, uint8_t value, LcdFlags attr);
|
||||
|
||||
typedef void (*MenuFuncP)(evt_t event);
|
||||
typedef void (*MenuFuncP_PROGMEM)(evt_t event);
|
||||
|
@ -107,7 +106,7 @@ void menuAboutView(evt_t event);
|
|||
void menuTraceBuffer(evt_t event);
|
||||
#endif
|
||||
|
||||
void displaySlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr);
|
||||
void drawSlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr);
|
||||
|
||||
void menuMainViewChannelsMonitor(evt_t event);
|
||||
void menuChannelsView(evt_t event);
|
||||
|
@ -200,36 +199,36 @@ int8_t checkIncDecMovedSwitch(int8_t val);
|
|||
#define CURSOR_ON_LINE() (m_posHorz<0)
|
||||
|
||||
#define CHECK_FLAG_NO_SCREEN_INDEX 1
|
||||
bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow, uint16_t scrollbar_X, uint8_t flags=0);
|
||||
bool check_simple(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, vertpos_t maxrow, uint16_t scrollbar_X);
|
||||
bool check_submenu_simple(check_event_t event, uint8_t maxrow, uint16_t scrollbar_X);
|
||||
bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow, uint8_t flags=0);
|
||||
bool check_simple(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, vertpos_t maxrow);
|
||||
bool check_submenu_simple(check_event_t event, uint8_t maxrow);
|
||||
|
||||
#define MENU_TAB(...) const uint8_t mstate_tab[] = __VA_ARGS__
|
||||
|
||||
void drawMenuTemplate(const char *title, evt_t event);
|
||||
void drawMenuTemplate(const char *title, evt_t event, uint16_t scrollbar_X=0);
|
||||
|
||||
#define MENU(title, tab, menu, lines_count, scrollbar_X, ...) \
|
||||
MENU_TAB(__VA_ARGS__); \
|
||||
if (event == EVT_ENTRY || event == EVT_ENTRY_UP) TRACE("Menu %s displayed ...", title); \
|
||||
if (!check(event, menu, tab, DIM(tab), mstate_tab, DIM(mstate_tab)-1, lines_count, scrollbar_X)) return; \
|
||||
drawMenuTemplate(title, event); \
|
||||
if (!check(event, menu, tab, DIM(tab), mstate_tab, DIM(mstate_tab)-1, lines_count)) return; \
|
||||
drawMenuTemplate(title, event, scrollbar_X); \
|
||||
|
||||
#define SIMPLE_MENU(title, tab, menu, lines_count, scrollbar_X) \
|
||||
if (event == EVT_ENTRY || event == EVT_ENTRY_UP) TRACE("Menu %s displayed ...", title); \
|
||||
if (!check_simple(event, menu, tab, DIM(tab), lines_count, scrollbar_X)) return; \
|
||||
drawMenuTemplate(title, event); \
|
||||
if (!check_simple(event, menu, tab, DIM(tab), lines_count)) return; \
|
||||
drawMenuTemplate(title, event, scrollbar_X); \
|
||||
|
||||
#define SUBMENU(title, lines_count, scrollbar_X, ...) \
|
||||
MENU_TAB(__VA_ARGS__); \
|
||||
if (!check(event, 0, NULL, 0, mstate_tab, DIM(mstate_tab)-1, lines_count, scrollbar_X)) return; \
|
||||
drawMenuTemplate(title, event);
|
||||
if (!check(event, 0, NULL, 0, mstate_tab, DIM(mstate_tab)-1, lines_count)) return; \
|
||||
drawMenuTemplate(title, event, scrollbar_X);
|
||||
|
||||
#define SIMPLE_SUBMENU_NOTITLE(lines_count, scrollbar_X) \
|
||||
if (!check_submenu_simple(event, lines_count, scrollbar_X)) return
|
||||
#define SIMPLE_SUBMENU_NOTITLE(lines_count) \
|
||||
if (!check_submenu_simple(event, lines_count)) return
|
||||
|
||||
#define SIMPLE_SUBMENU(title, lines_count, scrollbar_X) \
|
||||
SIMPLE_SUBMENU_NOTITLE(lines_count, scrollbar_X); \
|
||||
drawMenuTemplate(title, event)
|
||||
SIMPLE_SUBMENU_NOTITLE(lines_count); \
|
||||
drawMenuTemplate(title, event, scrollbar_X)
|
||||
|
||||
typedef int select_menu_value_t;
|
||||
|
||||
|
@ -310,28 +309,14 @@ extern void (*menuHandler)(const char *result);
|
|||
extern char s_text_file[TEXT_FILENAME_MAXLEN];
|
||||
void menuTextView(evt_t event);
|
||||
void pushMenuTextView(const char *filename);
|
||||
bool modelHasNotes();
|
||||
void pushModelNotes();
|
||||
|
||||
void menuChannelsView(evt_t event);
|
||||
|
||||
#define LABEL(...) (uint8_t)-1
|
||||
|
||||
#define KEY_MOVE_UP KEY_PLUS
|
||||
#define KEY_MOVE_DOWN KEY_MINUS
|
||||
|
||||
#if defined(REV9E)
|
||||
#define CURSOR_MOVED_LEFT(event) (EVT_KEY_MASK(event) == KEY_MINUS)
|
||||
#define CURSOR_MOVED_RIGHT(event) (EVT_KEY_MASK(event) == KEY_PLUS)
|
||||
#else
|
||||
#define CURSOR_MOVED_LEFT(event) (EVT_KEY_MASK(event) == KEY_PLUS)
|
||||
#define CURSOR_MOVED_RIGHT(event) (EVT_KEY_MASK(event) == KEY_MINUS)
|
||||
#endif
|
||||
|
||||
#define CASE_EVT_ROTARY_MOVE_RIGHT CASE_EVT_ROTARY_LEFT
|
||||
#define CASE_EVT_ROTARY_MOVE_LEFT CASE_EVT_ROTARY_RIGHT
|
||||
#define IS_ROTARY_MOVE_RIGHT IS_ROTARY_LEFT
|
||||
#define IS_ROTARY_MOVE_LEFT IS_ROTARY_RIGHT
|
||||
#define CURSOR_MOVED_LEFT(event) (event==EVT_ROTARY_LEFT || EVT_KEY_MASK(event) == KEY_LEFT)
|
||||
#define CURSOR_MOVED_RIGHT(event) (event==EVT_ROTARY_RIGHT || EVT_KEY_MASK(event) == KEY_RIGHT)
|
||||
|
||||
#define REPEAT_LAST_CURSOR_MOVE() { if (CURSOR_MOVED_LEFT(event) || CURSOR_MOVED_RIGHT(event)) putEvent(event); else m_posHorz = 0; }
|
||||
#define MOVE_CURSOR_FROM_HERE() if (m_posHorz > 0) REPEAT_LAST_CURSOR_MOVE()
|
||||
|
|
|
@ -114,7 +114,7 @@ int checkIncDec(evt_t event, int val, int i_min, int i_max, unsigned int i_flags
|
|||
}
|
||||
#endif
|
||||
|
||||
if (s_editMode>0 && (IS_ROTARY_RIGHT(event) || event==EVT_KEY_FIRST(KEY_UP) || event==EVT_KEY_REPT(KEY_UP))) {
|
||||
if (s_editMode>0 && event==EVT_ROTARY_RIGHT) {
|
||||
do {
|
||||
if (IS_KEY_REPT(event) && (i_flags & INCDEC_REP10)) {
|
||||
newval += min(10, i_max-val);
|
||||
|
@ -133,7 +133,7 @@ int checkIncDec(evt_t event, int val, int i_min, int i_max, unsigned int i_flags
|
|||
AUDIO_KEYPAD_UP();
|
||||
}
|
||||
}
|
||||
else if (s_editMode>0 && (IS_ROTARY_LEFT(event) || event==EVT_KEY_FIRST(KEY_DOWN) || event==EVT_KEY_REPT(KEY_DOWN))) {
|
||||
else if (s_editMode>0 && event==EVT_ROTARY_LEFT) {
|
||||
do {
|
||||
if (IS_KEY_REPT(event) && (i_flags & INCDEC_REP10)) {
|
||||
newval -= min(10, val-i_min);
|
||||
|
@ -153,7 +153,7 @@ int checkIncDec(evt_t event, int val, int i_min, int i_max, unsigned int i_flags
|
|||
}
|
||||
}
|
||||
|
||||
if (!READ_ONLY() && i_min==0 && i_max==1 && (event==EVT_KEY_BREAK(KEY_ENTER) || IS_ROTARY_BREAK(event))) {
|
||||
if (!READ_ONLY() && i_min==0 && i_max==1 && event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
s_editMode = 0;
|
||||
newval = !val;
|
||||
}
|
||||
|
@ -190,6 +190,7 @@ int checkIncDec(evt_t event, int val, int i_min, int i_max, unsigned int i_flags
|
|||
}
|
||||
|
||||
if (newval != val) {
|
||||
#if 0
|
||||
if (!(i_flags & NO_INCDEC_MARKS) && (newval != i_max) && (newval != i_min) && stops.contains(newval) && !IS_ROTARY_EVENT(event)) {
|
||||
bool pause = (newval > val ? !stops.contains(newval+1) : !stops.contains(newval-1));
|
||||
if (pause) {
|
||||
|
@ -200,6 +201,7 @@ int checkIncDec(evt_t event, int val, int i_min, int i_max, unsigned int i_flags
|
|||
AUDIO_KEYPAD_DOWN();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
storageDirty(i_flags & (EE_GENERAL|EE_MODEL));
|
||||
checkIncDec_Ret = (newval > val ? 1 : -1);
|
||||
}
|
||||
|
@ -218,15 +220,13 @@ int checkIncDec(evt_t event, int val, int i_min, int i_max, unsigned int i_flags
|
|||
|
||||
uint8_t menuPageIndex;
|
||||
uint8_t menuPageCount;
|
||||
uint16_t linesCount;
|
||||
|
||||
bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t rowcount, uint16_t scrollbar_X, uint8_t flags)
|
||||
bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t rowcount, uint8_t flags)
|
||||
{
|
||||
vertpos_t l_posVert = m_posVert;
|
||||
horzpos_t l_posHorz = m_posHorz;
|
||||
uint8_t maxcol = MAXCOL(m_posVert);
|
||||
|
||||
uint8_t maxcol = MAXCOL(l_posVert);
|
||||
|
||||
if (menuTab && !calibrationState && l_posVert<0) {
|
||||
if (menuTab && !calibrationState && m_posVert<0) {
|
||||
int cc = curr;
|
||||
switch (event) {
|
||||
case EVT_KEY_BREAK(KEY_RIGHT):
|
||||
|
@ -243,10 +243,15 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
|||
|
||||
case EVT_KEY_BREAK(KEY_ENTER):
|
||||
if (rowcount > 0) {
|
||||
l_posVert = MENU_FIRST_LINE_EDIT;
|
||||
m_posVert = MENU_FIRST_LINE_EDIT;
|
||||
event = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case EVT_KEY_BREAK(KEY_DOWN):
|
||||
case EVT_KEY_BREAK(KEY_UP):
|
||||
m_posHorz = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (cc != curr) {
|
||||
|
@ -261,20 +266,20 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
|||
switch(event)
|
||||
{
|
||||
case EVT_ENTRY:
|
||||
l_posVert = (menuTab ? -1 : 0);
|
||||
l_posHorz = POS_HORZ_INIT(l_posVert);
|
||||
m_posVert = (menuTab ? -1 : MENU_FIRST_LINE_EDIT);
|
||||
m_posHorz = POS_HORZ_INIT(0);
|
||||
s_editMode = EDIT_MODE_INIT;
|
||||
break;
|
||||
|
||||
case EVT_ENTRY_UP:
|
||||
s_editMode = 0;
|
||||
l_posHorz = POS_HORZ_INIT(l_posVert);
|
||||
m_posHorz = POS_HORZ_INIT(m_posVert);
|
||||
break;
|
||||
|
||||
case EVT_ROTARY_BREAK:
|
||||
if (s_editMode > 1) break;
|
||||
if (m_posHorz < 0 && maxcol > 0 && READ_ONLY_UNLOCKED()) {
|
||||
l_posHorz = 0;
|
||||
m_posHorz = 0;
|
||||
}
|
||||
else if (READ_ONLY_UNLOCKED()) {
|
||||
s_editMode = (s_editMode<=0);
|
||||
|
@ -292,18 +297,18 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
|||
break;
|
||||
}
|
||||
|
||||
if (l_posHorz >= 0 && (COLATTR(l_posVert) & NAVIGATION_LINE_BY_LINE)) {
|
||||
l_posHorz = -1;
|
||||
if (m_posHorz >= 0 && (COLATTR(m_posVert) & NAVIGATION_LINE_BY_LINE)) {
|
||||
m_posHorz = -1;
|
||||
}
|
||||
else if (menuTab && l_posVert >= 0) {
|
||||
l_posVert = -1;
|
||||
l_posHorz = 0;
|
||||
else if (menuTab && m_posVert >= 0) {
|
||||
m_posVert = -1;
|
||||
m_posHorz = 0;
|
||||
#if 0
|
||||
int posVertInit = -1;
|
||||
if (s_pgOfs != 0 || l_posVert != posVertInit) {
|
||||
if (s_pgOfs != 0 || m_posVert != posVertInit) {
|
||||
s_pgOfs = 0;
|
||||
l_posVert = posVertInit;
|
||||
l_posHorz = POS_HORZ_INIT(l_posVert);
|
||||
m_posVert = posVertInit;
|
||||
m_posHorz = POS_HORZ_INIT(m_posVert);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -315,88 +320,94 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
|||
case EVT_KEY_FIRST(KEY_RIGHT):
|
||||
case EVT_KEY_REPT(KEY_RIGHT):
|
||||
if (s_editMode != 0) break;
|
||||
INC(l_posHorz, 0, maxcol);
|
||||
INC(m_posHorz, 0, maxcol);
|
||||
break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_LEFT):
|
||||
case EVT_KEY_REPT(KEY_LEFT):
|
||||
if (s_editMode != 0) break;
|
||||
DEC(l_posHorz, 0, maxcol);
|
||||
DEC(m_posHorz, 0, maxcol);
|
||||
break;
|
||||
|
||||
case EVT_ROTARY_RIGHT:
|
||||
if (s_editMode != 0) break;
|
||||
if ((COLATTR(l_posVert) & NAVIGATION_LINE_BY_LINE)) {
|
||||
if (l_posHorz >= 0) {
|
||||
INC(l_posHorz, 0, maxcol);
|
||||
if ((COLATTR(m_posVert) & NAVIGATION_LINE_BY_LINE)) {
|
||||
if (m_posHorz >= 0) {
|
||||
INC(m_posHorz, 0, maxcol);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (l_posHorz < maxcol) {
|
||||
l_posHorz++;
|
||||
else if (m_posHorz < maxcol) {
|
||||
m_posHorz++;
|
||||
break;
|
||||
}
|
||||
else {
|
||||
l_posHorz = 0;
|
||||
}
|
||||
}
|
||||
// no break
|
||||
do {
|
||||
INC(m_posVert, MENU_FIRST_LINE_EDIT, rowcount-1);
|
||||
} while (CURSOR_NOT_ALLOWED_IN_ROW(m_posVert));
|
||||
m_posHorz = POS_HORZ_INIT(m_posVert);
|
||||
break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_DOWN):
|
||||
case EVT_KEY_REPT(KEY_DOWN):
|
||||
{
|
||||
do {
|
||||
INC(l_posVert, MENU_FIRST_LINE_EDIT, rowcount-1);
|
||||
} while (CURSOR_NOT_ALLOWED_IN_ROW(l_posVert));
|
||||
INC(m_posVert, MENU_FIRST_LINE_EDIT, rowcount-1);
|
||||
} while (CURSOR_NOT_ALLOWED_IN_ROW(m_posVert));
|
||||
s_editMode = 0; // if we go down, we must be in this mode
|
||||
l_posHorz = POS_HORZ_INIT(l_posVert);
|
||||
uint8_t newmaxcol = MAXCOL(m_posVert);
|
||||
if (m_posHorz < 0 || (m_posHorz==0 && maxcol==0) || m_posHorz > newmaxcol)
|
||||
m_posHorz = POS_HORZ_INIT(m_posVert);
|
||||
break;
|
||||
}
|
||||
|
||||
case EVT_ROTARY_LEFT:
|
||||
if (s_editMode != 0) break;
|
||||
if ((COLATTR(l_posVert) & NAVIGATION_LINE_BY_LINE)) {
|
||||
if (l_posHorz >= 0) {
|
||||
DEC(l_posHorz, 0, maxcol);
|
||||
if ((COLATTR(m_posVert) & NAVIGATION_LINE_BY_LINE)) {
|
||||
if (m_posHorz >= 0) {
|
||||
DEC(m_posHorz, 0, maxcol);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (m_posHorz > 0) {
|
||||
m_posHorz--;
|
||||
break;
|
||||
}
|
||||
do {
|
||||
DEC(m_posVert, MENU_FIRST_LINE_EDIT, rowcount-1);
|
||||
} while (CURSOR_NOT_ALLOWED_IN_ROW(m_posVert));
|
||||
if ((COLATTR(m_posVert) & NAVIGATION_LINE_BY_LINE))
|
||||
m_posHorz = -1;
|
||||
else
|
||||
{
|
||||
if (l_posHorz > 0) {
|
||||
l_posHorz--;
|
||||
m_posHorz = min((uint8_t)m_posHorz, MAXCOL(m_posVert));
|
||||
break;
|
||||
}
|
||||
else {
|
||||
l_posHorz = 0xff;
|
||||
}
|
||||
}
|
||||
// no break
|
||||
|
||||
case EVT_KEY_FIRST(KEY_UP):
|
||||
case EVT_KEY_REPT(KEY_UP):
|
||||
{
|
||||
do {
|
||||
DEC(l_posVert, MENU_FIRST_LINE_EDIT, rowcount-1);
|
||||
} while (CURSOR_NOT_ALLOWED_IN_ROW(l_posVert));
|
||||
|
||||
DEC(m_posVert, MENU_FIRST_LINE_EDIT, rowcount-1);
|
||||
} while (CURSOR_NOT_ALLOWED_IN_ROW(m_posVert));
|
||||
s_editMode = 0; // if we go up, we must be in this mode
|
||||
|
||||
if ((COLATTR(l_posVert) & NAVIGATION_LINE_BY_LINE))
|
||||
l_posHorz = -1;
|
||||
uint8_t newmaxcol = MAXCOL(m_posVert);
|
||||
if (m_posHorz < 0 || (m_posHorz==0 && maxcol==0) || m_posHorz > newmaxcol) {
|
||||
if ((COLATTR(m_posVert) & NAVIGATION_LINE_BY_LINE))
|
||||
m_posHorz = -1;
|
||||
else
|
||||
l_posHorz = min((uint8_t)l_posHorz, MAXCOL(l_posVert));
|
||||
m_posHorz = min((uint8_t)m_posHorz, newmaxcol);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int linesCount = rowcount;
|
||||
linesCount = rowcount;
|
||||
|
||||
if (l_posVert <= 0 || (l_posVert==1 && MAXCOL(vertpos_t(0)) >= HIDDEN_ROW) || (l_posVert==2 && MAXCOL(vertpos_t(0)) >= HIDDEN_ROW && MAXCOL(vertpos_t(1)) >= HIDDEN_ROW)) {
|
||||
if (m_posVert <= MENU_FIRST_LINE_EDIT) {
|
||||
s_pgOfs = 0;
|
||||
if (horTab) {
|
||||
linesCount = 0;
|
||||
for (int i=0; i<rowcount; i++) {
|
||||
if (i>=horTabMax || horTab[i] != HIDDEN_ROW) {
|
||||
if (i>horTabMax || horTab[i] != HIDDEN_ROW) {
|
||||
linesCount++;
|
||||
}
|
||||
}
|
||||
|
@ -411,7 +422,7 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
|||
numLines++;
|
||||
}
|
||||
}
|
||||
if (l_posVert < firstLine) {
|
||||
if (m_posVert < firstLine) {
|
||||
s_pgOfs--;
|
||||
}
|
||||
else {
|
||||
|
@ -421,13 +432,13 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
|||
numLines++;
|
||||
}
|
||||
}
|
||||
if (l_posVert >= lastLine) {
|
||||
if (m_posVert >= lastLine) {
|
||||
s_pgOfs++;
|
||||
}
|
||||
else {
|
||||
linesCount = s_pgOfs + NUM_BODY_LINES;
|
||||
for (int i=lastLine; i<rowcount; i++) {
|
||||
if (i>=horTabMax || horTab[i] != HIDDEN_ROW) {
|
||||
if (i>horTabMax || horTab[i] != HIDDEN_ROW) {
|
||||
linesCount++;
|
||||
}
|
||||
}
|
||||
|
@ -438,32 +449,25 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
|||
}
|
||||
}
|
||||
else {
|
||||
if (l_posVert>=NUM_BODY_LINES+s_pgOfs) {
|
||||
s_pgOfs = l_posVert-NUM_BODY_LINES+1;
|
||||
if (m_posVert>=NUM_BODY_LINES+s_pgOfs) {
|
||||
s_pgOfs = m_posVert-NUM_BODY_LINES+1;
|
||||
}
|
||||
else if (l_posVert<s_pgOfs) {
|
||||
s_pgOfs = l_posVert;
|
||||
else if (m_posVert<s_pgOfs) {
|
||||
s_pgOfs = m_posVert;
|
||||
}
|
||||
}
|
||||
|
||||
if (scrollbar_X && linesCount > NUM_BODY_LINES) {
|
||||
lcdDrawScrollbar(scrollbar_X, DEFAULT_SCROLLBAR_Y, DEFAULT_SCROLLBAR_H, s_pgOfs, linesCount, NUM_BODY_LINES);
|
||||
}
|
||||
|
||||
m_posVert = l_posVert;
|
||||
m_posHorz = l_posHorz;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool check_simple(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, vertpos_t rowcount, uint16_t scrollbar_X)
|
||||
bool check_simple(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, vertpos_t rowcount)
|
||||
{
|
||||
return check(event, curr, menuTab, menuTabSize, 0, 0, rowcount, scrollbar_X);
|
||||
return check(event, curr, menuTab, menuTabSize, NULL, 0, rowcount);
|
||||
}
|
||||
|
||||
bool check_submenu_simple(check_event_t event, uint8_t rowcount, uint16_t scrollbar_X)
|
||||
bool check_submenu_simple(check_event_t event, uint8_t rowcount)
|
||||
{
|
||||
return check_simple(event, 0, 0, 0, rowcount, scrollbar_X);
|
||||
return check_simple(event, 0, NULL, 0, rowcount);
|
||||
}
|
||||
|
||||
void repeatLastCursorMove(evt_t event)
|
||||
|
|
|
@ -78,11 +78,11 @@ void message(const pm_char *title, const pm_char *t, const char *last MESSAGE_SO
|
|||
displayAlertBox();
|
||||
|
||||
#if defined(TRANSLATIONS_FR) || defined(TRANSLATIONS_IT) || defined(TRANSLATIONS_CZ)
|
||||
lcd_putsAtt(WARNING_LINE_X, WARNING_LINE_Y, STR_WARNING, ALARM_COLOR|DBLSIZE);
|
||||
lcd_putsAtt(WARNING_LINE_X, WARNING_LINE_Y+15, title, ALARM_COLOR|DBLSIZE);
|
||||
lcdDrawText(WARNING_LINE_X, WARNING_LINE_Y, STR_WARNING, ALARM_COLOR|DBLSIZE);
|
||||
lcdDrawText(WARNING_LINE_X, WARNING_LINE_Y+15, title, ALARM_COLOR|DBLSIZE);
|
||||
#else
|
||||
lcd_putsAtt(WARNING_LINE_X, WARNING_LINE_Y, title, ALARM_COLOR|DBLSIZE);
|
||||
lcd_putsAtt(WARNING_LINE_X, WARNING_LINE_Y+15, STR_WARNING, ALARM_COLOR|DBLSIZE);
|
||||
lcdDrawText(WARNING_LINE_X, WARNING_LINE_Y, title, ALARM_COLOR|DBLSIZE);
|
||||
lcdDrawText(WARNING_LINE_X, WARNING_LINE_Y+15, STR_WARNING, ALARM_COLOR|DBLSIZE);
|
||||
#endif
|
||||
|
||||
if (t) lcd_puts(WARNING_LINE_X, WARNING_INFOLINE_Y, t);
|
||||
|
@ -99,7 +99,7 @@ void message(const pm_char *title, const pm_char *t, const char *last MESSAGE_SO
|
|||
void displayPopup(const char *title)
|
||||
{
|
||||
displayMessageBox();
|
||||
lcd_putsnAtt(WARNING_LINE_X, WARNING_LINE_Y, title, WARNING_LINE_LEN, DBLSIZE|WARNING_COLOR);
|
||||
lcdDrawTextWithLen(WARNING_LINE_X, WARNING_LINE_Y, title, WARNING_LINE_LEN, DBLSIZE|WARNING_COLOR);
|
||||
lcdRefresh();
|
||||
}
|
||||
|
||||
|
@ -110,24 +110,17 @@ void displayWarning(evt_t event)
|
|||
displayMessageBox();
|
||||
else
|
||||
displayWarningBox();
|
||||
lcd_putsnAtt(WARNING_LINE_X, WARNING_LINE_Y, s_warning, WARNING_LINE_LEN, DBLSIZE | (s_warning_type == WARNING_TYPE_INPUT ? WARNING_COLOR : ALARM_COLOR));
|
||||
lcdDrawTextWithLen(WARNING_LINE_X, WARNING_LINE_Y, s_warning, WARNING_LINE_LEN, DBLSIZE | (s_warning_type == WARNING_TYPE_INPUT ? WARNING_COLOR : ALARM_COLOR));
|
||||
if (s_warning_info) {
|
||||
lcd_putsnAtt(WARNING_LINE_X, WARNING_INFOLINE_Y, s_warning_info, s_warning_info_len, WARNING_INFO_FLAGS);
|
||||
lcdDrawTextWithLen(WARNING_LINE_X, WARNING_INFOLINE_Y, s_warning_info, s_warning_info_len, WARNING_INFO_FLAGS);
|
||||
}
|
||||
lcd_puts(WARNING_LINE_X, WARNING_INFOLINE_Y+12, s_warning_type == WARNING_TYPE_ASTERISK ? STR_EXIT : STR_POPUPS);
|
||||
switch (event) {
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
case EVT_ROTARY_BREAK:
|
||||
#endif
|
||||
case EVT_KEY_BREAK(KEY_ENTER):
|
||||
if (s_warning_type == WARNING_TYPE_ASTERISK)
|
||||
break;
|
||||
s_warning_result = true;
|
||||
// no break
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
case EVT_ROTARY_LONG:
|
||||
killEvents(event);
|
||||
#endif
|
||||
case EVT_KEY_BREAK(KEY_EXIT):
|
||||
s_warning = NULL;
|
||||
s_warning_type = WARNING_TYPE_ASTERISK;
|
||||
|
@ -162,23 +155,21 @@ const char * displayMenu(evt_t event)
|
|||
for (uint8_t i=0; i<display_count; i++) {
|
||||
if (i == s_menu_item) {
|
||||
lcdDrawSolidFilledRect(MENU_X+1, i*(FH+1) + y + 1, MENU_W-2, FH+1, TEXT_INVERTED_BGCOLOR);
|
||||
lcd_putsAtt(MENU_X+6, i*(FH+1) + y + 5, s_menu[i], TEXT_INVERTED_COLOR|s_menu_flags);
|
||||
lcdDrawText(MENU_X+6, i*(FH+1) + y + 5, s_menu[i], TEXT_INVERTED_COLOR|s_menu_flags);
|
||||
}
|
||||
else {
|
||||
lcd_putsAtt(MENU_X+6, i*(FH+1) + y + 5, s_menu[i], s_menu_flags);
|
||||
lcdDrawText(MENU_X+6, i*(FH+1) + y + 5, s_menu[i], s_menu_flags);
|
||||
}
|
||||
}
|
||||
|
||||
if (s_menu_count > display_count) {
|
||||
lcdDrawScrollbar(MENU_X+MENU_W-1, y+1, MENU_MAX_LINES * (FH+1), s_menu_offset, s_menu_count, MENU_MAX_LINES);
|
||||
drawScrollbar(MENU_X+MENU_W-1, y+1, MENU_MAX_LINES * (FH+1), s_menu_offset, s_menu_count, MENU_MAX_LINES);
|
||||
}
|
||||
|
||||
switch(event) {
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
CASE_EVT_ROTARY_LEFT
|
||||
#endif
|
||||
case EVT_KEY_FIRST(KEY_MOVE_UP):
|
||||
case EVT_KEY_REPT(KEY_MOVE_UP):
|
||||
switch (event) {
|
||||
case EVT_ROTARY_LEFT:
|
||||
case EVT_KEY_FIRST(KEY_UP):
|
||||
case EVT_KEY_REPT(KEY_UP):
|
||||
if (s_menu_item > 0) {
|
||||
s_menu_item--;
|
||||
}
|
||||
|
@ -195,11 +186,9 @@ const char * displayMenu(evt_t event)
|
|||
}
|
||||
break;
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
CASE_EVT_ROTARY_RIGHT
|
||||
#endif
|
||||
case EVT_KEY_FIRST(KEY_MOVE_DOWN):
|
||||
case EVT_KEY_REPT(KEY_MOVE_DOWN):
|
||||
case EVT_ROTARY_RIGHT:
|
||||
case EVT_KEY_FIRST(KEY_DOWN):
|
||||
case EVT_KEY_REPT(KEY_DOWN):
|
||||
if (s_menu_item < display_count - 1 && s_menu_offset + s_menu_item + 1 < s_menu_count) {
|
||||
s_menu_item++;
|
||||
}
|
||||
|
@ -218,10 +207,6 @@ const char * displayMenu(evt_t event)
|
|||
case EVT_KEY_BREAK(KEY_ENTER):
|
||||
result = s_menu[s_menu_item];
|
||||
// no break
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
CASE_EVT_ROTARY_LONG
|
||||
killEvents(event);
|
||||
#endif
|
||||
case EVT_KEY_BREAK(KEY_EXIT):
|
||||
s_menu_count = 0;
|
||||
s_menu_item = 0;
|
||||
|
|
|
@ -94,55 +94,55 @@ void menuAboutView(evt_t event)
|
|||
break;
|
||||
|
||||
case ABOUT_BERTRAND:
|
||||
lcd_putsAtt(ABOUT_X, MENU_HEADER_HEIGHT+1, STR_ABOUT_BERTRAND_1, INVERS);
|
||||
lcdDrawText(ABOUT_X, MENU_HEADER_HEIGHT+1, STR_ABOUT_BERTRAND_1, INVERS);
|
||||
lcd_puts(ABOUT_X+ABOUT_INDENT, MENU_CONTENT_TOP + FH, STR_ABOUT_BERTRAND_2);
|
||||
lcd_puts(ABOUT_X+ABOUT_INDENT, MENU_CONTENT_TOP + 2*FH, STR_ABOUT_BERTRAND_3);
|
||||
break;
|
||||
|
||||
case ABOUT_ANDRE:
|
||||
lcd_putsAtt(ABOUT_X, MENU_HEADER_HEIGHT+1, STR_ABOUT_ANDRE_1, INVERS);
|
||||
lcdDrawText(ABOUT_X, MENU_HEADER_HEIGHT+1, STR_ABOUT_ANDRE_1, INVERS);
|
||||
lcd_puts(ABOUT_X+ABOUT_INDENT, MENU_CONTENT_TOP + FH, STR_ABOUT_ANDRE_2);
|
||||
lcd_puts(ABOUT_X+ABOUT_INDENT, MENU_CONTENT_TOP + 2*FH, STR_ABOUT_ANDRE_3);
|
||||
break;
|
||||
|
||||
case ABOUT_MIKE:
|
||||
lcd_putsAtt(ABOUT_X, MENU_HEADER_HEIGHT+1, STR_ABOUT_MIKE_1, INVERS);
|
||||
lcdDrawText(ABOUT_X, MENU_HEADER_HEIGHT+1, STR_ABOUT_MIKE_1, INVERS);
|
||||
lcd_puts(ABOUT_X+ABOUT_INDENT, MENU_CONTENT_TOP + FH, STR_ABOUT_MIKE_2);
|
||||
lcd_puts(ABOUT_X+ABOUT_INDENT, MENU_CONTENT_TOP + 2*FH, STR_ABOUT_MIKE_3);
|
||||
lcd_puts(ABOUT_X+ABOUT_INDENT, MENU_CONTENT_TOP + 3*FH, STR_ABOUT_MIKE_4);
|
||||
break;
|
||||
|
||||
case ABOUT_KJELL:
|
||||
lcd_putsAtt(ABOUT_X, MENU_HEADER_HEIGHT+1, STR_ABOUT_KJELL_1, INVERS);
|
||||
lcdDrawText(ABOUT_X, MENU_HEADER_HEIGHT+1, STR_ABOUT_KJELL_1, INVERS);
|
||||
lcd_puts(ABOUT_X+ABOUT_INDENT, MENU_CONTENT_TOP + FH, STR_ABOUT_KJELL_2);
|
||||
lcd_puts(ABOUT_X+ABOUT_INDENT, MENU_CONTENT_TOP + 2*FH, STR_ABOUT_KJELL_3);
|
||||
lcd_puts(ABOUT_X+ABOUT_INDENT, MENU_CONTENT_TOP + 3*FH, STR_ABOUT_KJELL_4);
|
||||
break;
|
||||
|
||||
case ABOUT_MARTIN:
|
||||
lcd_putsAtt(ABOUT_X, MENU_HEADER_HEIGHT+1, STR_ABOUT_MARTIN_1, INVERS);
|
||||
lcdDrawText(ABOUT_X, MENU_HEADER_HEIGHT+1, STR_ABOUT_MARTIN_1, INVERS);
|
||||
lcd_puts(ABOUT_X+ABOUT_INDENT, MENU_CONTENT_TOP + FH, STR_ABOUT_MARTIN_2);
|
||||
break;
|
||||
|
||||
case ABOUT_ROMOLO:
|
||||
lcd_putsAtt(ABOUT_X, MENU_HEADER_HEIGHT+1, STR_ABOUT_ROMOLO_1, INVERS);
|
||||
lcdDrawText(ABOUT_X, MENU_HEADER_HEIGHT+1, STR_ABOUT_ROMOLO_1, INVERS);
|
||||
lcd_puts(ABOUT_X+ABOUT_INDENT, MENU_CONTENT_TOP + FH, STR_ABOUT_ROMOLO_2);
|
||||
lcd_puts(ABOUT_X+ABOUT_INDENT, MENU_CONTENT_TOP + 2*FH, STR_ABOUT_ROMOLO_3);
|
||||
break;
|
||||
|
||||
case ABOUT_ROB:
|
||||
lcd_putsAtt(ABOUT_X, MENU_HEADER_HEIGHT+1, STR_ABOUT_ROB_1, INVERS);
|
||||
lcdDrawText(ABOUT_X, MENU_HEADER_HEIGHT+1, STR_ABOUT_ROB_1, INVERS);
|
||||
lcd_puts(ABOUT_X+ABOUT_INDENT, MENU_CONTENT_TOP + FH, STR_ABOUT_ROB_2);
|
||||
break;
|
||||
|
||||
case ABOUT_HARDWARE:
|
||||
lcd_putsAtt(ABOUT_X, MENU_HEADER_HEIGHT+1, "FrSky", INVERS);
|
||||
lcdDrawText(ABOUT_X, MENU_HEADER_HEIGHT+1, "FrSky", INVERS);
|
||||
lcd_puts(ABOUT_X+ABOUT_INDENT, MENU_CONTENT_TOP + FH, STR_ABOUT_HARDWARE_2);
|
||||
lcd_puts(ABOUT_X+ABOUT_INDENT, MENU_CONTENT_TOP + 2*FH, STR_ABOUT_HARDWARE_3);
|
||||
break;
|
||||
|
||||
case ABOUT_PARENTS:
|
||||
lcd_putsAtt(ABOUT_X, MENU_HEADER_HEIGHT+1, STR_ABOUT_PARENTS_1, INVERS);
|
||||
lcdDrawText(ABOUT_X, MENU_HEADER_HEIGHT+1, STR_ABOUT_PARENTS_1, INVERS);
|
||||
lcd_puts(ABOUT_X+ABOUT_INDENT, MENU_CONTENT_TOP + FH, STR_ABOUT_PARENTS_2);
|
||||
lcd_puts(ABOUT_X+ABOUT_INDENT, MENU_CONTENT_TOP + 2*FH, STR_ABOUT_PARENTS_3);
|
||||
lcd_puts(ABOUT_X+ABOUT_INDENT, MENU_CONTENT_TOP + 3*FH, STR_ABOUT_PARENTS_4);
|
||||
|
|
|
@ -78,7 +78,7 @@ void menuChannelsView(evt_t event)
|
|||
// The label
|
||||
unsigned int lenLabel = ZLEN(g_model.limitData[ch].name);
|
||||
if (lenLabel > 0)
|
||||
lcd_putsnAtt(x+CHANNEL_PADDING_HORZ, y+CHANNEL_PADDING_VERT, g_model.limitData[ch].name, sizeof(g_model.limitData[ch].name), ZCHAR);
|
||||
lcdDrawTextWithLen(x+CHANNEL_PADDING_HORZ, y+CHANNEL_PADDING_VERT, g_model.limitData[ch].name, sizeof(g_model.limitData[ch].name), ZCHAR);
|
||||
else
|
||||
putsChn(x+CHANNEL_PADDING_HORZ, y+CHANNEL_PADDING_VERT, ch+1, 0);
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ void drawTimer(coord_t x, coord_t y, int index)
|
|||
}
|
||||
putsTimer(x+74, y+31, abs(timerState.val), TEXT_COLOR|DBLSIZE|LEFT);
|
||||
if (ZLEN(timerData.name) > 0) {
|
||||
lcd_putsnAtt(x+74, y+20, timerData.name, LEN_TIMER_NAME, ZCHAR|SMLSIZE|TEXT_COLOR);
|
||||
lcdDrawTextWithLen(x+74, y+20, timerData.name, LEN_TIMER_NAME, ZCHAR|SMLSIZE|TEXT_COLOR);
|
||||
}
|
||||
putsStrIdx(x+137, y+17, "TMR", 1, SMLSIZE|TEXT_COLOR);
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ void displayMainTelemetryFields()
|
|||
}
|
||||
att |= (item.isOld() ? ALARM_COLOR : TEXT_COLOR);
|
||||
lcdDrawSolidFilledRect(ALTITUDE_X, VOLTS_Y, ALTITUDE_W, ALTITUDE_H, TEXT_BGCOLOR);
|
||||
lcd_putsAtt(ALTITUDE_X+PADDING, VOLTS_Y+2, "Voltage", att);
|
||||
lcdDrawText(ALTITUDE_X+PADDING, VOLTS_Y+2, "Voltage", att);
|
||||
putsValueWithUnit(ALTITUDE_X+PADDING, VOLTS_Y+12, value, UNIT_VOLTS, DBLSIZE|LEFT|att);
|
||||
}
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ void displayMainTelemetryFields()
|
|||
if (sensor.prec) value /= sensor.prec == 2 ? 100 : 10;
|
||||
LcdFlags att = (item.isOld() ? ALARM_COLOR : TEXT_COLOR);
|
||||
lcdDrawSolidFilledRect(ALTITUDE_X, ALTITUDE_Y, ALTITUDE_W, ALTITUDE_H, TEXT_BGCOLOR);
|
||||
lcd_putsAtt(ALTITUDE_X+PADDING, ALTITUDE_Y+2, "Alt", att);
|
||||
lcdDrawText(ALTITUDE_X+PADDING, ALTITUDE_Y+2, "Alt", att);
|
||||
putsValueWithUnit(ALTITUDE_X+PADDING, ALTITUDE_Y+12, value, UNIT_METERS, DBLSIZE|LEFT|att);
|
||||
}
|
||||
}
|
||||
|
@ -244,13 +244,15 @@ void displayMainViewIndex()
|
|||
|
||||
void onMainViewMenu(const char *result)
|
||||
{
|
||||
if (result == STR_RESET_TIMER1) {
|
||||
if (result == STR_MODEL_SELECT) {
|
||||
chainMenu(menuModelSelect);
|
||||
}
|
||||
else if (result == STR_RESET_TIMER1) {
|
||||
timerReset(0);
|
||||
}
|
||||
else if (result == STR_RESET_TIMER2) {
|
||||
timerReset(1);
|
||||
}
|
||||
#if defined(CPUARM)
|
||||
else if (result == STR_RESET_TIMER3) {
|
||||
timerReset(2);
|
||||
}
|
||||
|
@ -262,27 +264,20 @@ void onMainViewMenu(const char *result)
|
|||
MENU_ADD_ITEM(STR_RESET_TIMER1);
|
||||
MENU_ADD_ITEM(STR_RESET_TIMER2);
|
||||
MENU_ADD_ITEM(STR_RESET_TIMER3);
|
||||
#if defined(FRSKY)
|
||||
MENU_ADD_ITEM(STR_RESET_TELEMETRY);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#if defined(FRSKY)
|
||||
else if (result == STR_RESET_TELEMETRY) {
|
||||
telemetryReset();
|
||||
}
|
||||
#endif
|
||||
else if (result == STR_RESET_FLIGHT) {
|
||||
flightReset();
|
||||
}
|
||||
else if (result == STR_STATISTICS) {
|
||||
chainMenu(menuStatisticsView);
|
||||
}
|
||||
#if defined(CPUARM)
|
||||
else if (result == STR_ABOUT_US) {
|
||||
chainMenu(menuAboutView);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
const uint16_t LBM_MAINVIEW_FLAT[] = {
|
||||
|
@ -296,9 +291,6 @@ const uint16_t LBM_CORSAIR[] = {
|
|||
|
||||
void menuMainView(evt_t event)
|
||||
{
|
||||
// clear the screen
|
||||
lcdDrawSolidFilledRect(0, 0, LCD_W, LCD_H, TEXT_BGCOLOR);
|
||||
|
||||
switch (event) {
|
||||
case EVT_ENTRY:
|
||||
killEvents(KEY_EXIT);
|
||||
|
@ -308,6 +300,7 @@ void menuMainView(evt_t event)
|
|||
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
killEvents(event);
|
||||
MENU_ADD_ITEM(STR_MODEL_SELECT);
|
||||
if (modelHasNotes()) {
|
||||
MENU_ADD_ITEM(STR_VIEW_NOTES);
|
||||
}
|
||||
|
@ -354,7 +347,7 @@ void menuMainView(evt_t event)
|
|||
lcdDrawSolidFilledRect(0, 0, LCD_W, MENU_HEADER_HEIGHT, HEADER_BGCOLOR);
|
||||
lcdDrawBitmapPattern(0, 0, LBM_TOPMENU_POLYGON, TITLE_BGCOLOR);
|
||||
lcdDrawBitmapPattern(4, 10, LBM_TOPMENU_OPENTX, MENU_TITLE_COLOR);
|
||||
lcdDrawTopmenuDatetime();
|
||||
drawTopmenuDatetime();
|
||||
if (1 || usbPlugged()) {
|
||||
lcdDrawBitmapPattern(378, 8, LBM_TOPMENU_USB, MENU_TITLE_COLOR);
|
||||
}
|
||||
|
@ -373,7 +366,7 @@ void menuMainView(evt_t event)
|
|||
}
|
||||
drawTrimSquare(LCD_W/2-25+5*mixerCurrentFlightMode, 253);
|
||||
lcdDrawChar(LCD_W/2-23+5*mixerCurrentFlightMode, 254, '0'+mixerCurrentFlightMode, SMLSIZE|TEXT_INVERTED_COLOR);
|
||||
lcd_putsnAtt(LCD_W/2-getTextWidth(g_model.flightModeData[mode].name, sizeof(g_model.flightModeData[mode].name), ZCHAR|SMLSIZE)/2, 237, g_model.flightModeData[mode].name, sizeof(g_model.flightModeData[mode].name), ZCHAR|SMLSIZE);
|
||||
lcdDrawTextWithLen(LCD_W/2-getTextWidth(g_model.flightModeData[mode].name, sizeof(g_model.flightModeData[mode].name), ZCHAR|SMLSIZE)/2, 237, g_model.flightModeData[mode].name, sizeof(g_model.flightModeData[mode].name), ZCHAR|SMLSIZE);
|
||||
|
||||
// Sticks
|
||||
drawSticks();
|
||||
|
@ -384,7 +377,7 @@ void menuMainView(evt_t event)
|
|||
// Model panel
|
||||
lcdDrawFilledRect(248, 58, 188, 158, SOLID, TEXT_BGCOLOR | OPACITY(5));
|
||||
lcdDrawBitmapPattern(256, 62, LBM_MODEL_ICON, TITLE_BGCOLOR);
|
||||
lcd_putsnAtt(293, 68, g_model.header.name, LEN_MODEL_NAME, ZCHAR|SMLSIZE);
|
||||
lcdDrawTextWithLen(293, 68, g_model.header.name, LEN_MODEL_NAME, ZCHAR|SMLSIZE);
|
||||
lcdDrawSolidHorizontalLine(287, 85, 140, TITLE_BGCOLOR);
|
||||
lcdDrawBitmap(256, 104, LBM_CORSAIR);
|
||||
|
||||
|
@ -398,7 +391,7 @@ void menuMainView(evt_t event)
|
|||
s_gvar_timer--;
|
||||
displayMessageBox();
|
||||
putsStrIdx(WARNING_LINE_X, WARNING_LINE_Y, STR_GV, s_gvar_last+1, DBLSIZE|YELLOW);
|
||||
lcd_putsnAtt(WARNING_LINE_X+45, WARNING_LINE_Y, g_model.gvars[s_gvar_last].name, LEN_GVAR_NAME, DBLSIZE|YELLOW|ZCHAR);
|
||||
lcdDrawTextWithLen(WARNING_LINE_X+45, WARNING_LINE_Y, g_model.gvars[s_gvar_last].name, LEN_GVAR_NAME, DBLSIZE|YELLOW|ZCHAR);
|
||||
lcd_outdezAtt(WARNING_LINE_X, WARNING_INFOLINE_Y, GVAR_VALUE(s_gvar_last, getGVarFlightPhase(mixerCurrentFlightMode, s_gvar_last)), DBLSIZE|LEFT);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -57,9 +57,9 @@ void menuStatisticsView(evt_t event)
|
|||
break;
|
||||
}
|
||||
|
||||
lcd_putsAtt( 10, MENU_CONTENT_TOP + FH*0, "\037\145TOT:\037\317BATT:", HEADER_COLOR);
|
||||
lcd_putsAtt( 10, MENU_CONTENT_TOP + FH*1, "TM1:\037\145TM2:", HEADER_COLOR);
|
||||
lcd_putsAtt( 10, MENU_CONTENT_TOP + FH*2, "THR:\037\145TH%:", HEADER_COLOR);
|
||||
lcdDrawText( 10, MENU_CONTENT_TOP + FH*0, "\037\145TOT:\037\317BATT:", HEADER_COLOR);
|
||||
lcdDrawText( 10, MENU_CONTENT_TOP + FH*1, "TM1:\037\145TM2:", HEADER_COLOR);
|
||||
lcdDrawText( 10, MENU_CONTENT_TOP + FH*2, "THR:\037\145TH%:", HEADER_COLOR);
|
||||
|
||||
putsTimer( 45, MENU_CONTENT_TOP + FH*1, timersStates[0].val);
|
||||
putsTimer( 140, MENU_CONTENT_TOP + FH*1, timersStates[1].val);
|
||||
|
@ -136,9 +136,9 @@ void menuStatisticsDebug(evt_t event)
|
|||
|
||||
#if defined(LUA)
|
||||
lcd_putsLeft(MENU_DEBUG_Y_LUA, "Lua scripts");
|
||||
lcd_putsAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_LUA+1, "[Duration]", HEADER_COLOR|SMLSIZE);
|
||||
lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_LUA+1, "[Duration]", HEADER_COLOR|SMLSIZE);
|
||||
lcd_outdezAtt(MENU_DEBUG_COL1_OFS+30, MENU_DEBUG_Y_LUA, 10*maxLuaDuration, LEFT);
|
||||
lcd_putsAtt(MENU_DEBUG_COL1_OFS+60, MENU_DEBUG_Y_LUA+1, "[Interval]", HEADER_COLOR|SMLSIZE);
|
||||
lcdDrawText(MENU_DEBUG_COL1_OFS+60, MENU_DEBUG_Y_LUA+1, "[Interval]", HEADER_COLOR|SMLSIZE);
|
||||
lcd_outdezAtt(MENU_DEBUG_COL1_OFS+90, MENU_DEBUG_Y_LUA, 10*maxLuaInterval, LEFT);
|
||||
#endif
|
||||
|
||||
|
@ -146,11 +146,11 @@ void menuStatisticsDebug(evt_t event)
|
|||
lcd_outdezAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_MIXMAX, DURATION_MS_PREC2(maxMixerDuration), PREC2|LEFT, "ms");
|
||||
|
||||
lcd_putsLeft(MENU_DEBUG_Y_RTOS, STR_FREESTACKMINB);
|
||||
lcd_putsAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS+1, "[Menus]", HEADER_COLOR|SMLSIZE);
|
||||
lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS+1, "[Menus]", HEADER_COLOR|SMLSIZE);
|
||||
lcd_outdezAtt(MENU_DEBUG_COL1_OFS+30, MENU_DEBUG_Y_RTOS, menusStack.available(), LEFT);
|
||||
lcd_putsAtt(MENU_DEBUG_COL1_OFS+60, MENU_DEBUG_Y_RTOS+1, "[Mix]", HEADER_COLOR|SMLSIZE);
|
||||
lcdDrawText(MENU_DEBUG_COL1_OFS+60, MENU_DEBUG_Y_RTOS+1, "[Mix]", HEADER_COLOR|SMLSIZE);
|
||||
lcd_outdezAtt(MENU_DEBUG_COL1_OFS+90, MENU_DEBUG_Y_RTOS, mixerStack.available(), LEFT);
|
||||
lcd_putsAtt(MENU_DEBUG_COL1_OFS+120, MENU_DEBUG_Y_RTOS+1, "[Audio]", HEADER_COLOR|SMLSIZE);
|
||||
lcdDrawText(MENU_DEBUG_COL1_OFS+120, MENU_DEBUG_Y_RTOS+1, "[Audio]", HEADER_COLOR|SMLSIZE);
|
||||
lcd_outdezAtt(MENU_DEBUG_COL1_OFS+150, MENU_DEBUG_Y_RTOS, audioStack.available(), LEFT);
|
||||
|
||||
lcd_putsCenter(7*FH+1, STR_MENUTORESET);
|
||||
|
|
|
@ -148,7 +148,7 @@ void menuTextView(evt_t event)
|
|||
lcd_putsCenter(MENU_FOOTER_TOP, title, HEADER_COLOR);
|
||||
|
||||
if (lines_count > NUM_BODY_LINES) {
|
||||
lcdDrawScrollbar(LCD_W-5, 30, MENU_FOOTER_TOP-34, s_pgOfs, lines_count, NUM_BODY_LINES);
|
||||
drawScrollbar(LCD_W-5, 30, MENU_FOOTER_TOP-34, s_pgOfs, lines_count, NUM_BODY_LINES);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
void displayHeader(const char *header)
|
||||
{
|
||||
// TODO ? lcd_putsAtt(COLUMN_HEADER_X, MENU_FOOTER_TOP, header, HEADER_COLOR);
|
||||
// TODO ? lcdDrawText(COLUMN_HEADER_X, MENU_FOOTER_TOP, header, HEADER_COLOR);
|
||||
}
|
||||
|
||||
void displayColumnHeader(const char * const *headers, uint8_t index)
|
||||
|
@ -56,7 +56,7 @@ const char * STR_MONTHS[] = { "Jan", "Fev", "Mar", "Apr", "May", "Jun", "Jul", "
|
|||
#define DATETIME_LINE2 23
|
||||
#define DATETIME_LEFT(s) (LCD_W+DATETIME_SEPARATOR_X+8-getTextWidth(s, SMLSIZE))/2
|
||||
|
||||
void lcdDrawTopmenuDatetime()
|
||||
void drawTopmenuDatetime()
|
||||
{
|
||||
lcdDrawSolidVerticalLine(DATETIME_SEPARATOR_X, 7, 31, TEXT_INVERTED_COLOR);
|
||||
|
||||
|
@ -64,10 +64,10 @@ void lcdDrawTopmenuDatetime()
|
|||
gettime(&t);
|
||||
char str[10];
|
||||
sprintf(str, "%d %s", t.tm_mday, STR_MONTHS[t.tm_mon]);
|
||||
lcd_putsAtt(DATETIME_LEFT(str), DATETIME_LINE1, str, SMLSIZE|TEXT_INVERTED_COLOR);
|
||||
lcdDrawText(DATETIME_LEFT(str), DATETIME_LINE1, str, SMLSIZE|TEXT_INVERTED_COLOR);
|
||||
|
||||
getTimerString(str, getValue(MIXSRC_TX_TIME));
|
||||
lcd_putsAtt(DATETIME_LEFT(str), DATETIME_LINE2, str, SMLSIZE|TEXT_INVERTED_COLOR);
|
||||
lcdDrawText(DATETIME_LEFT(str), DATETIME_LINE2, str, SMLSIZE|TEXT_INVERTED_COLOR);
|
||||
}
|
||||
|
||||
void drawStick(coord_t centrex, int16_t xval, int16_t yval)
|
||||
|
@ -84,7 +84,7 @@ void drawStick(coord_t centrex, int16_t xval, int16_t yval)
|
|||
#undef MARKER_WIDTH
|
||||
}
|
||||
|
||||
void lcdDrawCheckBox(coord_t x, coord_t y, uint8_t value, LcdFlags attr)
|
||||
void drawCheckBox(coord_t x, coord_t y, uint8_t value, LcdFlags attr)
|
||||
{
|
||||
if (attr) {
|
||||
lcdDrawSolidFilledRect(x-1, y+2, 13, 13, TEXT_INVERTED_BGCOLOR);
|
||||
|
@ -104,7 +104,7 @@ void lcdDrawCheckBox(coord_t x, coord_t y, uint8_t value, LcdFlags attr)
|
|||
}
|
||||
}
|
||||
|
||||
void lcdDrawScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible)
|
||||
void drawScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible)
|
||||
{
|
||||
lcdDrawSolidVerticalLine(x, y, h, LINE_COLOR);
|
||||
coord_t yofs = (h*offset + count/2) / count;
|
||||
|
@ -114,7 +114,7 @@ void lcdDrawScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t
|
|||
lcdDrawSolidFilledRect(x-1, y + yofs, 3, yhgt, SCROLLBOX_COLOR);
|
||||
}
|
||||
|
||||
void displayProgressBar(const char *label)
|
||||
void drawProgressBar(const char *label)
|
||||
{
|
||||
lcd_putsLeft(4*FH, label);
|
||||
lcdDrawRect(3, 6*FH+4, 204, 7);
|
||||
|
@ -132,7 +132,7 @@ void updateProgressBar(int num, int den)
|
|||
|
||||
#define MENU_ICONS_SPACING 31
|
||||
|
||||
void drawMenuTemplate(const char * name, evt_t event)
|
||||
void drawMenuTemplate(const char * name, evt_t event, uint16_t scrollbar_X)
|
||||
{
|
||||
// clear the screen
|
||||
lcdDrawSolidFilledRect(0, 0, LCD_W, MENU_HEADER_HEIGHT, HEADER_BGCOLOR);
|
||||
|
@ -164,37 +164,41 @@ void drawMenuTemplate(const char * name, evt_t event)
|
|||
lcdDrawBitmapPattern(58+menuPageIndex*MENU_ICONS_SPACING, MENU_TITLE_TOP-9, LBM_CURRENT_DOT, MENU_TITLE_COLOR);
|
||||
}
|
||||
|
||||
lcdDrawTopmenuDatetime();
|
||||
drawTopmenuDatetime();
|
||||
|
||||
if (name) {
|
||||
// must be done at the end so that we can write something at the right of the menu title
|
||||
lcd_putsAtt(MENUS_MARGIN_LEFT, MENU_TITLE_TOP+2, name, MENU_TITLE_COLOR);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_TITLE_TOP+2, name, MENU_TITLE_COLOR);
|
||||
}
|
||||
|
||||
if (scrollbar_X && linesCount > NUM_BODY_LINES) {
|
||||
drawScrollbar(scrollbar_X, DEFAULT_SCROLLBAR_Y, DEFAULT_SCROLLBAR_H, s_pgOfs, linesCount, NUM_BODY_LINES);
|
||||
}
|
||||
}
|
||||
|
||||
select_menu_value_t selectMenuItem(coord_t x, coord_t y, const pm_char *label, const pm_char *values, select_menu_value_t value, select_menu_value_t min, select_menu_value_t max, LcdFlags attr, evt_t event)
|
||||
{
|
||||
lcd_putsColumnLeft(x, y, label);
|
||||
if (values) lcd_putsiAtt(x, y, values, value-min, attr);
|
||||
if (attr) value = checkIncDec(event, value, min, max, (g_menuPos[0] == 0) ? EE_MODEL : EE_GENERAL);
|
||||
if (values) lcdDrawTextAtIndex(x, y, values, value-min, attr);
|
||||
return value;
|
||||
}
|
||||
|
||||
uint8_t onoffMenuItem(uint8_t value, coord_t x, coord_t y, const pm_char *label, LcdFlags attr, evt_t event )
|
||||
{
|
||||
lcdDrawCheckBox(x, y, value, attr);
|
||||
drawCheckBox(x, y, value, attr);
|
||||
return selectMenuItem(x, y, label, NULL, value, 0, 1, attr, event);
|
||||
}
|
||||
|
||||
int8_t switchMenuItem(coord_t x, coord_t y, int8_t value, LcdFlags attr, evt_t event)
|
||||
{
|
||||
lcd_putsColumnLeft(x, y, STR_SWITCH);
|
||||
putsSwitches(x, y, value, attr);
|
||||
if (attr) CHECK_INCDEC_MODELSWITCH(event, value, SWSRC_FIRST_IN_MIXES, SWSRC_LAST_IN_MIXES, isSwitchAvailableInMixes);
|
||||
putsSwitches(x, y, value, attr);
|
||||
return value;
|
||||
}
|
||||
|
||||
void displaySlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr)
|
||||
void drawSlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr)
|
||||
{
|
||||
const int width = 50;
|
||||
lcdDrawHorizontalLine(x, y+5, width, SOLID, TEXT_COLOR);
|
||||
|
@ -261,8 +265,8 @@ int16_t gvarMenuItem(coord_t x, coord_t y, int16_t value, int16_t min, int16_t m
|
|||
#else
|
||||
int16_t gvarMenuItem(coord_t x, coord_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, evt_t event)
|
||||
{
|
||||
if (attr & INVERS) value = checkIncDec(event, value, min, max, EE_MODEL);
|
||||
lcd_outdezAtt(x, y, value, attr, "%");
|
||||
if (attr&INVERS) value = checkIncDec(event, value, min, max, EE_MODEL);
|
||||
return value;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -50,9 +50,9 @@ struct MenuItem {
|
|||
int circularIncDec(int current, int inc, int min, int max, IsValueAvailable isValueAvailable=NULL);
|
||||
void displaySplash();
|
||||
void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr);
|
||||
void lcdDrawScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
|
||||
void drawScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
|
||||
void displayMenuBar(const MenuItem *menu, int index);
|
||||
void displayProgressBar(const char *label);
|
||||
void drawProgressBar(const char *label);
|
||||
void updateProgressBar(int num, int den);
|
||||
void drawGauge(coord_t x, coord_t y, coord_t w, coord_t h, int32_t val, int32_t max);
|
||||
|
||||
|
|
|
@ -218,7 +218,7 @@ void lcd_putc(coord_t x, coord_t y, const unsigned char c)
|
|||
lcdDrawChar(x, y, c, 0);
|
||||
}
|
||||
|
||||
void lcd_putsnAtt(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdFlags flags)
|
||||
void lcdDrawTextWithLen(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdFlags flags)
|
||||
{
|
||||
const coord_t orig_x = x;
|
||||
const uint8_t orig_len = len;
|
||||
|
@ -283,17 +283,17 @@ void lcd_putsnAtt(coord_t x, coord_t y, const pm_char * s, uint8_t len, LcdFlags
|
|||
|
||||
void lcd_putsn(coord_t x, coord_t y, const pm_char * s, uint8_t len)
|
||||
{
|
||||
lcd_putsnAtt(x, y, s, len, 0);
|
||||
lcdDrawTextWithLen(x, y, s, len, 0);
|
||||
}
|
||||
|
||||
void lcd_putsAtt(coord_t x, coord_t y, const pm_char * s, LcdFlags flags)
|
||||
void lcdDrawText(coord_t x, coord_t y, const pm_char * s, LcdFlags flags)
|
||||
{
|
||||
lcd_putsnAtt(x, y, s, 255, flags);
|
||||
lcdDrawTextWithLen(x, y, s, 255, flags);
|
||||
}
|
||||
|
||||
void lcd_puts(coord_t x, coord_t y, const pm_char * s)
|
||||
{
|
||||
lcd_putsAtt(x, y, s, 0);
|
||||
lcdDrawText(x, y, s, 0);
|
||||
}
|
||||
|
||||
void lcd_putsLeft(coord_t y, const pm_char * s)
|
||||
|
@ -302,10 +302,10 @@ void lcd_putsLeft(coord_t y, const pm_char * s)
|
|||
}
|
||||
|
||||
#if !defined(BOOT)
|
||||
void lcd_putsiAtt(coord_t x, coord_t y, const pm_char * s,uint8_t idx, LcdFlags flags)
|
||||
void lcdDrawTextAtIndex(coord_t x, coord_t y, const pm_char * s,uint8_t idx, LcdFlags flags)
|
||||
{
|
||||
uint8_t length = pgm_read_byte(s++);
|
||||
lcd_putsnAtt(x, y, s+length*idx, length, flags & ~(BSS|ZCHAR));
|
||||
lcdDrawTextWithLen(x, y, s+length*idx, length, flags & ~(BSS|ZCHAR));
|
||||
}
|
||||
|
||||
void lcd_outhex4(coord_t x, coord_t y, uint32_t val, LcdFlags flags)
|
||||
|
@ -627,26 +627,26 @@ void putsVBat(coord_t x, coord_t y, LcdFlags att)
|
|||
|
||||
void putsStrIdx(coord_t x, coord_t y, const pm_char *str, uint8_t idx, LcdFlags att)
|
||||
{
|
||||
lcd_putsAtt(x, y, str, att & ~LEADING0);
|
||||
lcdDrawText(x, y, str, att & ~LEADING0);
|
||||
lcd_outdezNAtt(lcdNextPos, y, idx, att|LEFT, 2);
|
||||
}
|
||||
|
||||
void putsStickName(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
||||
{
|
||||
uint8_t length = STR_VSRCRAW[0];
|
||||
lcd_putsnAtt(x, y, STR_VSRCRAW+2+length*(idx+1), length-1, att);
|
||||
lcdDrawTextWithLen(x, y, STR_VSRCRAW+2+length*(idx+1), length-1, att);
|
||||
}
|
||||
|
||||
void putsMixerSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att)
|
||||
{
|
||||
if (idx == 0) {
|
||||
lcd_putsiAtt(x, y, STR_VSRCRAW, 0, att); // TODO macro
|
||||
lcdDrawTextAtIndex(x, y, STR_VSRCRAW, 0, att); // TODO macro
|
||||
}
|
||||
else if (idx <= MIXSRC_LAST_INPUT) {
|
||||
lcdDrawChar(x+2, y+1, CHR_INPUT, TINSIZE);
|
||||
drawFilledRect(x, y, 7, 7);
|
||||
if (ZEXIST(g_model.inputNames[idx-MIXSRC_FIRST_INPUT]))
|
||||
lcd_putsnAtt(x+8, y, g_model.inputNames[idx-MIXSRC_FIRST_INPUT], LEN_INPUT_NAME, ZCHAR|att);
|
||||
lcdDrawTextWithLen(x+8, y, g_model.inputNames[idx-MIXSRC_FIRST_INPUT], LEN_INPUT_NAME, ZCHAR|att);
|
||||
else
|
||||
lcd_outdezNAtt(x+8, y, idx, att|LEADING0|LEFT, 2);
|
||||
}
|
||||
|
@ -657,7 +657,7 @@ void putsMixerSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att)
|
|||
if (qr.quot < MAX_SCRIPTS && qr.rem < scriptInputsOutputs[qr.quot].outputsCount) {
|
||||
lcdDrawChar(x+2, y+1, '1'+qr.quot, TINSIZE);
|
||||
drawFilledRect(x, y, 7, 7);
|
||||
lcd_putsnAtt(x+8, y, scriptInputsOutputs[qr.quot].outputs[qr.rem].name, att & STREXPANDED ? 9 : 4, att);
|
||||
lcdDrawTextWithLen(x+8, y, scriptInputsOutputs[qr.quot].outputs[qr.rem].name, att & STREXPANDED ? 9 : 4, att);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
@ -676,22 +676,22 @@ void putsMixerSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att)
|
|||
lcdDrawChar(x, y, '\310', att); //pot symbol
|
||||
else
|
||||
lcdDrawChar(x, y, '\311', att); //slider symbol
|
||||
lcd_putsnAtt(lcdNextPos, y, g_eeGeneral.anaNames[idx], LEN_ANA_NAME, ZCHAR|att);
|
||||
lcdDrawTextWithLen(lcdNextPos, y, g_eeGeneral.anaNames[idx], LEN_ANA_NAME, ZCHAR|att);
|
||||
}
|
||||
else
|
||||
lcd_putsiAtt(x, y, STR_VSRCRAW, idx+1, att);
|
||||
lcdDrawTextAtIndex(x, y, STR_VSRCRAW, idx+1, att);
|
||||
}
|
||||
else if (idx >= MIXSRC_FIRST_SWITCH && idx <= MIXSRC_LAST_SWITCH) {
|
||||
idx = idx-MIXSRC_FIRST_SWITCH;
|
||||
if (ZEXIST(g_eeGeneral.switchNames[idx])) {
|
||||
lcdDrawChar(x, y, '\312', att); //switch symbol
|
||||
lcd_putsnAtt(lcdNextPos, y, g_eeGeneral.switchNames[idx], LEN_SWITCH_NAME, ZCHAR|att);
|
||||
lcdDrawTextWithLen(lcdNextPos, y, g_eeGeneral.switchNames[idx], LEN_SWITCH_NAME, ZCHAR|att);
|
||||
}
|
||||
else
|
||||
lcd_putsiAtt(x, y, STR_VSRCRAW, idx+MIXSRC_FIRST_SWITCH-MIXSRC_Rud+1, att);
|
||||
lcdDrawTextAtIndex(x, y, STR_VSRCRAW, idx+MIXSRC_FIRST_SWITCH-MIXSRC_Rud+1, att);
|
||||
}
|
||||
else if (idx < MIXSRC_SW1)
|
||||
lcd_putsiAtt(x, y, STR_VSRCRAW, idx-MIXSRC_Rud+1, att);
|
||||
lcdDrawTextAtIndex(x, y, STR_VSRCRAW, idx-MIXSRC_Rud+1, att);
|
||||
else if (idx <= MIXSRC_LAST_LOGICAL_SWITCH)
|
||||
putsSwitches(x, y, SWSRC_SW1+idx-MIXSRC_SW1, att);
|
||||
else if (idx < MIXSRC_CH1)
|
||||
|
@ -700,26 +700,26 @@ void putsMixerSource(coord_t x, coord_t y, uint32_t idx, LcdFlags att)
|
|||
putsStrIdx(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);
|
||||
lcd_putsnAtt(lcdLastPos+3, y, g_model.limitData[idx-MIXSRC_CH1].name, LEN_CHANNEL_NAME, ZCHAR|att|SMLSIZE);
|
||||
lcdDrawTextWithLen(lcdLastPos+3, y, g_model.limitData[idx-MIXSRC_CH1].name, LEN_CHANNEL_NAME, ZCHAR|att|SMLSIZE);
|
||||
}
|
||||
}
|
||||
else if (idx <= MIXSRC_LAST_GVAR) {
|
||||
putsStrIdx(x, y, STR_GV, idx-MIXSRC_GVAR1+1, att);
|
||||
}
|
||||
else if (idx < MIXSRC_FIRST_TELEM) {
|
||||
lcd_putsiAtt(x, y, STR_VSRCRAW, idx-MIXSRC_Rud+1-NUM_LOGICAL_SWITCH-NUM_TRAINER-NUM_CHNOUT-MAX_GVARS, att);
|
||||
lcdDrawTextAtIndex(x, y, STR_VSRCRAW, idx-MIXSRC_Rud+1-NUM_LOGICAL_SWITCH-NUM_TRAINER-NUM_CHNOUT-MAX_GVARS, att);
|
||||
}
|
||||
else {
|
||||
idx -= MIXSRC_FIRST_TELEM;
|
||||
div_t qr = div(idx, 3);
|
||||
lcd_putsnAtt(x, y, g_model.telemetrySensors[qr.quot].label, TELEM_LABEL_LEN, ZCHAR|att);
|
||||
lcdDrawTextWithLen(x, y, g_model.telemetrySensors[qr.quot].label, TELEM_LABEL_LEN, ZCHAR|att);
|
||||
if (qr.rem) lcdDrawChar(lcdLastPos, y, qr.rem==2 ? '+' : '-', att);
|
||||
}
|
||||
}
|
||||
|
||||
void putsChnLetter(coord_t x, coord_t y, uint8_t idx, LcdFlags att)
|
||||
{
|
||||
lcd_putsiAtt(x, y, STR_RETA123, idx-1, att);
|
||||
lcdDrawTextAtIndex(x, y, STR_RETA123, idx-1, att);
|
||||
}
|
||||
|
||||
void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att)
|
||||
|
@ -730,17 +730,17 @@ void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att)
|
|||
putsStrIdx(x, y, STR_MODEL, id+1, att|LEADING0);
|
||||
}
|
||||
else {
|
||||
lcd_putsnAtt(x, y, name, sizeof(g_model.header.name), ZCHAR|att);
|
||||
lcdDrawTextWithLen(x, y, name, sizeof(g_model.header.name), ZCHAR|att);
|
||||
}
|
||||
}
|
||||
|
||||
void putsSwitches(coord_t x, coord_t y, int32_t idx, LcdFlags att)
|
||||
{
|
||||
if (idx == SWSRC_NONE) {
|
||||
return lcd_putsiAtt(x, y, STR_VSWITCHES, 0, att);
|
||||
return lcdDrawTextAtIndex(x, y, STR_VSWITCHES, 0, att);
|
||||
}
|
||||
else if (idx == SWSRC_OFF) {
|
||||
return lcd_putsiAtt(x, y, STR_OFFON, 0, att);
|
||||
return lcdDrawTextAtIndex(x, y, STR_OFFON, 0, att);
|
||||
}
|
||||
|
||||
if (idx < 0) {
|
||||
|
@ -751,7 +751,7 @@ void putsSwitches(coord_t x, coord_t y, int32_t idx, LcdFlags att)
|
|||
if (idx <= SWSRC_LAST_SWITCH) {
|
||||
div_t swinfo = switchInfo(idx);
|
||||
if (ZEXIST(g_eeGeneral.switchNames[swinfo.quot])) {
|
||||
lcd_putsnAtt(x, y, g_eeGeneral.switchNames[swinfo.quot], LEN_SWITCH_NAME, ZCHAR|att);
|
||||
lcdDrawTextWithLen(x, y, g_eeGeneral.switchNames[swinfo.quot], LEN_SWITCH_NAME, ZCHAR|att);
|
||||
}
|
||||
else {
|
||||
lcdDrawChar(x, y, 'S', att);
|
||||
|
@ -765,29 +765,29 @@ void putsSwitches(coord_t x, coord_t y, int32_t idx, LcdFlags att)
|
|||
putsStrIdx(x, y, "S", swinfo.quot*10+swinfo.rem+11, att);
|
||||
}
|
||||
else if (idx <= SWSRC_LAST_TRIM) {
|
||||
lcd_putsiAtt(x, y, STR_VSWITCHES, idx-SWSRC_FIRST_TRIM+1, att);
|
||||
lcdDrawTextAtIndex(x, y, STR_VSWITCHES, idx-SWSRC_FIRST_TRIM+1, att);
|
||||
}
|
||||
else if (idx <= SWSRC_LAST_LOGICAL_SWITCH) {
|
||||
putsStrIdx(x, y, "L", idx-SWSRC_FIRST_LOGICAL_SWITCH+1, att);
|
||||
}
|
||||
else if (idx <= SWSRC_ONE) {
|
||||
lcd_putsiAtt(x, y, STR_VSWITCHES, idx-SWSRC_ON+1+(2*NUM_STICKS), att);
|
||||
lcdDrawTextAtIndex(x, y, STR_VSWITCHES, idx-SWSRC_ON+1+(2*NUM_STICKS), att);
|
||||
}
|
||||
else if (idx <= SWSRC_LAST_FLIGHT_MODE) {
|
||||
putsStrIdx(x, y, STR_FP, idx-SWSRC_FIRST_FLIGHT_MODE, att);
|
||||
}
|
||||
else if (idx == SWSRC_TELEMETRY_STREAMING) {
|
||||
lcd_putsAtt(x, y, "Tele", att);
|
||||
lcdDrawText(x, y, "Tele", att);
|
||||
}
|
||||
else {
|
||||
lcd_putsnAtt(x, y, g_model.telemetrySensors[idx-SWSRC_FIRST_SENSOR].label, TELEM_LABEL_LEN, ZCHAR|att);
|
||||
lcdDrawTextWithLen(x, y, g_model.telemetrySensors[idx-SWSRC_FIRST_SENSOR].label, TELEM_LABEL_LEN, ZCHAR|att);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(FLIGHT_MODES)
|
||||
void putsFlightMode(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
||||
{
|
||||
if (idx==0) { lcd_putsiAtt(x, y, STR_MMMINV, 0, att); return; }
|
||||
if (idx==0) { lcdDrawTextAtIndex(x, y, STR_MMMINV, 0, att); return; }
|
||||
if (idx < 0) { lcdDrawChar(x-2, y, '!', att); idx = -idx; }
|
||||
if (att & CONDENSED)
|
||||
lcd_outdezNAtt(x+FW*1, y, idx-1, (att & ~CONDENSED), 1);
|
||||
|
@ -811,7 +811,7 @@ void putsCurveRef(coord_t x, coord_t y, CurveRef &curve, LcdFlags att)
|
|||
break;
|
||||
|
||||
case CURVE_REF_FUNC:
|
||||
lcd_putsiAtt(x, y, STR_VCURVEFUNC, curve.value, att);
|
||||
lcdDrawTextAtIndex(x, y, STR_VCURVEFUNC, curve.value, att);
|
||||
break;
|
||||
|
||||
case CURVE_REF_CUSTOM:
|
||||
|
@ -824,7 +824,7 @@ void putsCurveRef(coord_t x, coord_t y, CurveRef &curve, LcdFlags att)
|
|||
void putsCurve(coord_t x, coord_t y, int8_t idx, LcdFlags att)
|
||||
{
|
||||
if (idx == 0) {
|
||||
return lcd_putsiAtt(x, y, STR_MMMINV, 0, att);
|
||||
return lcdDrawTextAtIndex(x, y, STR_MMMINV, 0, att);
|
||||
}
|
||||
|
||||
if (idx < 0) {
|
||||
|
@ -839,7 +839,7 @@ void putsTimerMode(coord_t x, coord_t y, int32_t mode, LcdFlags att)
|
|||
{
|
||||
if (mode >= 0) {
|
||||
if (mode < TMRMODE_COUNT)
|
||||
return lcd_putsiAtt(x, y, STR_VTMRMODES, mode, att);
|
||||
return lcdDrawTextAtIndex(x, y, STR_VTMRMODES, mode, att);
|
||||
else
|
||||
mode -= (TMRMODE_COUNT-1);
|
||||
}
|
||||
|
@ -853,7 +853,7 @@ void putsTrimMode(coord_t x, coord_t y, uint8_t phase, uint8_t idx, LcdFlags att
|
|||
unsigned int p = mode >> 1;
|
||||
|
||||
if (mode == TRIM_MODE_NONE) {
|
||||
lcd_putsAtt(x, y, "--", att);
|
||||
lcdDrawText(x, y, "--", att);
|
||||
}
|
||||
else {
|
||||
if (mode % 2 == 0)
|
||||
|
@ -880,7 +880,7 @@ void putsValueWithUnit(coord_t x, coord_t y, lcdint_t val, uint8_t unit, LcdFlag
|
|||
// convertUnit(val, unit);
|
||||
lcd_outdezAtt(x, y, val, att & (~NO_UNIT));
|
||||
if (!(att & NO_UNIT) && unit != UNIT_RAW) {
|
||||
lcd_putsiAtt(lcdLastPos/*+1*/, y, STR_VTELEMUNIT, unit, 0);
|
||||
lcdDrawTextAtIndex(lcdLastPos/*+1*/, y, STR_VTELEMUNIT, unit, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -74,11 +74,7 @@
|
|||
/* lcd puts flags */
|
||||
/* no 0x80 here because of "GV"1 which is aligned LEFT */
|
||||
/* no 0x10 here because of "MODEL"01 which uses LEADING0 */
|
||||
#if defined(CPUARM)
|
||||
#define BSS 0x00
|
||||
#else
|
||||
#define BSS 0x20
|
||||
#endif
|
||||
#define BSS 0x00
|
||||
#define ZCHAR 0x80
|
||||
|
||||
/* lcd outdez flags */
|
||||
|
@ -149,9 +145,9 @@ typedef const char pm_char;
|
|||
|
||||
void lcd_putc(coord_t x, coord_t y, const unsigned char c);
|
||||
void lcdDrawChar(coord_t x, coord_t y, const unsigned char c, LcdFlags mode);
|
||||
void lcd_putsAtt(coord_t x, coord_t y, const pm_char * s, LcdFlags mode);
|
||||
void lcd_putsiAtt(coord_t x, coord_t y, const pm_char * s,uint8_t idx, LcdFlags mode);
|
||||
void lcd_putsnAtt(coord_t x, coord_t y, const pm_char * s,unsigned char len, LcdFlags mode);
|
||||
void lcdDrawText(coord_t x, coord_t y, const pm_char * s, LcdFlags mode);
|
||||
void lcdDrawTextAtIndex(coord_t x, coord_t y, const pm_char * s,uint8_t idx, LcdFlags mode);
|
||||
void lcdDrawTextWithLen(coord_t x, coord_t y, const pm_char * s,unsigned char len, LcdFlags mode);
|
||||
void lcd_puts(coord_t x, coord_t y, const pm_char * s);
|
||||
void lcd_putsn(coord_t x, coord_t y, const pm_char * s, unsigned char len);
|
||||
void lcd_putsLeft(coord_t y, const pm_char * s);
|
||||
|
|
|
@ -119,7 +119,7 @@ void menuCommonCalib(uint8_t event)
|
|||
|
||||
case 1:
|
||||
// SET MIDPOINT
|
||||
lcd_putsAtt(0*FW, MENU_HEADER_HEIGHT+FH, STR_SETMIDPOINT, INVERS);
|
||||
lcdDrawText(0*FW, MENU_HEADER_HEIGHT+FH, STR_SETMIDPOINT, INVERS);
|
||||
lcd_putsLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUWHENDONE);
|
||||
|
||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
||||
|
@ -136,7 +136,7 @@ void menuCommonCalib(uint8_t event)
|
|||
case 2:
|
||||
// MOVE STICKS/POTS
|
||||
STICK_SCROLL_DISABLE();
|
||||
lcd_putsAtt(0*FW, MENU_HEADER_HEIGHT+FH, STR_MOVESTICKSPOTS, INVERS);
|
||||
lcdDrawText(0*FW, MENU_HEADER_HEIGHT+FH, STR_MOVESTICKSPOTS, INVERS);
|
||||
lcd_putsLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUWHENDONE);
|
||||
|
||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
||||
|
|
|
@ -59,7 +59,7 @@ void menuGeneralDiagKeys(uint8_t event)
|
|||
|
||||
if (i<6) {
|
||||
y = i*FH+MENU_HEADER_HEIGHT+FH;
|
||||
lcd_putsiAtt(0, y, STR_VKEYS, (5-i), 0);
|
||||
lcdDrawTextAtIndex(0, y, STR_VKEYS, (5-i), 0);
|
||||
displayKeyState(5*FW+2, y, (EnumKeys)(KEY_MENU+(5-i)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -122,11 +122,11 @@ void menuGeneralHardware(uint8_t event)
|
|||
case ITEM_SETUP_HW_RS:
|
||||
{
|
||||
int idx = (k<=ITEM_SETUP_HW_STICK4 ? k-ITEM_SETUP_HW_STICK1 : k-ITEM_SETUP_HW_LS+MIXSRC_SLIDER1-MIXSRC_Rud);
|
||||
lcd_putsiAtt(INDENT_WIDTH, y, STR_VSRCRAW, idx+1, 0);
|
||||
lcdDrawTextAtIndex(INDENT_WIDTH, y, STR_VSRCRAW, idx+1, 0);
|
||||
if (ZEXIST(g_eeGeneral.anaNames[idx]) || attr)
|
||||
editName(HW_SETTINGS_COLUMN, y, g_eeGeneral.anaNames[idx], LEN_ANA_NAME, event, attr);
|
||||
else
|
||||
lcd_putsiAtt(HW_SETTINGS_COLUMN, y, STR_MMMINV, 0, 0);
|
||||
lcdDrawTextAtIndex(HW_SETTINGS_COLUMN, y, STR_MMMINV, 0, 0);
|
||||
break;
|
||||
}
|
||||
#if defined(REV9E)
|
||||
|
@ -135,11 +135,11 @@ void menuGeneralHardware(uint8_t event)
|
|||
{
|
||||
int idx = k - ITEM_SETUP_HW_LS2;
|
||||
uint8_t mask = (0x01 << idx);
|
||||
lcd_putsiAtt(INDENT_WIDTH, y, STR_VSRCRAW, NUM_STICKS+NUM_XPOTS+2+idx+1, m_posHorz < 0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(INDENT_WIDTH, y, STR_VSRCRAW, NUM_STICKS+NUM_XPOTS+2+idx+1, m_posHorz < 0 ? attr : 0);
|
||||
if (ZEXIST(g_eeGeneral.anaNames[NUM_STICKS+NUM_XPOTS+2+idx]) || (attr && m_posHorz == 0))
|
||||
editName(HW_SETTINGS_COLUMN, y, g_eeGeneral.anaNames[NUM_STICKS+NUM_XPOTS+2+idx], LEN_ANA_NAME, event, attr && m_posHorz == 0);
|
||||
else
|
||||
lcd_putsiAtt(HW_SETTINGS_COLUMN, y, STR_MMMINV, 0, 0);
|
||||
lcdDrawTextAtIndex(HW_SETTINGS_COLUMN, y, STR_MMMINV, 0, 0);
|
||||
uint8_t potType = (g_eeGeneral.slidersConfig & mask) >> idx;
|
||||
potType = selectMenuItem(HW_SETTINGS_COLUMN+5*FW, y, "", STR_SLIDERTYPES, potType, SLIDER_NONE, SLIDER_WITH_DETENT, m_posHorz == 1 ? attr : 0, event);
|
||||
g_eeGeneral.slidersConfig &= ~mask;
|
||||
|
@ -162,11 +162,11 @@ void menuGeneralHardware(uint8_t event)
|
|||
int idx = k - ITEM_SETUP_HW_POT1;
|
||||
uint8_t shift = (2*idx);
|
||||
uint8_t mask = (0x03 << shift);
|
||||
lcd_putsiAtt(INDENT_WIDTH, y, STR_VSRCRAW, NUM_STICKS+idx+1, m_posHorz < 0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(INDENT_WIDTH, y, STR_VSRCRAW, NUM_STICKS+idx+1, m_posHorz < 0 ? attr : 0);
|
||||
if (ZEXIST(g_eeGeneral.anaNames[NUM_STICKS+idx]) || (attr && m_posHorz == 0))
|
||||
editName(HW_SETTINGS_COLUMN, y, g_eeGeneral.anaNames[NUM_STICKS+idx], LEN_ANA_NAME, event, attr && m_posHorz == 0);
|
||||
else
|
||||
lcd_putsiAtt(HW_SETTINGS_COLUMN, y, STR_MMMINV, 0, 0);
|
||||
lcdDrawTextAtIndex(HW_SETTINGS_COLUMN, y, STR_MMMINV, 0, 0);
|
||||
uint8_t potType = (g_eeGeneral.potsConfig & mask) >> shift;
|
||||
potType = selectMenuItem(HW_SETTINGS_COLUMN+5*FW, y, "", STR_POTTYPES, potType, POT_NONE, POT_WITHOUT_DETENT, m_posHorz == 1 ? attr : 0, event);
|
||||
g_eeGeneral.potsConfig &= ~mask;
|
||||
|
@ -199,11 +199,11 @@ void menuGeneralHardware(uint8_t event)
|
|||
{
|
||||
int index = k-ITEM_SETUP_HW_SA;
|
||||
int config = SWITCH_CONFIG(index);
|
||||
lcd_putsiAtt(INDENT_WIDTH, y, STR_VSRCRAW, MIXSRC_FIRST_SWITCH-MIXSRC_Rud+index+1, m_posHorz < 0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(INDENT_WIDTH, y, STR_VSRCRAW, MIXSRC_FIRST_SWITCH-MIXSRC_Rud+index+1, m_posHorz < 0 ? attr : 0);
|
||||
if (ZEXIST(g_eeGeneral.switchNames[index]) || (attr && m_posHorz == 0))
|
||||
editName(HW_SETTINGS_COLUMN, y, g_eeGeneral.switchNames[index], LEN_SWITCH_NAME, event, m_posHorz == 0 ? attr : 0);
|
||||
else
|
||||
lcd_putsiAtt(HW_SETTINGS_COLUMN, y, STR_MMMINV, 0, 0);
|
||||
lcdDrawTextAtIndex(HW_SETTINGS_COLUMN, y, STR_MMMINV, 0, 0);
|
||||
config = selectMenuItem(HW_SETTINGS_COLUMN+5*FW, y, "", STR_SWTYPES, config, SWITCH_NONE, SWITCH_TYPE_MAX(index), m_posHorz == 1 ? attr : 0, event);
|
||||
if (attr && checkIncDec_Ret) {
|
||||
swconfig_t mask = (swconfig_t)0x03 << (2*index);
|
||||
|
|
|
@ -99,7 +99,7 @@ void flashBootloader(const char * filename)
|
|||
UINT count;
|
||||
|
||||
lcdClear();
|
||||
displayProgressBar(STR_WRITING);
|
||||
drawProgressBar(STR_WRITING);
|
||||
|
||||
static uint8_t unlocked = 0;
|
||||
if (!unlocked) {
|
||||
|
@ -138,7 +138,7 @@ void flashSportDevice(ModuleIndex module, const char *filename)
|
|||
watchdogSetTimeout(60*60*100/*1h*/);
|
||||
|
||||
lcdClear();
|
||||
displayProgressBar(STR_WRITING);
|
||||
drawProgressBar(STR_WRITING);
|
||||
|
||||
sportFirmwareUpdate(module, filename);
|
||||
|
||||
|
@ -465,7 +465,7 @@ void menuGeneralSdManager(uint8_t _event)
|
|||
}
|
||||
}
|
||||
else {
|
||||
lcd_putsAtt(lcdNextPos, y, reusableBuffer.sdmanager.lines[i], attr);
|
||||
lcdDrawText(lcdNextPos, y, reusableBuffer.sdmanager.lines[i], attr);
|
||||
}
|
||||
if (IS_DIRECTORY(reusableBuffer.sdmanager.lines[i])) { lcdDrawChar(lcdNextPos, y, ']', s_editMode == EDIT_MODIFY_STRING ? 0 : attr); }
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ const pm_uchar sticks[] PROGMEM = {
|
|||
|
||||
#define SLIDER_5POS(y, value, label, event, attr) { \
|
||||
int8_t tmp = value; \
|
||||
displaySlider(RADIO_SETUP_2ND_COLUMN, y, 2+tmp, 4, attr); \
|
||||
drawSlider(RADIO_SETUP_2ND_COLUMN, y, 2+tmp, 4, attr); \
|
||||
value = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, label, NULL, tmp, -2, +2, attr, event); \
|
||||
}
|
||||
|
||||
|
@ -68,11 +68,11 @@ enum menuGeneralSetupItems {
|
|||
ITEM_SETUP_SPEAKER_PITCH,
|
||||
ITEM_SETUP_WAV_VOLUME,
|
||||
ITEM_SETUP_BACKGROUND_VOLUME,
|
||||
CASE_VARIO_CPUARM(ITEM_SETUP_VARIO_LABEL)
|
||||
CASE_VARIO_CPUARM(ITEM_SETUP_VARIO_VOLUME)
|
||||
CASE_VARIO_CPUARM(ITEM_SETUP_VARIO_PITCH)
|
||||
CASE_VARIO_CPUARM(ITEM_SETUP_VARIO_RANGE)
|
||||
CASE_VARIO_CPUARM(ITEM_SETUP_VARIO_REPEAT)
|
||||
CASE_VARIO(ITEM_SETUP_VARIO_LABEL)
|
||||
CASE_VARIO(ITEM_SETUP_VARIO_VOLUME)
|
||||
CASE_VARIO(ITEM_SETUP_VARIO_PITCH)
|
||||
CASE_VARIO(ITEM_SETUP_VARIO_RANGE)
|
||||
CASE_VARIO(ITEM_SETUP_VARIO_REPEAT)
|
||||
CASE_HAPTIC(ITEM_SETUP_HAPTIC_LABEL)
|
||||
CASE_HAPTIC(ITEM_SETUP_HAPTIC_MODE)
|
||||
CASE_HAPTIC(ITEM_SETUP_HAPTIC_LENGTH)
|
||||
|
@ -114,7 +114,7 @@ void menuGeneralSetup(uint8_t event)
|
|||
|
||||
if ((m_posVert==ITEM_SETUP_DATE || m_posVert==ITEM_SETUP_TIME) &&
|
||||
(s_editMode>0) &&
|
||||
(event==EVT_KEY_FIRST(KEY_ENTER) || event==EVT_KEY_FIRST(KEY_EXIT) || IS_ROTARY_BREAK(event) || IS_ROTARY_LONG(event))) {
|
||||
(event==EVT_KEY_FIRST(KEY_ENTER) || event==EVT_KEY_BREAK(KEY_ENTER) || event==EVT_KEY_LONG(KEY_ENTER) || event==EVT_KEY_FIRST(KEY_EXIT))) {
|
||||
// set the date and time into RTC chip
|
||||
rtcSetTime(&t);
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ void menuGeneralSetup(uint8_t event)
|
|||
}
|
||||
#endif
|
||||
|
||||
MENU(STR_MENURADIOSETUP, menuTabGeneral, e_Setup, ITEM_SETUP_MAX, { 2, 2, 1, LABEL(SOUND), 0, 0, 0, 0, 0, 0, 0, CASE_VARIO_CPUARM(LABEL(VARIO)) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_HAPTIC(LABEL(HAPTIC)) CASE_HAPTIC(0) CASE_HAPTIC(0) CASE_HAPTIC(0) 0, LABEL(ALARMS), 0, 0, 0, 0, IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, 0, CASE_REVPLUS(0) CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, CASE_SPLASH_PARAM(0) CASE_GPS(LABEL(GPS)) CASE_GPS(0) CASE_GPS(0) CASE_GPS(0) CASE_PXX(0) 0, 0, IF_FAI_CHOICE(0) CASE_MAVLINK(0) 0, 0, LABEL(TX_MODE), 0, 1/*to force edit mode*/ });
|
||||
MENU(STR_MENURADIOSETUP, menuTabGeneral, e_Setup, ITEM_SETUP_MAX, { 2, 2, 1, LABEL(SOUND), 0, 0, 0, 0, 0, 0, 0, CASE_VARIO(LABEL(VARIO)) CASE_VARIO(0) CASE_VARIO(0) CASE_VARIO(0) CASE_VARIO(0) CASE_HAPTIC(LABEL(HAPTIC)) CASE_HAPTIC(0) CASE_HAPTIC(0) CASE_HAPTIC(0) 0, LABEL(ALARMS), 0, 0, 0, 0, IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, 0, CASE_REVPLUS(0) CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, CASE_SPLASH_PARAM(0) CASE_GPS(LABEL(GPS)) CASE_GPS(0) CASE_GPS(0) CASE_GPS(0) CASE_PXX(0) 0, 0, IF_FAI_CHOICE(0) CASE_MAVLINK(0) 0, 0, LABEL(TX_MODE), 0, 1/*to force edit mode*/ });
|
||||
|
||||
int sub = m_posVert;
|
||||
|
||||
|
@ -225,7 +225,7 @@ void menuGeneralSetup(uint8_t event)
|
|||
{
|
||||
lcd_putsLeft(y, STR_SPEAKER_VOLUME);
|
||||
uint8_t b = g_eeGeneral.speakerVolume+VOLUME_LEVEL_DEF;
|
||||
displaySlider(RADIO_SETUP_2ND_COLUMN, y, b, VOLUME_LEVEL_MAX, attr);
|
||||
drawSlider(RADIO_SETUP_2ND_COLUMN, y, b, VOLUME_LEVEL_MAX, attr);
|
||||
if (attr) {
|
||||
CHECK_INCDEC_GENVAR(event, b, 0, VOLUME_LEVEL_MAX);
|
||||
if (checkIncDec_Ret) {
|
||||
|
@ -253,7 +253,7 @@ void menuGeneralSetup(uint8_t event)
|
|||
lcd_putsLeft( y, STR_SPKRPITCH);
|
||||
lcdDrawChar(RADIO_SETUP_2ND_COLUMN, y, '+', attr);
|
||||
lcd_outdezAtt(RADIO_SETUP_2ND_COLUMN+FW, y, g_eeGeneral.speakerPitch*15, attr|LEFT);
|
||||
lcd_putsAtt(lcdLastPos, y, "Hz", attr);
|
||||
lcdDrawText(lcdLastPos, y, "Hz", attr);
|
||||
if (attr) {
|
||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.speakerPitch, 0, 20);
|
||||
}
|
||||
|
@ -269,19 +269,19 @@ void menuGeneralSetup(uint8_t event)
|
|||
case ITEM_SETUP_VARIO_PITCH:
|
||||
lcd_putsLeft(y, STR_PITCH_AT_ZERO);
|
||||
lcd_outdezAtt(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10), attr|LEFT);
|
||||
lcd_putsAtt(lcdLastPos, y, "Hz", attr);
|
||||
lcdDrawText(lcdLastPos, y, "Hz", attr);
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioPitch, -40, 40);
|
||||
break;
|
||||
case ITEM_SETUP_VARIO_RANGE:
|
||||
lcd_putsLeft(y, STR_PITCH_AT_MAX);
|
||||
lcd_outdezAtt(RADIO_SETUP_2ND_COLUMN, y, VARIO_FREQUENCY_ZERO+(g_eeGeneral.varioPitch*10)+VARIO_FREQUENCY_RANGE+(g_eeGeneral.varioRange*10), attr|LEFT);
|
||||
lcd_putsAtt(lcdLastPos, y, "Hz", attr);
|
||||
lcdDrawText(lcdLastPos, y, "Hz", attr);
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRange, -80, 80);
|
||||
break;
|
||||
case ITEM_SETUP_VARIO_REPEAT:
|
||||
lcd_putsLeft(y, STR_REPEAT_AT_ZERO);
|
||||
lcd_outdezAtt(RADIO_SETUP_2ND_COLUMN, y, VARIO_REPEAT_ZERO+(g_eeGeneral.varioRepeat*10), attr|LEFT);
|
||||
lcd_putsAtt(lcdLastPos, y, STR_MS, attr);
|
||||
lcdDrawText(lcdLastPos, y, STR_MS, attr);
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.varioRepeat, -30, 50);
|
||||
break;
|
||||
#endif
|
||||
|
@ -376,7 +376,7 @@ void menuGeneralSetup(uint8_t event)
|
|||
#if defined(REVPLUS)
|
||||
case ITEM_SETUP_BACKLIGHT_COLOR:
|
||||
lcd_putsLeft(y, STR_BLCOLOR);
|
||||
displaySlider(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.backlightColor, 20, attr);
|
||||
drawSlider(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.backlightColor, 20, attr);
|
||||
if (attr) g_eeGeneral.backlightColor = checkIncDec(event, g_eeGeneral.backlightColor, 0, 20, EE_GENERAL | NO_INCDEC_MARKS);
|
||||
break;
|
||||
#endif
|
||||
|
@ -390,7 +390,7 @@ void menuGeneralSetup(uint8_t event)
|
|||
lcd_putc(lcdLastPos, y, 's');
|
||||
}
|
||||
else {
|
||||
lcd_putsiAtt(RADIO_SETUP_2ND_COLUMN, y, STR_MMMINV, 0, attr); // TODO define
|
||||
lcdDrawTextAtIndex(RADIO_SETUP_2ND_COLUMN, y, STR_MMMINV, 0, attr); // TODO define
|
||||
}
|
||||
if (attr) g_eeGeneral.splashMode = -checkIncDecGen(event, -g_eeGeneral.splashMode, -3, 4);
|
||||
break;
|
||||
|
@ -425,7 +425,7 @@ void menuGeneralSetup(uint8_t event)
|
|||
|
||||
case ITEM_SETUP_LANGUAGE:
|
||||
lcd_putsLeft(y, STR_VOICELANG);
|
||||
lcd_putsAtt(RADIO_SETUP_2ND_COLUMN, y, currentLanguagePack->name, attr);
|
||||
lcdDrawText(RADIO_SETUP_2ND_COLUMN, y, currentLanguagePack->name, attr);
|
||||
if (attr) {
|
||||
currentLanguagePackIdx = checkIncDec(event, currentLanguagePackIdx, 0, DIM(languagePacks)-2, EE_GENERAL);
|
||||
if (checkIncDec_Ret) {
|
||||
|
@ -460,7 +460,7 @@ void menuGeneralSetup(uint8_t event)
|
|||
case ITEM_SETUP_SWITCHES_DELAY:
|
||||
lcd_putsLeft(y, STR_SWITCHES_DELAY);
|
||||
lcd_outdezAtt(RADIO_SETUP_2ND_COLUMN, y, 10*SWITCHES_DELAY(), attr|LEFT);
|
||||
lcd_putsAtt(lcdLastPos, y, STR_MS, attr);
|
||||
lcdDrawText(lcdLastPos, y, STR_MS, attr);
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.switchesDelay, -15, 100-15);
|
||||
break;
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ void menuGeneralTrainer(uint8_t event)
|
|||
|
||||
switch(j) {
|
||||
case 0:
|
||||
lcd_putsiAtt(4*FW, y, STR_TRNMODE, td->mode, attr);
|
||||
lcdDrawTextAtIndex(4*FW, y, STR_TRNMODE, td->mode, attr);
|
||||
if (attr&BLINK) CHECK_INCDEC_GENVAR(event, td->mode, 0, 2);
|
||||
break;
|
||||
|
||||
|
@ -80,7 +80,7 @@ void menuGeneralTrainer(uint8_t event)
|
|||
break;
|
||||
|
||||
case 2:
|
||||
lcd_putsiAtt(12*FW, y, STR_TRNCHN, td->srcChn, attr);
|
||||
lcdDrawTextAtIndex(12*FW, y, STR_TRNCHN, td->srcChn, attr);
|
||||
if (attr&BLINK) CHECK_INCDEC_GENVAR(event, td->srcChn, 0, 3);
|
||||
break;
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ void menuGeneralTrainer(uint8_t event)
|
|||
|
||||
attr = (sub==6) ? INVERS : 0;
|
||||
if (attr) s_editMode = 0;
|
||||
lcd_putsAtt(0*FW, MENU_HEADER_HEIGHT+1+6*FH, STR_CAL, attr);
|
||||
lcdDrawText(0*FW, MENU_HEADER_HEIGHT+1+6*FH, STR_CAL, attr);
|
||||
for (int i=0; i<4; i++) {
|
||||
uint8_t x = (i*TRAINER_CALIB_POS+16)*FW/2;
|
||||
#if defined (PPM_UNIT_PERCENT_PREC1)
|
||||
|
|
|
@ -43,7 +43,7 @@ void backupEeprom()
|
|||
FIL file;
|
||||
|
||||
lcdClear();
|
||||
displayProgressBar(STR_WRITING);
|
||||
drawProgressBar(STR_WRITING);
|
||||
|
||||
// reset unexpectedShutdown to prevent warning when user restores EEPROM backup
|
||||
g_eeGeneral.unexpectedShutdown = 0;
|
||||
|
|
|
@ -148,7 +148,7 @@ void editName(coord_t x, coord_t y, char *name, uint8_t size, uint8_t event, uin
|
|||
mode = FIXEDWIDTH;
|
||||
}
|
||||
|
||||
lcd_putsnAtt(x, y, name, size, attr | mode);
|
||||
lcdDrawTextWithLen(x, y, name, size, attr | mode);
|
||||
coord_t backupNextPos = lcdNextPos;
|
||||
|
||||
if (active) {
|
||||
|
@ -157,8 +157,7 @@ void editName(coord_t x, coord_t y, char *name, uint8_t size, uint8_t event, uin
|
|||
int8_t c = name[cur];
|
||||
int8_t v = c;
|
||||
|
||||
if (IS_ROTARY_RIGHT(event) || IS_ROTARY_LEFT(event) || event==EVT_KEY_FIRST(KEY_DOWN) || event==EVT_KEY_FIRST(KEY_UP)
|
||||
|| event==EVT_KEY_REPT(KEY_DOWN) || event==EVT_KEY_REPT(KEY_UP)) {
|
||||
if (event==EVT_KEY_FIRST(KEY_DOWN) || event==EVT_KEY_FIRST(KEY_UP) || event==EVT_KEY_REPT(KEY_DOWN) || event==EVT_KEY_REPT(KEY_UP)) {
|
||||
if (attr == ZCHAR) {
|
||||
v = checkIncDec(event, abs(v), 0, ZCHAR_MAX, 0);
|
||||
if (c <= 0) v = -v;
|
||||
|
|
|
@ -154,7 +154,7 @@ void menuModelCurveOne(uint8_t event)
|
|||
|
||||
uint8_t attr = (m_posVert==1 ? (s_editMode>0 ? INVERS|BLINK : INVERS) : 0);
|
||||
lcd_putsLeft(3*FH+1, STR_TYPE);
|
||||
lcd_putsiAtt(INDENT_WIDTH, 4*FH+1, STR_CURVE_TYPES, crv.type, attr);
|
||||
lcdDrawTextAtIndex(INDENT_WIDTH, 4*FH+1, STR_CURVE_TYPES, crv.type, attr);
|
||||
if (attr) {
|
||||
uint8_t newType = checkIncDecModelZero(event, crv.type, CURVE_TYPE_LAST);
|
||||
if (newType != crv.type) {
|
||||
|
@ -172,7 +172,7 @@ void menuModelCurveOne(uint8_t event)
|
|||
attr = (m_posVert==2 ? (s_editMode>0 ? INVERS|BLINK : INVERS) : 0);
|
||||
lcd_putsLeft(5*FH+1, STR_COUNT);
|
||||
lcd_outdezAtt(INDENT_WIDTH, 6*FH+1, 5+crv.points, LEFT|attr);
|
||||
lcd_putsAtt(lcdLastPos, 6*FH+1, STR_PTS, attr);
|
||||
lcdDrawText(lcdLastPos, 6*FH+1, STR_PTS, attr);
|
||||
if (attr) {
|
||||
int8_t count = checkIncDecModel(event, crv.points, -3, 12); // 2pts - 17pts
|
||||
if (checkIncDec_Ret) {
|
||||
|
@ -260,7 +260,7 @@ void menuModelCurveOne(uint8_t event)
|
|||
|
||||
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, uint8_t event, uint8_t attr)
|
||||
{
|
||||
lcd_putsiAtt(x, y, "\004DiffExpoFuncCstm", curve.type, m_posHorz==0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(x, y, "\004DiffExpoFuncCstm", curve.type, m_posHorz==0 ? attr : 0);
|
||||
if (attr && m_posHorz==0) {
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, curve.type, CURVE_REF_CUSTOM);
|
||||
if (checkIncDec_Ret) curve.value = 0;
|
||||
|
@ -271,7 +271,7 @@ void editCurveRef(coord_t x, coord_t y, CurveRef & curve, uint8_t event, uint8_t
|
|||
curve.value = GVAR_MENU_ITEM(x+5*FW, y, curve.value, -100, 100, m_posHorz==1 ? LEFT|attr : LEFT, 0, event);
|
||||
break;
|
||||
case CURVE_REF_FUNC:
|
||||
lcd_putsiAtt(x+5*FW, y, STR_VCURVEFUNC, curve.value, m_posHorz==1 ? attr : 0);
|
||||
lcdDrawTextAtIndex(x+5*FW, y, STR_VCURVEFUNC, curve.value, m_posHorz==1 ? attr : 0);
|
||||
if (attr && m_posHorz==1) CHECK_INCDEC_MODELVAR_ZERO(event, curve.value, CURVE_BASE-1);
|
||||
break;
|
||||
case CURVE_REF_CUSTOM:
|
||||
|
@ -313,7 +313,7 @@ void menuModelCurvesAll(uint8_t event)
|
|||
editName(4*FW, y, g_model.curveNames[k], sizeof(g_model.curveNames[k]), 0, 0);
|
||||
CurveInfo & crv = g_model.curves[k];
|
||||
lcd_outdezAtt(11*FW, y, 5+crv.points, LEFT);
|
||||
lcd_putsAtt(lcdLastPos, y, STR_PTS, 0);
|
||||
lcdDrawText(lcdLastPos, y, STR_PTS, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -196,7 +196,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
|||
|
||||
case 1:
|
||||
if (CFN_SWITCH(cfn)) {
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_2ND_COLUMN, y, STR_VFSWFUNC, func, attr);
|
||||
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_2ND_COLUMN, y, STR_VFSWFUNC, func, attr);
|
||||
if (active) {
|
||||
func = CFN_FUNC(cfn) = checkIncDec(event, CFN_FUNC(cfn), 0, FUNC_MAX-1, eeFlags, isAssignableFunctionAvailable);
|
||||
if (checkIncDec_Ret) CFN_RESET(cfn);
|
||||
|
@ -254,11 +254,11 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
|||
val_max = FUNC_RESET_PARAM_FIRST_TELEM+lastUsedTelemetryIndex();
|
||||
int param = CFN_PARAM(cfn);
|
||||
if (param < FUNC_RESET_PARAM_FIRST_TELEM) {
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_VFSWRESET, param, attr);
|
||||
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_VFSWRESET, param, attr);
|
||||
}
|
||||
else {
|
||||
TelemetrySensor * sensor = & g_model.telemetrySensors[param-FUNC_RESET_PARAM_FIRST_TELEM];
|
||||
lcd_putsnAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, sensor->label, TELEM_LABEL_LEN, attr|ZCHAR);
|
||||
lcdDrawTextWithLen(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, sensor->label, TELEM_LABEL_LEN, attr|ZCHAR);
|
||||
}
|
||||
if (active) INCDEC_ENABLE_CHECK(functionsContext == &globalFunctionsContext ? isSourceAvailableInGlobalResetSpecialFunction : isSourceAvailableInResetSpecialFunction);
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
|||
#endif
|
||||
else if (func >= FUNC_SET_FAILSAFE && func <= FUNC_BIND) {
|
||||
val_max = NUM_MODULES-1;
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, "\004Int.Ext.", CFN_PARAM(cfn), attr);
|
||||
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, "\004Int.Ext.", CFN_PARAM(cfn), attr);
|
||||
}
|
||||
else if (func == FUNC_SET_TIMER) {
|
||||
val_max = 59*60+59;
|
||||
|
@ -278,7 +278,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
|||
}
|
||||
else if (func == FUNC_PLAY_SOUND) {
|
||||
val_max = AU_FRSKY_LAST-AU_FRSKY_FIRST-1;
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_FUNCSOUNDS, val_displayed, attr);
|
||||
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_FUNCSOUNDS, val_displayed, attr);
|
||||
}
|
||||
#if defined(HAPTIC)
|
||||
else if (func == FUNC_HAPTIC) {
|
||||
|
@ -290,9 +290,9 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
|||
else if (func == FUNC_PLAY_TRACK || func == FUNC_BACKGND_MUSIC || func == FUNC_PLAY_SCRIPT) {
|
||||
coord_t x = MODEL_CUSTOM_FUNC_3RD_COLUMN;
|
||||
if (ZEXIST(cfn->play.name))
|
||||
lcd_putsnAtt(x, y, cfn->play.name, sizeof(cfn->play.name), attr);
|
||||
lcdDrawTextWithLen(x, y, cfn->play.name, sizeof(cfn->play.name), attr);
|
||||
else
|
||||
lcd_putsiAtt(x, y, STR_VCSWFUNC, 0, attr);
|
||||
lcdDrawTextAtIndex(x, y, STR_VCSWFUNC, 0, attr);
|
||||
if (active && event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
s_editMode = 0;
|
||||
char directory[256];
|
||||
|
@ -336,12 +336,12 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
|||
lcd_putc(lcdLastPos, y, 's');
|
||||
}
|
||||
else {
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_MMMINV, 0, attr);
|
||||
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_MMMINV, 0, attr);
|
||||
}
|
||||
}
|
||||
#if defined(REVPLUS)
|
||||
else if (func == FUNC_BACKLIGHT) {
|
||||
displaySlider(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, CFN_PARAM(cfn), 100, attr);
|
||||
drawSlider(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, CFN_PARAM(cfn), 100, attr);
|
||||
if (active) INCDEC_SET_FLAG(eeFlags | NO_INCDEC_MARKS);
|
||||
val_min = 0;
|
||||
val_max = 100;
|
||||
|
@ -371,13 +371,13 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
|||
#if 0 // TODO 2.2.X
|
||||
val_min = -100; val_max = +100;
|
||||
if (val_displayed < 0)
|
||||
lcd_putsAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, "-=", attr);
|
||||
lcdDrawText(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, "-=", attr);
|
||||
else
|
||||
lcd_putsAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, "+=", attr);
|
||||
lcdDrawText(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, "+=", attr);
|
||||
lcd_outdezAtt(lcdNextPos, y, abs(val_displayed), attr|LEFT);
|
||||
#endif
|
||||
val_max = 1;
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, PSTR("\003-=1+=1"), val_displayed, attr);
|
||||
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, PSTR("\003-=1+=1"), val_displayed, attr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -412,11 +412,11 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
|||
}
|
||||
else if (HAS_REPEAT_PARAM(func)) {
|
||||
if (CFN_PLAY_REPEAT(cfn) == 0) {
|
||||
lcd_putsAtt(MODEL_CUSTOM_FUNC_4TH_COLUMN+2, y, "1x", attr);
|
||||
lcdDrawText(MODEL_CUSTOM_FUNC_4TH_COLUMN+2, y, "1x", attr);
|
||||
}
|
||||
else if (CFN_PLAY_REPEAT(cfn) == CFN_PLAY_REPEAT_NOSTART) {
|
||||
lcdDrawChar(MODEL_CUSTOM_FUNC_4TH_COLUMN-1, y, '!', attr);
|
||||
lcd_putsAtt(MODEL_CUSTOM_FUNC_4TH_COLUMN+2, y, "1x", attr);
|
||||
lcdDrawText(MODEL_CUSTOM_FUNC_4TH_COLUMN+2, y, "1x", attr);
|
||||
}
|
||||
else {
|
||||
lcd_outdezAtt(MODEL_CUSTOM_FUNC_4TH_COLUMN+2+FW, y, CFN_PLAY_REPEAT(cfn)*CFN_PLAY_REPEAT_MUL, attr);
|
||||
|
|
|
@ -83,9 +83,9 @@ void menuModelCustomScriptOne(uint8_t event)
|
|||
if (i == ITEM_MODEL_CUSTOMSCRIPT_FILE) {
|
||||
lcd_putsLeft(y, STR_SCRIPT);
|
||||
if (ZEXIST(sd.file))
|
||||
lcd_putsnAtt(SCRIPT_ONE_2ND_COLUMN_POS, y, sd.file, sizeof(sd.file), attr);
|
||||
lcdDrawTextWithLen(SCRIPT_ONE_2ND_COLUMN_POS, y, sd.file, sizeof(sd.file), attr);
|
||||
else
|
||||
lcd_putsiAtt(SCRIPT_ONE_2ND_COLUMN_POS, y, STR_VCSWFUNC, 0, attr);
|
||||
lcdDrawTextAtIndex(SCRIPT_ONE_2ND_COLUMN_POS, y, STR_VCSWFUNC, 0, attr);
|
||||
if (attr && event==EVT_KEY_BREAK(KEY_ENTER) && !READ_ONLY()) {
|
||||
s_editMode = 0;
|
||||
if (sdListFiles(SCRIPTS_MIXES_PATH, SCRIPTS_EXT, sizeof(sd.file), sd.file, LIST_NONE_SD_FILE)) {
|
||||
|
@ -106,7 +106,7 @@ void menuModelCustomScriptOne(uint8_t event)
|
|||
}
|
||||
else if (i <= ITEM_MODEL_CUSTOMSCRIPT_PARAMS_LABEL+scriptInputsOutputs[s_currIdx].inputsCount) {
|
||||
int inputIdx = i-ITEM_MODEL_CUSTOMSCRIPT_PARAMS_LABEL-1;
|
||||
lcd_putsnAtt(INDENT_WIDTH, y, scriptInputsOutputs[s_currIdx].inputs[inputIdx].name, 10, 0);
|
||||
lcdDrawTextWithLen(INDENT_WIDTH, y, scriptInputsOutputs[s_currIdx].inputs[inputIdx].name, 10, 0);
|
||||
if (scriptInputsOutputs[s_currIdx].inputs[inputIdx].type == 0) {
|
||||
lcd_outdezAtt(SCRIPT_ONE_2ND_COLUMN_POS, y, g_model.scriptsData[s_currIdx].inputs[inputIdx]+scriptInputsOutputs[s_currIdx].inputs[inputIdx].def, attr|LEFT);
|
||||
if (attr) {
|
||||
|
@ -159,7 +159,7 @@ void menuModelCustomScripts(uint8_t event)
|
|||
|
||||
// LUA script
|
||||
if (ZEXIST(sd.file)) {
|
||||
lcd_putsnAtt(5*FW, y, sd.file, sizeof(sd.file), 0);
|
||||
lcdDrawTextWithLen(5*FW, y, sd.file, sizeof(sd.file), 0);
|
||||
switch (scriptInternalData[scriptIndex].state) {
|
||||
case SCRIPT_SYNTAX_ERROR:
|
||||
lcd_puts(30*FW+2, y, "(error)");
|
||||
|
@ -175,10 +175,10 @@ void menuModelCustomScripts(uint8_t event)
|
|||
scriptIndex++;
|
||||
}
|
||||
else {
|
||||
lcd_putsiAtt(5*FW, y, STR_VCSWFUNC, 0, 0);
|
||||
lcdDrawTextAtIndex(5*FW, y, STR_VCSWFUNC, 0, 0);
|
||||
}
|
||||
|
||||
// Script name
|
||||
lcd_putsnAtt(16*FW, y, sd.name, sizeof(sd.name), ZCHAR);
|
||||
lcdDrawTextWithLen(16*FW, y, sd.name, sizeof(sd.name), ZCHAR);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -389,7 +389,7 @@ void menuModelExpoOne(uint8_t event)
|
|||
uint8_t not_stick = (ed->srcRaw > MIXSRC_Ail);
|
||||
int8_t carryTrim = -ed->carryTrim;
|
||||
lcd_putsLeft(y, STR_TRIM);
|
||||
lcd_putsiAtt(EXPO_ONE_2ND_COLUMN, y, STR_VMIXTRIMS, (not_stick && carryTrim == 0) ? 0 : carryTrim+1, m_posHorz==0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(EXPO_ONE_2ND_COLUMN, y, STR_VMIXTRIMS, (not_stick && carryTrim == 0) ? 0 : carryTrim+1, m_posHorz==0 ? attr : 0);
|
||||
if (attr) ed->carryTrim = -checkIncDecModel(event, carryTrim, not_stick ? TRIM_ON : -TRIM_OFF, -TRIM_AIL);
|
||||
break;
|
||||
}
|
||||
|
@ -576,7 +576,7 @@ void menuModelMixOne(uint8_t event)
|
|||
if (md2->mixWarn)
|
||||
lcd_outdezAtt(COLUMN_X+MIXES_2ND_COLUMN, y, md2->mixWarn, attr|LEFT);
|
||||
else
|
||||
lcd_putsAtt(COLUMN_X+MIXES_2ND_COLUMN, y, STR_OFF, attr);
|
||||
lcdDrawText(COLUMN_X+MIXES_2ND_COLUMN, y, STR_OFF, attr);
|
||||
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, md2->mixWarn, 3);
|
||||
break;
|
||||
case MIX_FIELD_MLTPX:
|
||||
|
@ -652,7 +652,7 @@ void displayHeaderChannelName(uint8_t ch)
|
|||
{
|
||||
uint8_t len = zlen(g_model.limitData[ch].name, sizeof(g_model.limitData[ch].name));
|
||||
if (len) {
|
||||
lcd_putsnAtt(80, 1, g_model.limitData[ch].name, len, ZCHAR|SMLSIZE);
|
||||
lcdDrawTextWithLen(80, 1, g_model.limitData[ch].name, len, ZCHAR|SMLSIZE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -668,7 +668,7 @@ void displayMixInfos(coord_t y, MixData *md)
|
|||
void displayMixLine(coord_t y, MixData *md)
|
||||
{
|
||||
if (md->name[0])
|
||||
lcd_putsnAtt(EXPO_LINE_NAME_POS, y, md->name, sizeof(md->name), ZCHAR);
|
||||
lcdDrawTextWithLen(EXPO_LINE_NAME_POS, y, md->name, sizeof(md->name), ZCHAR);
|
||||
if (!md->flightModes || ((md->curve.value || md->swtch) && ((get_tmr10ms() / 200) & 1)))
|
||||
displayMixInfos(y, md);
|
||||
else
|
||||
|
@ -695,7 +695,7 @@ void displayExpoLine(coord_t y, ExpoData *ed)
|
|||
displayFlightModes(EXPO_LINE_FM_POS, y, ed->flightModes);
|
||||
|
||||
if (ed->name[0]) {
|
||||
lcd_putsnAtt(EXPO_LINE_NAME_POS, y, ed->name, sizeof(ed->name), ZCHAR);
|
||||
lcdDrawTextWithLen(EXPO_LINE_NAME_POS, y, ed->name, sizeof(ed->name), ZCHAR);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -799,29 +799,29 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
|||
killEvents(event);
|
||||
}
|
||||
break;
|
||||
case EVT_KEY_FIRST(KEY_MOVE_UP):
|
||||
case EVT_KEY_REPT(KEY_MOVE_UP):
|
||||
case EVT_KEY_FIRST(KEY_MOVE_DOWN):
|
||||
case EVT_KEY_REPT(KEY_MOVE_DOWN):
|
||||
case EVT_KEY_FIRST(KEY_UP):
|
||||
case EVT_KEY_REPT(KEY_UP):
|
||||
case EVT_KEY_FIRST(KEY_DOWN):
|
||||
case EVT_KEY_REPT(KEY_DOWN):
|
||||
if (s_copyMode) {
|
||||
uint8_t key = (event & 0x1f);
|
||||
uint8_t next_ofs = (key==KEY_MOVE_UP ? s_copyTgtOfs - 1 : s_copyTgtOfs + 1);
|
||||
uint8_t next_ofs = (key==KEY_UP ? s_copyTgtOfs - 1 : s_copyTgtOfs + 1);
|
||||
|
||||
if (s_copyTgtOfs==0 && s_copyMode==COPY_MODE) {
|
||||
// insert a mix on the same channel (just above / just below)
|
||||
if (reachExpoMixCountLimit(expo)) break;
|
||||
copyExpoMix(expo, s_currIdx);
|
||||
if (key==KEY_MOVE_DOWN) s_currIdx++;
|
||||
if (key==KEY_DOWN) s_currIdx++;
|
||||
else if (sub-s_pgOfs >= 6) s_pgOfs++;
|
||||
}
|
||||
else if (next_ofs==0 && s_copyMode==COPY_MODE) {
|
||||
// delete the mix
|
||||
deleteExpoMix(expo, s_currIdx);
|
||||
if (key==KEY_MOVE_UP) s_currIdx--;
|
||||
if (key==KEY_UP) s_currIdx--;
|
||||
}
|
||||
else {
|
||||
// only swap the mix with its neighbor
|
||||
if (!swapExpoMix(expo, s_currIdx, key==KEY_MOVE_UP)) break;
|
||||
if (!swapExpoMix(expo, s_currIdx, key==KEY_UP)) break;
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
|
||||
|
@ -908,7 +908,7 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
|||
}
|
||||
}
|
||||
else {
|
||||
if (mixCnt > 0) lcd_putsiAtt(FW, y, STR_VMLTPX2, md->mltpx, 0);
|
||||
if (mixCnt > 0) lcdDrawTextAtIndex(FW, y, STR_VMLTPX2, md->mltpx, 0);
|
||||
|
||||
putsMixerSource(MIX_LINE_SRC_POS, y, md->srcRaw, 0);
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ void menuModelLimits(uint8_t event)
|
|||
if (k==NUM_CHNOUT) {
|
||||
// last line available - add the "copy trim menu" line
|
||||
uint8_t attr = (sub==NUM_CHNOUT) ? INVERS : 0;
|
||||
lcd_putsAtt(CENTER_OFS, y, STR_TRIMS2OFFSETS, s_noHi ? 0 : attr);
|
||||
lcdDrawText(CENTER_OFS, y, STR_TRIMS2OFFSETS, s_noHi ? 0 : attr);
|
||||
if (attr) {
|
||||
s_editMode = 0;
|
||||
if (event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
|
@ -231,7 +231,7 @@ void menuModelLimits(uint8_t event)
|
|||
#if defined(PPM_CENTER_ADJUSTABLE)
|
||||
lcdDrawChar(LIMITS_REVERT_POS, y, revert ? 127 : 126, attr);
|
||||
#else
|
||||
lcd_putsiAtt(LIMITS_REVERT_POS, y, STR_MMMINV, revert, attr);
|
||||
lcdDrawTextAtIndex(LIMITS_REVERT_POS, y, STR_MMMINV, revert, attr);
|
||||
#endif
|
||||
if (active) {
|
||||
uint8_t revert_new = checkIncDecModel(event, revert, 0, 1);
|
||||
|
|
|
@ -65,9 +65,9 @@ void putsEdgeDelayParam(coord_t x, coord_t y, LogicalSwitchData *cs, uint8_t lat
|
|||
lcd_outdezAtt(x, y, lswTimerValue(cs->v2), LEFT|PREC1|lattr);
|
||||
lcd_putc(lcdLastPos, y, ':');
|
||||
if (cs->v3 < 0)
|
||||
lcd_putsAtt(lcdLastPos+3, y, "<<", rattr);
|
||||
lcdDrawText(lcdLastPos+3, y, "<<", rattr);
|
||||
else if (cs->v3 == 0)
|
||||
lcd_putsAtt(lcdLastPos+3, y, "--", rattr);
|
||||
lcdDrawText(lcdLastPos+3, y, "--", rattr);
|
||||
else
|
||||
lcd_outdezAtt(lcdLastPos+3, y, lswTimerValue(cs->v2+cs->v3), LEFT|PREC1|rattr);
|
||||
lcd_putc(lcdLastPos, y, ']');
|
||||
|
@ -131,7 +131,7 @@ void menuModelLogicalSwitches(uint8_t event)
|
|||
putsSwitches(0, y, sw, (getSwitch(sw) ? BOLD : 0) | ((sub==k && CURSOR_ON_LINE()) ? INVERS : 0));
|
||||
|
||||
// CSW func
|
||||
lcd_putsiAtt(CSW_1ST_COLUMN, y, STR_VCSWFUNC, cs->func, horz==0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(CSW_1ST_COLUMN, y, STR_VCSWFUNC, cs->func, horz==0 ? attr : 0);
|
||||
|
||||
// CSW params
|
||||
unsigned int cstate = lswFamily(cs->func);
|
||||
|
@ -205,7 +205,7 @@ void menuModelLogicalSwitches(uint8_t event)
|
|||
if (cs->duration > 0)
|
||||
lcd_outdezAtt(CSW_5TH_COLUMN, y, cs->duration, (horz==LS_FIELD_DURATION ? attr : 0)|PREC1|LEFT);
|
||||
else
|
||||
lcd_putsiAtt(CSW_5TH_COLUMN, y, STR_MMMINV, 0, horz==LS_FIELD_DURATION ? attr : 0);
|
||||
lcdDrawTextAtIndex(CSW_5TH_COLUMN, y, STR_MMMINV, 0, horz==LS_FIELD_DURATION ? attr : 0);
|
||||
|
||||
// CSW delay
|
||||
if (cstate == LS_FAMILY_EDGE) {
|
||||
|
@ -218,7 +218,7 @@ void menuModelLogicalSwitches(uint8_t event)
|
|||
lcd_outdezAtt(CSW_6TH_COLUMN, y, cs->delay, (horz==LS_FIELD_DELAY ? attr : 0)|PREC1|LEFT);
|
||||
}
|
||||
else {
|
||||
lcd_putsiAtt(CSW_6TH_COLUMN, y, STR_MMMINV, 0, horz==LS_FIELD_DELAY ? attr : 0);
|
||||
lcdDrawTextAtIndex(CSW_6TH_COLUMN, y, STR_MMMINV, 0, horz==LS_FIELD_DELAY ? attr : 0);
|
||||
}
|
||||
|
||||
if (attr && horz == LS_FIELD_V3 && cstate != LS_FAMILY_EDGE) {
|
||||
|
|
|
@ -89,7 +89,7 @@ void menuModelSelect(uint8_t event)
|
|||
event = EVT_ENTRY_UP;
|
||||
}
|
||||
|
||||
uint8_t _event_ = (IS_ROTARY_BREAK(event) || IS_ROTARY_LONG(event) ? 0 : event);
|
||||
uint8_t _event_ = ((event==EVT_KEY_BREAK(KEY_ENTER) || event==EVT_KEY_LONG(KEY_ENTER)) ? 0 : event);
|
||||
|
||||
if ((s_copyMode && EVT_KEY_MASK(event) == KEY_EXIT) || event == EVT_KEY_BREAK(KEY_EXIT)) {
|
||||
_event_ -= KEY_EXIT;
|
||||
|
@ -209,10 +209,10 @@ void menuModelSelect(uint8_t event)
|
|||
killEvents(event);
|
||||
break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_MOVE_UP):
|
||||
case EVT_KEY_REPT(KEY_MOVE_UP):
|
||||
case EVT_KEY_FIRST(KEY_MOVE_DOWN):
|
||||
case EVT_KEY_REPT(KEY_MOVE_DOWN):
|
||||
case EVT_KEY_FIRST(KEY_UP):
|
||||
case EVT_KEY_REPT(KEY_UP):
|
||||
case EVT_KEY_FIRST(KEY_DOWN):
|
||||
case EVT_KEY_REPT(KEY_DOWN):
|
||||
if (s_copyMode) {
|
||||
int8_t next_ofs = s_copyTgtOfs + oldSub - m_posVert;
|
||||
if (next_ofs == MAX_MODELS || next_ofs == -MAX_MODELS)
|
||||
|
@ -221,7 +221,7 @@ void menuModelSelect(uint8_t event)
|
|||
if (s_copySrcRow < 0 && s_copyMode==COPY_MODE) {
|
||||
s_copySrcRow = oldSub;
|
||||
// find a hole (in the first empty slot above / below)
|
||||
sub = eeFindEmptyModel(s_copySrcRow, IS_ROTARY_DOWN(event) || event==EVT_KEY_FIRST(KEY_MOVE_DOWN));
|
||||
sub = eeFindEmptyModel(s_copySrcRow, event==EVT_KEY_FIRST(KEY_DOWN) || event==EVT_KEY_REPT(KEY_DOWN));
|
||||
if (sub < 0) {
|
||||
// no free room for duplicating the model
|
||||
AUDIO_ERROR();
|
||||
|
|
|
@ -299,9 +299,9 @@ void menuModelSetup(uint8_t event)
|
|||
case ITEM_MODEL_BITMAP:
|
||||
lcd_putsLeft(y, STR_BITMAP);
|
||||
if (ZEXIST(g_model.header.bitmap))
|
||||
lcd_putsnAtt(MODEL_SETUP_2ND_COLUMN, y, g_model.header.bitmap, sizeof(g_model.header.bitmap), attr);
|
||||
lcdDrawTextWithLen(MODEL_SETUP_2ND_COLUMN, y, g_model.header.bitmap, sizeof(g_model.header.bitmap), attr);
|
||||
else
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, STR_VCSWFUNC, 0, attr);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VCSWFUNC, 0, attr);
|
||||
if (attr && event==EVT_KEY_BREAK(KEY_ENTER) && READ_ONLY_UNLOCKED()) {
|
||||
s_editMode = 0;
|
||||
if (sdListFiles(BITMAPS_PATH, BITMAPS_EXT, sizeof(g_model.header.bitmap), g_model.header.bitmap, LIST_NONE_SD_FILE)) {
|
||||
|
@ -394,7 +394,7 @@ void menuModelSetup(uint8_t event)
|
|||
|
||||
case ITEM_MODEL_EXTENDED_TRIMS:
|
||||
ON_OFF_MENU_ITEM(g_model.extendedTrims, MODEL_SETUP_2ND_COLUMN, y, STR_ETRIMS, m_posHorz<=0 ? attr : 0, event==EVT_KEY_BREAK(KEY_ENTER) ? event : 0);
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+3*FW, y, STR_RESET_BTN, m_posHorz>0 && !s_noHi ? attr : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+3*FW, y, STR_RESET_BTN, m_posHorz>0 && !s_noHi ? attr : 0);
|
||||
if (attr && m_posHorz>0) {
|
||||
s_editMode = 0;
|
||||
if (event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
|
@ -484,7 +484,6 @@ void menuModelSetup(uint8_t event)
|
|||
s_editMode = 0;
|
||||
if (!READ_ONLY()) {
|
||||
switch (event) {
|
||||
CASE_EVT_ROTARY_BREAK
|
||||
case EVT_KEY_BREAK(KEY_ENTER):
|
||||
break;
|
||||
|
||||
|
@ -542,7 +541,7 @@ void menuModelSetup(uint8_t event)
|
|||
#endif
|
||||
|
||||
lcd_putsLeft(y, STR_POTWARNING);
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, PSTR("\004""OFF\0""Man\0""Auto"), g_model.potsWarnMode, (m_posHorz == 0) ? attr : 0);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, PSTR("\004""OFF\0""Man\0""Auto"), g_model.potsWarnMode, (m_posHorz == 0) ? attr : 0);
|
||||
if (attr && (m_posHorz == 0)) {
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.potsWarnMode, POTS_WARN_OFF, POTS_WARN_AUTO);
|
||||
storageDirty(EE_MODEL);
|
||||
|
@ -586,7 +585,7 @@ void menuModelSetup(uint8_t event)
|
|||
}
|
||||
|
||||
// TODO add a new function
|
||||
lcd_putsnAtt(x, y, STR_VSRCRAW+2+STR_VSRCRAW[0]*(NUM_STICKS+1+i), STR_VSRCRAW[0]-1, flags & ~(BSS|ZCHAR));
|
||||
lcdDrawTextWithLen(x, y, STR_VSRCRAW+2+STR_VSRCRAW[0]*(NUM_STICKS+1+i), STR_VSRCRAW[0]-1, flags & ~(BSS|ZCHAR));
|
||||
x = lcdNextPos+3;
|
||||
}
|
||||
}
|
||||
|
@ -609,7 +608,7 @@ void menuModelSetup(uint8_t event)
|
|||
if (attr && m_posHorz == i) REPEAT_LAST_CURSOR_MOVE();
|
||||
continue;
|
||||
}
|
||||
lcd_putsiAtt(x, y, STR_RETA123, i, ((m_posHorz==i) && attr) ? BLINK|INVERS : (((g_model.beepANACenter & ((BeepANACenter)1<<i)) || (attr && CURSOR_ON_LINE())) ? INVERS : 0 ) );
|
||||
lcdDrawTextAtIndex(x, y, STR_RETA123, i, ((m_posHorz==i) && attr) ? BLINK|INVERS : (((g_model.beepANACenter & ((BeepANACenter)1<<i)) || (attr && CURSOR_ON_LINE())) ? INVERS : 0 ) );
|
||||
x += FW;
|
||||
}
|
||||
if (attr && CURSOR_ON_CELL) {
|
||||
|
@ -636,9 +635,9 @@ void menuModelSetup(uint8_t event)
|
|||
#if defined(TARANIS_INTERNAL_PPM)
|
||||
case ITEM_MODEL_INTERNAL_MODULE_MODE:
|
||||
lcd_putsLeft(y, STR_MODE);
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, STR_TARANIS_PROTOCOLS, g_model.moduleData[INTERNAL_MODULE].type, m_posHorz==0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_TARANIS_PROTOCOLS, g_model.moduleData[INTERNAL_MODULE].type, m_posHorz==0 ? attr : 0);
|
||||
if (IS_MODULE_XJT(INTERNAL_MODULE))
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN+5*FW, y, STR_XJT_PROTOCOLS, 1+g_model.moduleData[INTERNAL_MODULE].rfProtocol, m_posHorz==1 ? attr : 0);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN+5*FW, y, STR_XJT_PROTOCOLS, 1+g_model.moduleData[INTERNAL_MODULE].rfProtocol, m_posHorz==1 ? attr : 0);
|
||||
if (attr && s_editMode>0) {
|
||||
switch (m_posHorz) {
|
||||
case 0:
|
||||
|
@ -664,7 +663,7 @@ void menuModelSetup(uint8_t event)
|
|||
#else
|
||||
case ITEM_MODEL_INTERNAL_MODULE_MODE:
|
||||
lcd_putsLeft(y, STR_MODE);
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, STR_XJT_PROTOCOLS, 1+g_model.moduleData[0].rfProtocol, attr);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_XJT_PROTOCOLS, 1+g_model.moduleData[0].rfProtocol, attr);
|
||||
if (attr) {
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.moduleData[0].rfProtocol, RF_PROTO_OFF, RF_PROTO_LAST);
|
||||
if (checkIncDec_Ret) {
|
||||
|
@ -684,11 +683,11 @@ void menuModelSetup(uint8_t event)
|
|||
|
||||
case ITEM_MODEL_EXTERNAL_MODULE_MODE:
|
||||
lcd_putsLeft(y, STR_MODE);
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, STR_TARANIS_PROTOCOLS, g_model.moduleData[EXTERNAL_MODULE].type, m_posHorz==0 ? attr : 0);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_TARANIS_PROTOCOLS, g_model.moduleData[EXTERNAL_MODULE].type, m_posHorz==0 ? attr : 0);
|
||||
if (IS_MODULE_XJT(EXTERNAL_MODULE))
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN+5*FW, y, STR_XJT_PROTOCOLS, 1+g_model.moduleData[EXTERNAL_MODULE].rfProtocol, m_posHorz==1 ? attr : 0);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN+5*FW, y, STR_XJT_PROTOCOLS, 1+g_model.moduleData[EXTERNAL_MODULE].rfProtocol, m_posHorz==1 ? attr : 0);
|
||||
else if (IS_MODULE_DSM2(EXTERNAL_MODULE))
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN+5*FW, y, STR_DSM_PROTOCOLS, g_model.moduleData[EXTERNAL_MODULE].rfProtocol, m_posHorz==1 ? attr : 0);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN+5*FW, y, STR_DSM_PROTOCOLS, g_model.moduleData[EXTERNAL_MODULE].rfProtocol, m_posHorz==1 ? attr : 0);
|
||||
if (attr && s_editMode>0) {
|
||||
switch (m_posHorz) {
|
||||
case 0:
|
||||
|
@ -727,7 +726,7 @@ void menuModelSetup(uint8_t event)
|
|||
ModuleData & moduleData = g_model.moduleData[moduleIdx];
|
||||
lcd_putsLeft(y, STR_CHANNELRANGE);
|
||||
if ((int8_t)PORT_CHANNELS_ROWS(moduleIdx) >= 0) {
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN, y, STR_CH, m_posHorz==0 ? attr : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, STR_CH, m_posHorz==0 ? attr : 0);
|
||||
lcd_outdezAtt(lcdLastPos, y, moduleData.channelsStart+1, LEFT | (m_posHorz==0 ? attr : 0));
|
||||
lcd_putc(lcdLastPos, y, '-');
|
||||
lcd_outdezAtt(lcdLastPos + FW+1, y, moduleData.channelsStart+NUM_CHANNELS(moduleIdx), LEFT | (m_posHorz==1 ? attr : 0));
|
||||
|
@ -807,8 +806,8 @@ void menuModelSetup(uint8_t event)
|
|||
checkModelIdUnique(g_eeGeneral.currModel, moduleIdx);
|
||||
}
|
||||
}
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+xOffsetBind, y, STR_MODULE_BIND, l_posHorz==1 ? attr : 0);
|
||||
lcd_putsAtt(MODEL_SETUP_2ND_COLUMN+MODEL_SETUP_RANGE_OFS+xOffsetBind, y, STR_MODULE_RANGE, l_posHorz==2 ? attr : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+xOffsetBind, y, STR_MODULE_BIND, l_posHorz==1 ? attr : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+MODEL_SETUP_RANGE_OFS+xOffsetBind, y, STR_MODULE_RANGE, l_posHorz==2 ? attr : 0);
|
||||
uint8_t newFlag = 0;
|
||||
if (attr && l_posHorz>0 && s_editMode>0) {
|
||||
if (l_posHorz == 1)
|
||||
|
@ -830,8 +829,8 @@ void menuModelSetup(uint8_t event)
|
|||
ModuleData & moduleData = g_model.moduleData[moduleIdx];
|
||||
lcd_putsLeft(y, TR_FAILSAFE);
|
||||
if (IS_MODULE_XJT(moduleIdx)) {
|
||||
lcd_putsiAtt(MODEL_SETUP_2ND_COLUMN, y, STR_VFAILSAFE, moduleData.failsafeMode, m_posHorz==0 ? attr : 0);
|
||||
if (moduleData.failsafeMode == FAILSAFE_CUSTOM) lcd_putsAtt(MODEL_SETUP_2ND_COLUMN + MODEL_SETUP_SET_FAILSAFE_OFS, y, STR_SET, m_posHorz==1 ? attr : 0);
|
||||
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_VFAILSAFE, moduleData.failsafeMode, m_posHorz==0 ? attr : 0);
|
||||
if (moduleData.failsafeMode == FAILSAFE_CUSTOM) lcdDrawText(MODEL_SETUP_2ND_COLUMN + MODEL_SETUP_SET_FAILSAFE_OFS, y, STR_SET, m_posHorz==1 ? attr : 0);
|
||||
if (attr) {
|
||||
if (moduleData.failsafeMode != FAILSAFE_CUSTOM) {
|
||||
m_posHorz = 0;
|
||||
|
@ -937,7 +936,7 @@ void menuModelFailsafe(uint8_t event)
|
|||
}
|
||||
|
||||
if (lenLabel > 0)
|
||||
lcd_putsnAtt(x+1-ofs, y, g_model.limitData[ch].name, sizeof(g_model.limitData[ch].name), ZCHAR | SMLSIZE);
|
||||
lcdDrawTextWithLen(x+1-ofs, y, g_model.limitData[ch].name, sizeof(g_model.limitData[ch].name), ZCHAR | SMLSIZE);
|
||||
else
|
||||
putsChn(x+1-ofs, y, ch+1, SMLSIZE);
|
||||
|
||||
|
@ -963,11 +962,11 @@ void menuModelFailsafe(uint8_t event)
|
|||
#endif
|
||||
|
||||
if (failsafeValue == FAILSAFE_CHANNEL_HOLD) {
|
||||
lcd_putsAtt(x+COL_W-4-wbar-ofs-16, y, "HOLD", flags);
|
||||
lcdDrawText(x+COL_W-4-wbar-ofs-16, y, "HOLD", flags);
|
||||
failsafeValue = 0;
|
||||
}
|
||||
else if (failsafeValue == FAILSAFE_CHANNEL_NOPULSE) {
|
||||
lcd_putsAtt(x+COL_W-4-wbar-ofs-16, y, "NONE", flags);
|
||||
lcdDrawText(x+COL_W-4-wbar-ofs-16, y, "NONE", flags);
|
||||
failsafeValue = 0;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -302,7 +302,7 @@ void menuModelSensor(uint8_t event)
|
|||
case SENSOR_FIELD_UNIT:
|
||||
lcd_putsLeft(y, STR_UNIT);
|
||||
// TODO flash saving with selectMenuItem where I copied those 2 lines?
|
||||
lcd_putsiAtt(SENSOR_2ND_COLUMN, y, STR_VTELEMUNIT, sensor->unit, attr);
|
||||
lcdDrawTextAtIndex(SENSOR_2ND_COLUMN, y, STR_VTELEMUNIT, sensor->unit, attr);
|
||||
if (attr) {
|
||||
CHECK_INCDEC_MODELVAR_ZERO(event, sensor->unit, UNIT_MAX);
|
||||
if (checkIncDec_Ret) {
|
||||
|
@ -517,7 +517,7 @@ void menuModelTelemetry(uint8_t event)
|
|||
}
|
||||
}
|
||||
|
||||
MENU(STR_MENUTELEMETRY, menuTabModel, e_Telemetry, ITEM_TELEMETRY_MAX, { TELEMETRY_TYPE_ROWS RSSI_ROWS SENSORS_ROWS VARIO_ROWS LABEL(TopBar), 0, 0, TELEMETRY_SCREEN_ROWS(0), TELEMETRY_SCREEN_ROWS(1), CASE_CPUARM(TELEMETRY_SCREEN_ROWS(2)) CASE_CPUARM(TELEMETRY_SCREEN_ROWS(3)) });
|
||||
MENU(STR_MENUTELEMETRY, menuTabModel, e_Telemetry, ITEM_TELEMETRY_MAX, { TELEMETRY_TYPE_ROWS RSSI_ROWS SENSORS_ROWS VARIO_ROWS LABEL(TopBar), 0, 0, TELEMETRY_SCREEN_ROWS(0), TELEMETRY_SCREEN_ROWS(1), TELEMETRY_SCREEN_ROWS(2), TELEMETRY_SCREEN_ROWS(3) });
|
||||
|
||||
int sub = m_posVert;
|
||||
|
||||
|
@ -536,7 +536,7 @@ void menuModelTelemetry(uint8_t event)
|
|||
int index = k-ITEM_TELEMETRY_SENSOR1;
|
||||
lcd_outdezAtt(INDENT_WIDTH, y, index+1, LEFT|attr);
|
||||
lcdDrawChar(lcdLastPos, y, ':', attr);
|
||||
lcd_putsnAtt(3*FW, y, g_model.telemetrySensors[index].label, TELEM_LABEL_LEN, ZCHAR);
|
||||
lcdDrawTextWithLen(3*FW, y, g_model.telemetrySensors[index].label, TELEM_LABEL_LEN, ZCHAR);
|
||||
if (telemetryItems[index].isFresh()) {
|
||||
lcd_putc(10*FW, y, '*');
|
||||
}
|
||||
|
@ -549,7 +549,7 @@ void menuModelTelemetry(uint8_t event)
|
|||
if (isOld) lcd_putc(lcdLastPos, y, ']');
|
||||
}
|
||||
else {
|
||||
lcd_putsAtt(TELEM_COL2, y, "---", 0); // TODO shortcut
|
||||
lcdDrawText(TELEM_COL2, y, "---", 0); // TODO shortcut
|
||||
}
|
||||
TelemetrySensor * sensor = & g_model.telemetrySensors[index];
|
||||
if (sensor->type == TELEM_TYPE_CUSTOM && !g_model.ignoreSensorIds) {
|
||||
|
@ -579,14 +579,14 @@ void menuModelTelemetry(uint8_t event)
|
|||
|
||||
case ITEM_TELEMETRY_SENSORS_LABEL:
|
||||
lcd_putsLeft(y, STR_TELEMETRY_SENSORS);
|
||||
lcd_putsAtt(TELEM_COL2, y, STR_VALUE, 0);
|
||||
lcdDrawText(TELEM_COL2, y, STR_VALUE, 0);
|
||||
if (!g_model.ignoreSensorIds) {
|
||||
lcd_putsAtt(TELEM_COL3, y, STR_ID, 0);
|
||||
lcdDrawText(TELEM_COL3, y, STR_ID, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case ITEM_TELEMETRY_DISCOVER_SENSORS:
|
||||
lcd_putsAtt(0, y, allowNewSensors ? STR_STOP_DISCOVER_SENSORS : STR_DISCOVER_SENSORS, attr);
|
||||
lcdDrawText(0, y, allowNewSensors ? STR_STOP_DISCOVER_SENSORS : STR_DISCOVER_SENSORS, attr);
|
||||
if (attr && event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
s_editMode = 0;
|
||||
allowNewSensors = !allowNewSensors;
|
||||
|
@ -594,7 +594,7 @@ void menuModelTelemetry(uint8_t event)
|
|||
break;
|
||||
|
||||
case ITEM_TELEMETRY_NEW_SENSOR:
|
||||
lcd_putsAtt(0, y, STR_TELEMETRY_NEWSENSOR, attr);
|
||||
lcdDrawText(0, y, STR_TELEMETRY_NEWSENSOR, attr);
|
||||
if (attr && event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
s_editMode = 0;
|
||||
int res = availableTelemetryIndex();
|
||||
|
@ -609,7 +609,7 @@ void menuModelTelemetry(uint8_t event)
|
|||
break;
|
||||
|
||||
case ITEM_TELEMETRY_DELETE_ALL_SENSORS:
|
||||
lcd_putsAtt(0, y, STR_DELETE_ALL_SENSORS, attr);
|
||||
lcdDrawText(0, y, STR_DELETE_ALL_SENSORS, attr);
|
||||
if (attr)
|
||||
s_editMode = 0;
|
||||
if (attr && event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
|
@ -670,7 +670,7 @@ void menuModelTelemetry(uint8_t event)
|
|||
lcd_putsLeft(y, STR_CENTER);
|
||||
lcd_outdezAtt(TELEM_COL2, y, -5+g_model.frsky.varioCenterMin, (m_posHorz==0 ? attr : 0)|PREC1|LEFT);
|
||||
lcd_outdezAtt(TELEM_COL2+7*FW, y, 5+g_model.frsky.varioCenterMax, (m_posHorz==1 ? attr : 0)|PREC1|LEFT);
|
||||
lcd_putsiAtt(TELEM_COL3, y, STR_VVARIOCENTER, g_model.frsky.varioCenterSilent, (m_posHorz==2 ? attr : 0));
|
||||
lcdDrawTextAtIndex(TELEM_COL3, y, STR_VVARIOCENTER, g_model.frsky.varioCenterSilent, (m_posHorz==2 ? attr : 0));
|
||||
if (attr && s_editMode>0) {
|
||||
switch (m_posHorz) {
|
||||
case 0:
|
||||
|
@ -728,9 +728,9 @@ void menuModelTelemetry(uint8_t event)
|
|||
// TODO better function name for ---
|
||||
// TODO function for these lines
|
||||
if (ZEXIST(scriptData.file))
|
||||
lcd_putsnAtt(TELEM_SCRTYPE_COL+7*FW, y, scriptData.file, sizeof(scriptData.file), (m_posHorz==1 ? attr : 0));
|
||||
lcdDrawTextWithLen(TELEM_SCRTYPE_COL+7*FW, y, scriptData.file, sizeof(scriptData.file), (m_posHorz==1 ? attr : 0));
|
||||
else
|
||||
lcd_putsiAtt(TELEM_SCRTYPE_COL+7*FW, y, STR_VCSWFUNC, 0, (m_posHorz==1 ? attr : 0));
|
||||
lcdDrawTextAtIndex(TELEM_SCRTYPE_COL+7*FW, y, STR_VCSWFUNC, 0, (m_posHorz==1 ? attr : 0));
|
||||
|
||||
if (m_posHorz==1 && attr && event==EVT_KEY_BREAK(KEY_ENTER) && READ_ONLY_UNLOCKED()) {
|
||||
s_editMode = 0;
|
||||
|
|
|
@ -108,7 +108,7 @@ void menuAboutView(uint8_t event);
|
|||
void menuTraceBuffer(uint8_t event);
|
||||
#endif
|
||||
|
||||
void displaySlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr);
|
||||
void drawSlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr);
|
||||
|
||||
void menuMainViewChannelsMonitor(uint8_t event);
|
||||
void menuChannelsView(uint8_t event);
|
||||
|
@ -327,7 +327,6 @@ void drawStatusLine();
|
|||
extern char s_text_file[TEXT_FILENAME_MAXLEN];
|
||||
void menuTextView(uint8_t event);
|
||||
void pushMenuTextView(const char *filename);
|
||||
bool modelHasNotes();
|
||||
void pushModelNotes();
|
||||
|
||||
void menuChannelsView(uint8_t event);
|
||||
|
@ -335,23 +334,19 @@ void menuChannelsView(uint8_t event);
|
|||
#define LABEL(...) (uint8_t)-1
|
||||
|
||||
#if defined(REV9E) && !defined(SIMU)
|
||||
#define KEY_MOVE_UP KEY_MINUS
|
||||
#define KEY_MOVE_DOWN KEY_PLUS
|
||||
#define CURSOR_MOVED_LEFT(event) (EVT_KEY_MASK(event) == KEY_MINUS)
|
||||
#define CURSOR_MOVED_RIGHT(event) (EVT_KEY_MASK(event) == KEY_PLUS)
|
||||
#define CASE_EVT_ROTARY_MOVE_RIGHT CASE_EVT_ROTARY_RIGHT
|
||||
#define CASE_EVT_ROTARY_MOVE_LEFT CASE_EVT_ROTARY_LEFT
|
||||
#define IS_ROTARY_MOVE_RIGHT IS_ROTARY_RIGHT
|
||||
#define IS_ROTARY_MOVE_LEFT IS_ROTARY_LEFT
|
||||
#define KEY_UP KEY_MINUS
|
||||
#define KEY_DOWN KEY_PLUS
|
||||
#define KEY_RIGHT KEY_PLUS
|
||||
#define KEY_LEFT KEY_MINUS
|
||||
#define CURSOR_MOVED_LEFT(event) (EVT_KEY_MASK(event) == KEY_LEFT)
|
||||
#define CURSOR_MOVED_RIGHT(event) (EVT_KEY_MASK(event) == KEY_RIGHT)
|
||||
#else
|
||||
#define KEY_MOVE_UP KEY_PLUS
|
||||
#define KEY_MOVE_DOWN KEY_MINUS
|
||||
#define CURSOR_MOVED_LEFT(event) (EVT_KEY_MASK(event) == KEY_PLUS)
|
||||
#define CURSOR_MOVED_RIGHT(event) (EVT_KEY_MASK(event) == KEY_MINUS)
|
||||
#define CASE_EVT_ROTARY_MOVE_RIGHT CASE_EVT_ROTARY_LEFT
|
||||
#define CASE_EVT_ROTARY_MOVE_LEFT CASE_EVT_ROTARY_RIGHT
|
||||
#define IS_ROTARY_MOVE_RIGHT IS_ROTARY_LEFT
|
||||
#define IS_ROTARY_MOVE_LEFT IS_ROTARY_RIGHT
|
||||
#define KEY_UP KEY_PLUS
|
||||
#define KEY_DOWN KEY_MINUS
|
||||
#define KEY_RIGHT KEY_MINUS
|
||||
#define KEY_LEFT KEY_PLUS
|
||||
#define CURSOR_MOVED_LEFT(event) (EVT_KEY_MASK(event) == KEY_LEFT)
|
||||
#define CURSOR_MOVED_RIGHT(event) (EVT_KEY_MASK(event) == KEY_RIGHT)
|
||||
#endif
|
||||
|
||||
#define REPEAT_LAST_CURSOR_MOVE() { if (CURSOR_MOVED_LEFT(event) || CURSOR_MOVED_RIGHT(event)) putEvent(event); else m_posHorz = 0; }
|
||||
|
|
|
@ -173,7 +173,7 @@ int checkIncDec(unsigned int event, int val, int i_min, int i_max, unsigned int
|
|||
}
|
||||
#endif
|
||||
|
||||
if (s_editMode>0 && (IS_ROTARY_RIGHT(event) || event==EVT_KEY_FIRST(KEY_UP) || event==EVT_KEY_REPT(KEY_UP))) {
|
||||
if (s_editMode>0 && (event==EVT_KEY_FIRST(KEY_PLUS) || event==EVT_KEY_REPT(KEY_PLUS))) {
|
||||
do {
|
||||
if (IS_KEY_REPT(event) && (i_flags & INCDEC_REP10)) {
|
||||
newval += min(10, i_max-val);
|
||||
|
@ -192,7 +192,7 @@ int checkIncDec(unsigned int event, int val, int i_min, int i_max, unsigned int
|
|||
AUDIO_KEYPAD_UP();
|
||||
}
|
||||
}
|
||||
else if (s_editMode>0 && (IS_ROTARY_LEFT(event) || event==EVT_KEY_FIRST(KEY_DOWN) || event==EVT_KEY_REPT(KEY_DOWN))) {
|
||||
else if (s_editMode>0 && (event==EVT_KEY_FIRST(KEY_MINUS) || event==EVT_KEY_REPT(KEY_MINUS))) {
|
||||
do {
|
||||
if (IS_KEY_REPT(event) && (i_flags & INCDEC_REP10)) {
|
||||
newval -= min(10, val-i_min);
|
||||
|
@ -212,7 +212,7 @@ int checkIncDec(unsigned int event, int val, int i_min, int i_max, unsigned int
|
|||
}
|
||||
}
|
||||
|
||||
if (!READ_ONLY() && i_min==0 && i_max==1 && (event==EVT_KEY_BREAK(KEY_ENTER) || IS_ROTARY_BREAK(event))) {
|
||||
if (!READ_ONLY() && i_min==0 && i_max==1 && event==EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
s_editMode = 0;
|
||||
newval = !val;
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ int checkIncDec(unsigned int event, int val, int i_min, int i_max, unsigned int
|
|||
}
|
||||
|
||||
if (newval != val) {
|
||||
if (!(i_flags & NO_INCDEC_MARKS) && (newval != i_max) && (newval != i_min) && stops.contains(newval) && !IS_ROTARY_EVENT(event)) {
|
||||
if (!(i_flags & NO_INCDEC_MARKS) && (newval != i_max) && (newval != i_min) && stops.contains(newval)) {
|
||||
bool pause = (newval > val ? !stops.contains(newval+1) : !stops.contains(newval-1));
|
||||
if (pause) {
|
||||
pauseEvents(event); // delay before auto-repeat continues
|
||||
|
@ -474,7 +474,8 @@ void check(const char *name, check_event_t event, uint8_t curr, const MenuFuncP
|
|||
}
|
||||
break;
|
||||
|
||||
CASE_EVT_ROTARY_MOVE_RIGHT
|
||||
case EVT_KEY_FIRST(KEY_RIGHT):
|
||||
case EVT_KEY_REPT(KEY_RIGHT):
|
||||
if (s_editMode != 0) break;
|
||||
if ((COLATTR(l_posVert) & NAVIGATION_LINE_BY_LINE)) {
|
||||
if (l_posHorz >= 0) {
|
||||
|
@ -489,8 +490,6 @@ void check(const char *name, check_event_t event, uint8_t curr, const MenuFuncP
|
|||
}
|
||||
else {
|
||||
l_posHorz = 0;
|
||||
if (!IS_ROTARY_MOVE_RIGHT(event))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -503,7 +502,8 @@ void check(const char *name, check_event_t event, uint8_t curr, const MenuFuncP
|
|||
l_posHorz = POS_HORZ_INIT(l_posVert);
|
||||
break;
|
||||
|
||||
CASE_EVT_ROTARY_MOVE_LEFT
|
||||
case EVT_KEY_FIRST(KEY_LEFT):
|
||||
case EVT_KEY_REPT(KEY_LEFT):
|
||||
if (s_editMode != 0) break;
|
||||
if ((COLATTR(l_posVert) & NAVIGATION_LINE_BY_LINE)) {
|
||||
if (l_posHorz >= 0) {
|
||||
|
@ -511,19 +511,10 @@ void check(const char *name, check_event_t event, uint8_t curr, const MenuFuncP
|
|||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (l_posHorz > 0) {
|
||||
else if (l_posHorz > 0) {
|
||||
l_posHorz--;
|
||||
break;
|
||||
}
|
||||
else if (IS_ROTARY_MOVE_LEFT(event) && s_editMode == 0) {
|
||||
l_posHorz = 0xff;
|
||||
}
|
||||
else {
|
||||
l_posHorz = maxcol;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
DEC(l_posVert, MENU_FIRST_LINE_EDIT, rowcount-1);
|
||||
|
@ -546,7 +537,7 @@ void check(const char *name, check_event_t event, uint8_t curr, const MenuFuncP
|
|||
if (horTab) {
|
||||
linesCount = 0;
|
||||
for (int i=0; i<rowcount; i++) {
|
||||
if (i>=horTabMax || horTab[i] != HIDDEN_ROW) {
|
||||
if (i>horTabMax || horTab[i] != HIDDEN_ROW) {
|
||||
linesCount++;
|
||||
}
|
||||
}
|
||||
|
@ -577,7 +568,7 @@ void check(const char *name, check_event_t event, uint8_t curr, const MenuFuncP
|
|||
else {
|
||||
linesCount = s_pgOfs + NUM_BODY_LINES;
|
||||
for (int i=lastLine; i<rowcount; i++) {
|
||||
if (i>=horTabMax || horTab[i] != HIDDEN_ROW) {
|
||||
if (i>horTabMax || horTab[i] != HIDDEN_ROW) {
|
||||
linesCount++;
|
||||
}
|
||||
}
|
||||
|
@ -597,7 +588,7 @@ void check(const char *name, check_event_t event, uint8_t curr, const MenuFuncP
|
|||
}
|
||||
|
||||
if (scrollbar_X && linesCount > NUM_BODY_LINES) {
|
||||
lcdDrawScrollbar(scrollbar_X, MENU_HEADER_HEIGHT, LCD_H-MENU_HEADER_HEIGHT, s_pgOfs, linesCount, NUM_BODY_LINES);
|
||||
drawScrollbar(scrollbar_X, MENU_HEADER_HEIGHT, LCD_H-MENU_HEADER_HEIGHT, s_pgOfs, linesCount, NUM_BODY_LINES);
|
||||
}
|
||||
|
||||
if (name) {
|
||||
|
|
|
@ -76,11 +76,11 @@ void message(const pm_char *title, const pm_char *t, const char *last MESSAGE_SO
|
|||
#define MESSAGE_LCD_OFFSET 60
|
||||
|
||||
#if defined(TRANSLATIONS_FR) || defined(TRANSLATIONS_IT) || defined(TRANSLATIONS_CZ)
|
||||
lcd_putsAtt(MESSAGE_LCD_OFFSET, 0, STR_WARNING, DBLSIZE);
|
||||
lcd_putsAtt(MESSAGE_LCD_OFFSET, 2*FH, title, DBLSIZE);
|
||||
lcdDrawText(MESSAGE_LCD_OFFSET, 0, STR_WARNING, DBLSIZE);
|
||||
lcdDrawText(MESSAGE_LCD_OFFSET, 2*FH, title, DBLSIZE);
|
||||
#else
|
||||
lcd_putsAtt(MESSAGE_LCD_OFFSET, 0, title, DBLSIZE);
|
||||
lcd_putsAtt(MESSAGE_LCD_OFFSET, 2*FH, STR_WARNING, DBLSIZE);
|
||||
lcdDrawText(MESSAGE_LCD_OFFSET, 0, title, DBLSIZE);
|
||||
lcdDrawText(MESSAGE_LCD_OFFSET, 2*FH, STR_WARNING, DBLSIZE);
|
||||
#endif
|
||||
|
||||
drawFilledRect(MESSAGE_LCD_OFFSET, 0, LCD_W-MESSAGE_LCD_OFFSET, 32);
|
||||
|
@ -102,7 +102,7 @@ void displayWarning(uint8_t event)
|
|||
s_warning_result = false;
|
||||
displayBox(s_warning);
|
||||
if (s_warning_info) {
|
||||
lcd_putsnAtt(WARNING_LINE_X, WARNING_LINE_Y+FH, s_warning_info, s_warning_info_len, WARNING_INFO_FLAGS);
|
||||
lcdDrawTextWithLen(WARNING_LINE_X, WARNING_LINE_Y+FH, s_warning_info, s_warning_info_len, WARNING_INFO_FLAGS);
|
||||
}
|
||||
lcd_puts(WARNING_LINE_X, WARNING_LINE_Y+2*FH, s_warning_type == WARNING_TYPE_ASTERISK ? STR_EXIT : STR_POPUPS);
|
||||
switch (event) {
|
||||
|
@ -134,17 +134,17 @@ const char * displayMenu(uint8_t event)
|
|||
lcdDrawRect(MENU_X, y, MENU_W, display_count * (FH+1) + 2);
|
||||
|
||||
for (uint8_t i=0; i<display_count; i++) {
|
||||
lcd_putsAtt(MENU_X+6, i*(FH+1) + y + 2, s_menu[i+(s_menu_offset_type == MENU_OFFSET_INTERNAL ? s_menu_offset : 0)], s_menu_flags);
|
||||
lcdDrawText(MENU_X+6, i*(FH+1) + y + 2, s_menu[i+(s_menu_offset_type == MENU_OFFSET_INTERNAL ? s_menu_offset : 0)], s_menu_flags);
|
||||
if (i == s_menu_item) drawFilledRect(MENU_X+1, i*(FH+1) + y + 1, MENU_W-2, 9);
|
||||
}
|
||||
|
||||
if (s_menu_count > display_count) {
|
||||
lcdDrawScrollbar(MENU_X+MENU_W-1, y+1, MENU_MAX_DISPLAY_LINES * (FH+1), s_menu_offset, s_menu_count, display_count);
|
||||
drawScrollbar(MENU_X+MENU_W-1, y+1, MENU_MAX_DISPLAY_LINES * (FH+1), s_menu_offset, s_menu_count, display_count);
|
||||
}
|
||||
|
||||
switch(event) {
|
||||
case EVT_KEY_FIRST(KEY_MOVE_UP):
|
||||
case EVT_KEY_REPT(KEY_MOVE_UP):
|
||||
case EVT_KEY_FIRST(KEY_UP):
|
||||
case EVT_KEY_REPT(KEY_UP):
|
||||
if (s_menu_item > 0) {
|
||||
s_menu_item--;
|
||||
}
|
||||
|
@ -161,8 +161,8 @@ const char * displayMenu(uint8_t event)
|
|||
}
|
||||
break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_MOVE_DOWN):
|
||||
case EVT_KEY_REPT(KEY_MOVE_DOWN):
|
||||
case EVT_KEY_FIRST(KEY_DOWN):
|
||||
case EVT_KEY_REPT(KEY_DOWN):
|
||||
if (s_menu_item < display_count - 1 && s_menu_offset + s_menu_item + 1 < s_menu_count) {
|
||||
s_menu_item++;
|
||||
}
|
||||
|
@ -178,7 +178,6 @@ const char * displayMenu(uint8_t event)
|
|||
}
|
||||
}
|
||||
break;
|
||||
CASE_EVT_ROTARY_BREAK
|
||||
case EVT_KEY_BREAK(KEY_ENTER):
|
||||
result = s_menu[s_menu_item + (s_menu_offset_type == MENU_OFFSET_INTERNAL ? s_menu_offset : 0)];
|
||||
// no break
|
||||
|
|
|
@ -83,7 +83,7 @@ void menuAboutView(uint8_t event)
|
|||
}
|
||||
|
||||
lcd_bmp(0, 0, about_bmp);
|
||||
lcd_putsAtt(64, 0, STR_ABOUTUS, DBLSIZE);
|
||||
lcdDrawText(64, 0, STR_ABOUTUS, DBLSIZE);
|
||||
lcd_hline(ABOUT_X, 18, 120);
|
||||
lcd_hline(ABOUT_X, 19, 130, GREY_DEFAULT);
|
||||
LcdFlags att = GREY(max(0, 15-greyIndex/2));
|
||||
|
@ -93,67 +93,67 @@ void menuAboutView(uint8_t event)
|
|||
switch (screenIndex) {
|
||||
case ABOUT_OPENTX:
|
||||
case ABOUT_END:
|
||||
lcd_putsAtt(ABOUT_X, 22, STR_ABOUT_OPENTX_1, SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X, 30, STR_ABOUT_OPENTX_2, SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X, 38, STR_ABOUT_OPENTX_3, SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X, 46, STR_ABOUT_OPENTX_4, SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X, 54, STR_ABOUT_OPENTX_5, SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 22, STR_ABOUT_OPENTX_1, SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 30, STR_ABOUT_OPENTX_2, SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 38, STR_ABOUT_OPENTX_3, SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 46, STR_ABOUT_OPENTX_4, SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 54, STR_ABOUT_OPENTX_5, SMLSIZE);
|
||||
screenDuration = 255;
|
||||
break;
|
||||
|
||||
case ABOUT_BERTRAND:
|
||||
lcd_putsAtt(ABOUT_X, 24, STR_ABOUT_BERTRAND_1, att);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_BERTRAND_2, att|SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_BERTRAND_3, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 24, STR_ABOUT_BERTRAND_1, att);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_BERTRAND_2, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_BERTRAND_3, att|SMLSIZE);
|
||||
break;
|
||||
|
||||
case ABOUT_ANDRE:
|
||||
lcd_putsAtt(ABOUT_X, 24, STR_ABOUT_ANDRE_1, att);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_ANDRE_2, att|SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_ANDRE_3, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 24, STR_ABOUT_ANDRE_1, att);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_ANDRE_2, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_ANDRE_3, att|SMLSIZE);
|
||||
break;
|
||||
|
||||
case ABOUT_MIKE:
|
||||
lcd_putsAtt(ABOUT_X, 24, STR_ABOUT_MIKE_1, att);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_MIKE_2, att|SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_MIKE_3, att|SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 52, STR_ABOUT_MIKE_4, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 24, STR_ABOUT_MIKE_1, att);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_MIKE_2, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_MIKE_3, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 52, STR_ABOUT_MIKE_4, att|SMLSIZE);
|
||||
break;
|
||||
|
||||
case ABOUT_KJELL:
|
||||
lcd_putsAtt(ABOUT_X, 24, STR_ABOUT_KJELL_1, att);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_KJELL_2, att|SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_KJELL_3, att|SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 52, STR_ABOUT_KJELL_4, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 24, STR_ABOUT_KJELL_1, att);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_KJELL_2, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_KJELL_3, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 52, STR_ABOUT_KJELL_4, att|SMLSIZE);
|
||||
break;
|
||||
|
||||
case ABOUT_MARTIN:
|
||||
lcd_putsAtt(ABOUT_X, 24, STR_ABOUT_MARTIN_1, att);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_MARTIN_2, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 24, STR_ABOUT_MARTIN_1, att);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_MARTIN_2, att|SMLSIZE);
|
||||
break;
|
||||
|
||||
case ABOUT_ROMOLO:
|
||||
lcd_putsAtt(ABOUT_X, 24, STR_ABOUT_ROMOLO_1, att);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_ROMOLO_2, att|SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_ROMOLO_3, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 24, STR_ABOUT_ROMOLO_1, att);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_ROMOLO_2, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_ROMOLO_3, att|SMLSIZE);
|
||||
break;
|
||||
|
||||
case ABOUT_ROB:
|
||||
lcd_putsAtt(ABOUT_X, 24, STR_ABOUT_ROB_1, att);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_ROB_2, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 24, STR_ABOUT_ROB_1, att);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_ROB_2, att|SMLSIZE);
|
||||
break;
|
||||
|
||||
case ABOUT_HARDWARE:
|
||||
lcd_putsAtt(ABOUT_X, 24, STR_ABOUT_HARDWARE_1, att);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_HARDWARE_2, att|SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_HARDWARE_3, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 24, STR_ABOUT_HARDWARE_1, att);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_HARDWARE_2, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_HARDWARE_3, att|SMLSIZE);
|
||||
break;
|
||||
|
||||
case ABOUT_PARENTS:
|
||||
lcd_putsAtt(ABOUT_X, 24, STR_ABOUT_PARENTS_1, att);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_PARENTS_2, att|SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_PARENTS_3, att|SMLSIZE);
|
||||
lcd_putsAtt(ABOUT_X+ABOUT_INDENT, 52, STR_ABOUT_PARENTS_4, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X, 24, STR_ABOUT_PARENTS_1, att);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 36, STR_ABOUT_PARENTS_2, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 44, STR_ABOUT_PARENTS_3, att|SMLSIZE);
|
||||
lcdDrawText(ABOUT_X+ABOUT_INDENT, 52, STR_ABOUT_PARENTS_4, att|SMLSIZE);
|
||||
screenDuration = 255;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ void menuChannelsView(uint8_t event)
|
|||
}
|
||||
|
||||
if (lenLabel > 0)
|
||||
lcd_putsnAtt(x+1-ofs, y, g_model.limitData[ch].name, sizeof(g_model.limitData[ch].name), ZCHAR | SMLSIZE);
|
||||
lcdDrawTextWithLen(x+1-ofs, y, g_model.limitData[ch].name, sizeof(g_model.limitData[ch].name), ZCHAR | SMLSIZE);
|
||||
else
|
||||
putsChn(x+1-ofs, y, ch+1, SMLSIZE);
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@ void displayTrims(uint8_t phase)
|
|||
}
|
||||
}
|
||||
|
||||
void displaySliders()
|
||||
void drawSliders()
|
||||
{
|
||||
for (uint8_t i=NUM_STICKS; i<NUM_STICKS+NUM_POTS; i++) {
|
||||
#if defined(REV9E)
|
||||
|
@ -317,7 +317,7 @@ void displayTimers()
|
|||
TimerData & timerData = g_model.timers[i];
|
||||
uint8_t y = TIMERS_Y + i*TIMERS_H;
|
||||
if (ZLEN(timerData.name) > 0) {
|
||||
lcd_putsnAtt(TIMERS_X, y-7, timerData.name, LEN_TIMER_NAME, ZCHAR|SMLSIZE);
|
||||
lcdDrawTextWithLen(TIMERS_X, y-7, timerData.name, LEN_TIMER_NAME, ZCHAR|SMLSIZE);
|
||||
}
|
||||
else {
|
||||
putsTimerMode(TIMERS_X, y-7, timerData.mode, SMLSIZE);
|
||||
|
@ -538,7 +538,7 @@ void menuMainView(uint8_t event)
|
|||
|
||||
// Flight Mode Name
|
||||
int mode = mixerCurrentFlightMode;
|
||||
lcd_putsnAtt(PHASE_X, PHASE_Y, g_model.flightModeData[mode].name, sizeof(g_model.flightModeData[mode].name), ZCHAR|PHASE_FLAGS);
|
||||
lcdDrawTextWithLen(PHASE_X, PHASE_Y, g_model.flightModeData[mode].name, sizeof(g_model.flightModeData[mode].name), ZCHAR|PHASE_FLAGS);
|
||||
|
||||
// Model Name
|
||||
putsModelName(MODELNAME_X, MODELNAME_Y, g_model.header.name, g_eeGeneral.currModel, BIGSIZE);
|
||||
|
@ -550,7 +550,7 @@ void menuMainView(uint8_t event)
|
|||
displayTopBar();
|
||||
|
||||
// Sliders (Pots / Sliders)
|
||||
displaySliders();
|
||||
drawSliders();
|
||||
|
||||
lcd_bmp(BITMAP_X, BITMAP_Y, modelBitmap);
|
||||
|
||||
|
@ -616,8 +616,8 @@ void menuMainView(uint8_t event)
|
|||
drawFilledRect(BITMAP_X, BITMAP_Y, 64, 32, SOLID, ERASE);
|
||||
lcdDrawRect(BITMAP_X, BITMAP_Y, 64, 32);
|
||||
putsStrIdx(BITMAP_X+FW, BITMAP_Y+FH-1, STR_GV, s_gvar_last+1);
|
||||
lcd_putsnAtt(BITMAP_X+4*FW+FW/2, BITMAP_Y+FH-1, g_model.gvars[s_gvar_last].name, LEN_GVAR_NAME, ZCHAR);
|
||||
lcd_putsAtt(BITMAP_X+FW, BITMAP_Y+2*FH+3, PSTR("[\010]"), BOLD);
|
||||
lcdDrawTextWithLen(BITMAP_X+4*FW+FW/2, BITMAP_Y+FH-1, g_model.gvars[s_gvar_last].name, LEN_GVAR_NAME, ZCHAR);
|
||||
lcdDrawText(BITMAP_X+FW, BITMAP_Y+2*FH+3, PSTR("[\010]"), BOLD);
|
||||
lcd_outdezAtt(BITMAP_X+5*FW+FW/2, BITMAP_Y+2*FH+3, GVAR_VALUE(s_gvar_last, getGVarFlightPhase(mixerCurrentFlightMode, s_gvar_last)), BOLD);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -168,9 +168,9 @@ void menuStatisticsDebug(uint8_t event)
|
|||
|
||||
#if defined(LUA)
|
||||
lcd_putsLeft(MENU_DEBUG_Y_LUA, "Lua scripts");
|
||||
lcd_putsAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_LUA+1, "[Duration]", SMLSIZE);
|
||||
lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_LUA+1, "[Duration]", SMLSIZE);
|
||||
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_LUA, 10*maxLuaDuration, LEFT);
|
||||
lcd_putsAtt(lcdLastPos+2, MENU_DEBUG_Y_LUA+1, "[Interval]", SMLSIZE);
|
||||
lcdDrawText(lcdLastPos+2, MENU_DEBUG_Y_LUA+1, "[Interval]", SMLSIZE);
|
||||
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_LUA, 10*maxLuaInterval, LEFT);
|
||||
#endif
|
||||
|
||||
|
@ -188,13 +188,13 @@ void menuStatisticsDebug(uint8_t event)
|
|||
#endif
|
||||
|
||||
lcd_putsLeft(MENU_DEBUG_Y_RTOS, STR_FREESTACKMINB);
|
||||
lcd_putsAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS+1, "[M]", SMLSIZE);
|
||||
lcdDrawText(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS+1, "[M]", SMLSIZE);
|
||||
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS, menusStack.available(), UNSIGN|LEFT);
|
||||
lcd_putsAtt(lcdLastPos+2, MENU_DEBUG_Y_RTOS+1, "[X]", SMLSIZE);
|
||||
lcdDrawText(lcdLastPos+2, MENU_DEBUG_Y_RTOS+1, "[X]", SMLSIZE);
|
||||
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS, mixerStack.available(), UNSIGN|LEFT);
|
||||
lcd_putsAtt(lcdLastPos+2, MENU_DEBUG_Y_RTOS+1, "[A]", SMLSIZE);
|
||||
lcdDrawText(lcdLastPos+2, MENU_DEBUG_Y_RTOS+1, "[A]", SMLSIZE);
|
||||
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS, audioStack.available(), UNSIGN|LEFT);
|
||||
lcd_putsAtt(lcdLastPos+2, MENU_DEBUG_Y_RTOS+1, "[I]", SMLSIZE);
|
||||
lcdDrawText(lcdLastPos+2, MENU_DEBUG_Y_RTOS+1, "[I]", SMLSIZE);
|
||||
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS, stackAvailable(), UNSIGN|LEFT);
|
||||
|
||||
lcd_puts(3*FW, 7*FH+1, STR_MENUTORESET);
|
||||
|
|
|
@ -58,7 +58,7 @@ void displayRssiLine()
|
|||
drawFilledRect(BAR_LEFT+1, 58, 19*rssi/25, 5, (rssi < getRssiAlarmValue(0)) ? DOTTED : SOLID);
|
||||
}
|
||||
else {
|
||||
lcd_putsAtt(7*FW, STATUS_BAR_Y, STR_NODATA, BLINK);
|
||||
lcdDrawText(7*FW, STATUS_BAR_Y, STR_NODATA, BLINK);
|
||||
lcd_status_line();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ void menuTextView(uint8_t event)
|
|||
}
|
||||
|
||||
for (int i=0; i<LCD_LINES-1; i++) {
|
||||
lcd_putsAtt(0, i*FH+FH+1, s_text_screen[i], FIXEDWIDTH);
|
||||
lcdDrawText(0, i*FH+FH+1, s_text_screen[i], FIXEDWIDTH);
|
||||
}
|
||||
|
||||
char *title = s_text_file;
|
||||
|
@ -149,7 +149,7 @@ void menuTextView(uint8_t event)
|
|||
lcd_invert_line(0);
|
||||
|
||||
if (lines_count > LCD_LINES-1) {
|
||||
lcdDrawScrollbar(LCD_W-1, FH, LCD_H-FH, s_pgOfs, lines_count, LCD_LINES-1);
|
||||
drawScrollbar(LCD_W-1, FH, LCD_H-FH, s_pgOfs, lines_count, LCD_LINES-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ void drawStick(coord_t centrex, int16_t xval, int16_t yval)
|
|||
|
||||
void displayColumnHeader(const char * const *headers, uint8_t index)
|
||||
{
|
||||
lcd_putsAtt(17*FW, 0, headers[index], 0);
|
||||
lcdDrawText(17*FW, 0, headers[index], 0);
|
||||
}
|
||||
|
||||
void menu_lcd_onoff(coord_t x, coord_t y, uint8_t value, LcdFlags attr)
|
||||
|
@ -82,7 +82,7 @@ void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr)
|
|||
lcd_outdezAtt(x, 0, index+1, attr);
|
||||
}
|
||||
|
||||
void lcdDrawScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible)
|
||||
void drawScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible)
|
||||
{
|
||||
lcdDrawVerticalLine(x, y, h, DOTTED);
|
||||
coord_t yofs = (h * offset) / count;
|
||||
|
@ -101,12 +101,12 @@ void displayMenuBar(const MenuItem *menu, int index)
|
|||
drawFilledRect(0, 0, LCD_W, 32, SOLID, ERASE);
|
||||
drawFilledRect(0, 24, LCD_W, 7, SOLID, GREY_DEFAULT);
|
||||
lcd_bmp(1, 0, MAINMENU_LBM);
|
||||
lcd_putsAtt(0, 24, menu[index].name, INVERS);
|
||||
lcdDrawText(0, 24, menu[index].name, INVERS);
|
||||
lcdDrawRect(index*24, 0, 26, 24, SOLID, FORCE);
|
||||
lcdDrawHorizontalLine(0, 31, LCD_W, SOLID, FORCE);
|
||||
}
|
||||
|
||||
void displayProgressBar(const char *label)
|
||||
void drawProgressBar(const char *label)
|
||||
{
|
||||
lcd_putsLeft(4*FH, label);
|
||||
lcdDrawRect(3, 6*FH+4, 204, 7);
|
||||
|
@ -137,13 +137,13 @@ void drawGauge(coord_t x, coord_t y, coord_t w, coord_t h, int32_t val, int32_t
|
|||
|
||||
void title(const pm_char * s)
|
||||
{
|
||||
lcd_putsAtt(0, 0, s, INVERS);
|
||||
lcdDrawText(0, 0, s, INVERS);
|
||||
}
|
||||
|
||||
select_menu_value_t selectMenuItem(coord_t x, coord_t y, const pm_char *label, const pm_char *values, select_menu_value_t value, select_menu_value_t min, select_menu_value_t max, LcdFlags attr, uint8_t event)
|
||||
{
|
||||
lcd_putsColumnLeft(x, y, label);
|
||||
if (values) lcd_putsiAtt(x, y, values, value-min, attr);
|
||||
if (values) lcdDrawTextAtIndex(x, y, values, value-min, attr);
|
||||
if (attr) value = checkIncDec(event, value, min, max, (g_menuPos[0] == 0) ? EE_MODEL : EE_GENERAL);
|
||||
return value;
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ swsrc_t switchMenuItem(coord_t x, coord_t y, swsrc_t value, LcdFlags attr, uint8
|
|||
return value;
|
||||
}
|
||||
|
||||
void displaySlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr)
|
||||
void drawSlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr)
|
||||
{
|
||||
lcd_putc(x+(value*4*FW)/max, y, '$');
|
||||
lcd_hline(x, y+3, 5*FW-1, FORCE);
|
||||
|
@ -255,7 +255,7 @@ void drawStatusLine()
|
|||
}
|
||||
|
||||
drawFilledRect(0, LCD_H-statusLineHeight, LCD_W, FH, SOLID, ERASE);
|
||||
lcd_putsAtt(5, LCD_H+1-statusLineHeight, statusLineMsg, BSS);
|
||||
lcdDrawText(5, LCD_H+1-statusLineHeight, statusLineMsg, BSS);
|
||||
drawFilledRect(0, LCD_H-statusLineHeight, LCD_W, FH, SOLID);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,4 +61,6 @@ bool isSwitchAvailableInMixes(int swtch);
|
|||
bool isSwitchAvailableInTimers(int swtch);
|
||||
bool isModuleAvailable(int module);
|
||||
|
||||
bool modelHasNotes();
|
||||
|
||||
#endif // _GUI_HELPERS_H_
|
||||
|
|
|
@ -34,8 +34,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef keys_h
|
||||
#define keys_h
|
||||
#ifndef _KEYS_H_
|
||||
#define _KEYS_H_
|
||||
|
||||
enum EnumKeys {
|
||||
#if defined(PCBHORUS)
|
||||
|
@ -217,7 +217,7 @@ enum EnumKeys {
|
|||
#define EVT_ROTARY_LONG EVT_KEY_LONG(KEY_ENTER)
|
||||
#define EVT_ROTARY_LEFT 0xDF00
|
||||
#define EVT_ROTARY_RIGHT 0xDE00
|
||||
#elif defined(PCBTARANIS) || defined(PCBFLAMENCO) || defined(PCBHORUS)
|
||||
#elif defined(PCBTARANIS) || defined(PCBFLAMENCO)
|
||||
#define EVT_ROTARY_BREAK EVT_KEY_BREAK(KEY_ENTER)
|
||||
#define EVT_ROTARY_LONG EVT_KEY_LONG(KEY_ENTER)
|
||||
#else
|
||||
|
@ -227,61 +227,6 @@ enum EnumKeys {
|
|||
#define EVT_ROTARY_RIGHT 0xde
|
||||
#endif
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define IS_ROTARY_LEFT(evt) (evt==EVT_KEY_FIRST(KEY_MINUS) || evt==EVT_KEY_REPT(KEY_MINUS))
|
||||
#define IS_ROTARY_RIGHT(evt) (evt==EVT_KEY_FIRST(KEY_PLUS) || evt==EVT_KEY_REPT(KEY_PLUS))
|
||||
#define IS_ROTARY_UP(evt) (evt==EVT_KEY_FIRST(KEY_PLUS) || evt==EVT_KEY_REPT(KEY_PLUS))
|
||||
#define IS_ROTARY_DOWN(evt) (evt==EVT_KEY_FIRST(KEY_MINUS) || evt==EVT_KEY_REPT(KEY_MINUS))
|
||||
#define IS_ROTARY_BREAK(evt) (evt==EVT_KEY_BREAK(KEY_ENTER))
|
||||
#define IS_ROTARY_LONG(evt) (evt==EVT_KEY_LONG(KEY_ENTER))
|
||||
#define IS_ROTARY_EVENT(evt) (0)
|
||||
#define CASE_EVT_ROTARY_BREAK /*case EVT_KEY_BREAK(KEY_ENTER):*/
|
||||
#define CASE_EVT_ROTARY_LONG /*case EVT_KEY_LONG(KEY_ENTER):*/
|
||||
#define CASE_EVT_ROTARY_LEFT case EVT_KEY_FIRST(KEY_MOVE_UP): case EVT_KEY_REPT(KEY_MOVE_UP):
|
||||
#define CASE_EVT_ROTARY_RIGHT case EVT_KEY_FIRST(KEY_MOVE_DOWN): case EVT_KEY_REPT(KEY_MOVE_DOWN):
|
||||
#elif defined(PCBTARANIS) || defined(PCBFLAMENCO)
|
||||
#define IS_ROTARY_LEFT(evt) (evt==EVT_KEY_FIRST(KEY_MINUS) || evt==EVT_KEY_REPT(KEY_MINUS))
|
||||
#define IS_ROTARY_RIGHT(evt) (evt==EVT_KEY_FIRST(KEY_PLUS) || evt==EVT_KEY_REPT(KEY_PLUS))
|
||||
#define IS_ROTARY_UP(evt) (evt==EVT_KEY_FIRST(KEY_PLUS) || evt==EVT_KEY_REPT(KEY_PLUS))
|
||||
#define IS_ROTARY_DOWN(evt) (evt==EVT_KEY_FIRST(KEY_MINUS) || evt==EVT_KEY_REPT(KEY_MINUS))
|
||||
#define IS_ROTARY_BREAK(evt) (evt==EVT_KEY_BREAK(KEY_ENTER))
|
||||
#define IS_ROTARY_LONG(evt) (evt==EVT_KEY_LONG(KEY_ENTER))
|
||||
#define IS_ROTARY_EVENT(evt) (0)
|
||||
#define CASE_EVT_ROTARY_BREAK /*case EVT_KEY_BREAK(KEY_ENTER):*/
|
||||
#define CASE_EVT_ROTARY_LONG /*case EVT_KEY_LONG(KEY_ENTER):*/
|
||||
#if defined(REV9E) && !defined(SIMU)
|
||||
#define CASE_EVT_ROTARY_LEFT case EVT_KEY_FIRST(KEY_MOVE_UP): case EVT_KEY_REPT(KEY_MOVE_UP):
|
||||
#define CASE_EVT_ROTARY_RIGHT case EVT_KEY_FIRST(KEY_MOVE_DOWN): case EVT_KEY_REPT(KEY_MOVE_DOWN):
|
||||
#else
|
||||
#define CASE_EVT_ROTARY_LEFT case EVT_KEY_FIRST(KEY_MOVE_DOWN): case EVT_KEY_REPT(KEY_MOVE_DOWN):
|
||||
#define CASE_EVT_ROTARY_RIGHT case EVT_KEY_FIRST(KEY_MOVE_UP): case EVT_KEY_REPT(KEY_MOVE_UP):
|
||||
#endif
|
||||
#elif defined(ROTARY_ENCODER_NAVIGATION)
|
||||
#define IS_ROTARY_LEFT(evt) (evt == EVT_ROTARY_LEFT)
|
||||
#define IS_ROTARY_RIGHT(evt) (evt == EVT_ROTARY_RIGHT)
|
||||
#define IS_ROTARY_UP(evt) IS_ROTARY_LEFT(evt)
|
||||
#define IS_ROTARY_DOWN(evt) IS_ROTARY_RIGHT(evt)
|
||||
#define IS_ROTARY_BREAK(evt) (evt == EVT_ROTARY_BREAK)
|
||||
#define IS_ROTARY_LONG(evt) (evt == EVT_ROTARY_LONG)
|
||||
#define IS_ROTARY_EVENT(evt) (EVT_KEY_MASK(evt) >= 0x0e)
|
||||
#define CASE_EVT_ROTARY_BREAK case EVT_ROTARY_BREAK:
|
||||
#define CASE_EVT_ROTARY_LONG case EVT_ROTARY_LONG:
|
||||
#define CASE_EVT_ROTARY_LEFT case EVT_ROTARY_LEFT:
|
||||
#define CASE_EVT_ROTARY_RIGHT case EVT_ROTARY_RIGHT:
|
||||
#else
|
||||
#define IS_ROTARY_LEFT(evt) (0)
|
||||
#define IS_ROTARY_RIGHT(evt) (0)
|
||||
#define IS_ROTARY_UP(evt) (0)
|
||||
#define IS_ROTARY_DOWN(evt) (0)
|
||||
#define IS_ROTARY_BREAK(evt) (0)
|
||||
#define IS_ROTARY_LONG(evt) (0)
|
||||
#define IS_ROTARY_EVENT(evt) (0)
|
||||
#define CASE_EVT_ROTARY_BREAK
|
||||
#define CASE_EVT_ROTARY_LONG
|
||||
#define CASE_EVT_ROTARY_LEFT
|
||||
#define CASE_EVT_ROTARY_RIGHT
|
||||
#endif
|
||||
|
||||
class Key
|
||||
{
|
||||
#define FILTERBITS 4
|
||||
|
@ -335,4 +280,4 @@ void killEvents(uint8_t enuk);
|
|||
|
||||
uint8_t keyDown();
|
||||
|
||||
#endif
|
||||
#endif // _KEYS_H_
|
||||
|
|
|
@ -460,7 +460,7 @@ static int luaLcdDrawText(lua_State *L)
|
|||
int y = luaL_checkinteger(L, 2);
|
||||
const char * s = luaL_checkstring(L, 3);
|
||||
unsigned int att = luaL_optunsigned(L, 4, 0);
|
||||
lcd_putsAtt(x, y, s, att);
|
||||
lcdDrawText(x, y, s, att);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -635,7 +635,7 @@ static int luaLcdDrawCombobox(lua_State *L)
|
|||
for (int i=0; i<count; i++) {
|
||||
lua_rawgeti(L, 4, i+1);
|
||||
const char * item = luaL_checkstring(L, -1);
|
||||
lcd_putsAtt(x+2, y+2+9*i, item, 0);
|
||||
lcdDrawText(x+2, y+2+9*i, item, 0);
|
||||
}
|
||||
drawFilledRect(x+1, y+1+9*idx, w-11, 9);
|
||||
drawFilledRect(x+w-10, y, 10, 11, SOLID, ERASE);
|
||||
|
@ -646,7 +646,7 @@ static int luaLcdDrawCombobox(lua_State *L)
|
|||
drawFilledRect(x+w-9, y+1, 8, 9, SOLID, ERASE);
|
||||
lua_rawgeti(L, 4, idx+1);
|
||||
const char * item = luaL_checkstring(L, -1);
|
||||
lcd_putsAtt(x+2, y+2, item, INVERS);
|
||||
lcdDrawText(x+2, y+2, item, INVERS);
|
||||
}
|
||||
else {
|
||||
drawFilledRect(x, y, w, 11, SOLID, ERASE);
|
||||
|
@ -654,7 +654,7 @@ static int luaLcdDrawCombobox(lua_State *L)
|
|||
drawFilledRect(x+w-10, y+1, 9, 9, SOLID);
|
||||
lua_rawgeti(L, 4, idx+1);
|
||||
const char * item = luaL_checkstring(L, -1);
|
||||
lcd_putsAtt(x+2, y+2, item, 0);
|
||||
lcdDrawText(x+2, y+2, item, 0);
|
||||
}
|
||||
|
||||
lcd_hline(x+w-8, y+3, 6);
|
||||
|
@ -1890,11 +1890,11 @@ void displayLuaError(const char * title)
|
|||
if (lua_warning_info[0]) {
|
||||
char * split = strstr(lua_warning_info, ": ");
|
||||
if (split) {
|
||||
lcd_putsnAtt(WARNING_LINE_X, WARNING_LINE_Y+FH+3, lua_warning_info, split-lua_warning_info, SMLSIZE);
|
||||
lcd_putsnAtt(WARNING_LINE_X, WARNING_LINE_Y+2*FH+2, split+2, lua_warning_info+LUA_WARNING_INFO_LEN-split, SMLSIZE);
|
||||
lcdDrawTextWithLen(WARNING_LINE_X, WARNING_LINE_Y+FH+3, lua_warning_info, split-lua_warning_info, SMLSIZE);
|
||||
lcdDrawTextWithLen(WARNING_LINE_X, WARNING_LINE_Y+2*FH+2, split+2, lua_warning_info+LUA_WARNING_INFO_LEN-split, SMLSIZE);
|
||||
}
|
||||
else {
|
||||
lcd_putsnAtt(WARNING_LINE_X, WARNING_LINE_Y+FH+3, lua_warning_info, 40, SMLSIZE);
|
||||
lcdDrawTextWithLen(WARNING_LINE_X, WARNING_LINE_Y+FH+3, lua_warning_info, 40, SMLSIZE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -236,7 +236,7 @@ extern CurveInfo curveInfo(uint8_t idx);
|
|||
#endif
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define LEN_MODEL_NAME 12
|
||||
#define LEN_MODEL_NAME 15
|
||||
#define LEN_TIMER_NAME 8
|
||||
#define LEN_FLIGHT_MODE_NAME 10
|
||||
#define LEN_BITMAP_NAME 10
|
||||
|
@ -539,8 +539,8 @@ enum PotsWarnMode {
|
|||
TRAINER_MODE_MASTER,
|
||||
TRAINER_MODE_SLAVE
|
||||
};
|
||||
#define MODELDATA_BITMAP uint8_t bitmap;
|
||||
#define MODELDATA_EXTRA uint8_t externalModule:3; uint8_t trainerMode:3; uint8_t potsWarnMode:2; ModuleData moduleData[NUM_MODULES+1]; char curveNames[MAX_CURVES][6]; ScriptData scriptsData[MAX_SCRIPTS]; char inputNames[MAX_INPUTS][LEN_INPUT_NAME]; uint8_t potsWarnEnabled; int8_t potsWarnPosition[NUM_POTS];
|
||||
#define MODELDATA_BITMAP char bitmap[LEN_BITMAP_NAME];
|
||||
#define MODELDATA_EXTRA uint8_t spare:3; uint8_t trainerMode:3; uint8_t potsWarnMode:2; ModuleData moduleData[NUM_MODULES+1]; char curveNames[MAX_CURVES][6]; ScriptData scriptsData[MAX_SCRIPTS]; char inputNames[MAX_INPUTS][LEN_INPUT_NAME]; uint8_t potsWarnEnabled; int8_t potsWarnPosition[NUM_POTS];
|
||||
#elif defined(PCBFLAMENCO)
|
||||
enum ModuleIndex {
|
||||
EXTERNAL_MODULE,
|
||||
|
@ -551,7 +551,7 @@ enum PotsWarnMode {
|
|||
TRAINER_MODE_SLAVE
|
||||
};
|
||||
#define MODELDATA_BITMAP uint8_t bitmap;
|
||||
#define MODELDATA_EXTRA uint8_t externalModule:3; uint8_t trainerMode:3; uint8_t potsWarnMode:2; ModuleData moduleData[NUM_MODULES+1]; char curveNames[MAX_CURVES][6]; ScriptData scriptsData[MAX_SCRIPTS]; char inputNames[MAX_INPUTS][LEN_INPUT_NAME]; uint8_t potsWarnEnabled; int8_t potsWarnPosition[NUM_POTS];
|
||||
#define MODELDATA_EXTRA uint8_t spare:3; uint8_t trainerMode:3; uint8_t potsWarnMode:2; ModuleData moduleData[NUM_MODULES+1]; char curveNames[MAX_CURVES][6]; ScriptData scriptsData[MAX_SCRIPTS]; char inputNames[MAX_INPUTS][LEN_INPUT_NAME]; uint8_t potsWarnEnabled; int8_t potsWarnPosition[NUM_POTS];
|
||||
#elif defined(PCBTARANIS)
|
||||
enum ModuleIndex {
|
||||
INTERNAL_MODULE,
|
||||
|
|
|
@ -2427,14 +2427,10 @@ void opentxInit(OPENTX_INIT_ARGS)
|
|||
}
|
||||
#endif
|
||||
|
||||
TRACE("setVolume()");
|
||||
|
||||
#if defined(VOICE)
|
||||
setVolume(g_eeGeneral.speakerVolume+VOLUME_LEVEL_DEF);
|
||||
#endif
|
||||
|
||||
TRACE("audioQueue.start()");
|
||||
|
||||
#if defined(CPUARM)
|
||||
audioQueue.start();
|
||||
setBacklight(g_eeGeneral.backlightBright);
|
||||
|
@ -2462,7 +2458,6 @@ void opentxInit(OPENTX_INIT_ARGS)
|
|||
#endif
|
||||
}
|
||||
else {
|
||||
TRACE("opentxStart()");
|
||||
opentxStart();
|
||||
}
|
||||
|
||||
|
@ -2490,12 +2485,9 @@ void opentxInit(OPENTX_INIT_ARGS)
|
|||
doMixerCalculations();
|
||||
#endif
|
||||
|
||||
TRACE("startPulses()");
|
||||
startPulses();
|
||||
|
||||
wdt_enable(WDTO_500MS);
|
||||
|
||||
TRACE("opentxInit() end!");
|
||||
}
|
||||
|
||||
#if !defined(SIMU)
|
||||
|
|
|
@ -360,21 +360,6 @@
|
|||
#define NUM_PSWITCH (SWSRC_LAST_SWITCH-SWSRC_FIRST_SWITCH+1)
|
||||
#define NUM_POTSSW (NUM_XPOTS*6)
|
||||
|
||||
// TODO in keys.h!
|
||||
#if defined(PCBHORUS)
|
||||
#define KEY_PLUS KEY_RIGHT
|
||||
#define KEY_MINUS KEY_LEFT
|
||||
#elif defined(PCBTARANIS) || defined(PCBFLAMENCO)
|
||||
#define KEY_RIGHT KEY_PLUS
|
||||
#define KEY_LEFT KEY_MINUS
|
||||
#define KEY_UP KEY_PLUS
|
||||
#define KEY_DOWN KEY_MINUS
|
||||
#else
|
||||
#define KEY_ENTER KEY_MENU
|
||||
#define KEY_PLUS KEY_RIGHT
|
||||
#define KEY_MINUS KEY_LEFT
|
||||
#endif
|
||||
|
||||
#include "myeeprom.h"
|
||||
|
||||
#if defined(CPUM64)
|
||||
|
@ -500,14 +485,14 @@
|
|||
#endif
|
||||
|
||||
#if defined(PCBFLAMENCO)
|
||||
#define IS_MODULE_PPM(idx) (idx==TRAINER_MODULE || (idx==EXTERNAL_MODULE && g_model.externalModule==MODULE_TYPE_PPM))
|
||||
#define IS_MODULE_XJT(idx) ((g_model.externalModule==MODULE_TYPE_XJT) && (g_model.moduleData[idx].rfProtocol != RF_PROTO_OFF))
|
||||
#define IS_MODULE_PPM(idx) (idx==TRAINER_MODULE || (idx==EXTERNAL_MODULE && g_model.moduleData[EXTERNAL_MODULE].type==MODULE_TYPE_PPM))
|
||||
#define IS_MODULE_XJT(idx) ((g_model.moduleData[EXTERNAL_MODULE].type==MODULE_TYPE_XJT) && (g_model.moduleData[idx].rfProtocol != RF_PROTO_OFF))
|
||||
#if defined(DSM2)
|
||||
#define IS_MODULE_DSM2(idx) (idx==EXTERNAL_MODULE && g_model.externalModule==MODULE_TYPE_DSM2)
|
||||
#define IS_MODULE_DSM2(idx) (idx==EXTERNAL_MODULE && g_model.moduleData[EXTERNAL_MODULE].type==MODULE_TYPE_DSM2)
|
||||
#else
|
||||
#define IS_MODULE_DSM2(idx) (false)
|
||||
#endif
|
||||
#define MAX_EXTERNAL_MODULE_CHANNELS() ((g_model.externalModule == MODULE_TYPE_XJT) ? maxChannelsXJT[1+g_model.moduleData[1].rfProtocol] : maxChannelsModules[g_model.externalModule])
|
||||
#define MAX_EXTERNAL_MODULE_CHANNELS() ((g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_XJT) ? maxChannelsXJT[1+g_model.moduleData[1].rfProtocol] : maxChannelsModules[g_model.externalModule])
|
||||
#define MAX_CHANNELS(idx) (idx==EXTERNAL_MODULE ? MAX_EXTERNAL_MODULE_CHANNELS() : MAX_TRAINER_CHANNELS())
|
||||
#elif defined(PCBTARANIS)
|
||||
#if defined(TARANIS_INTERNAL_PPM)
|
||||
|
|
|
@ -269,9 +269,9 @@ void Open9xSim::updateKeysAndSwitches(bool start)
|
|||
KEY_Left, KEY_LEFT,
|
||||
KEY_Up, KEY_UP,
|
||||
KEY_Down, KEY_DOWN,
|
||||
#endif
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
KEY_F, BTN_REa,
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -370,14 +370,22 @@ long Open9xSim::onTimeout(FXObject*, FXSelector, void*)
|
|||
|
||||
updateKeysAndSwitches();
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
#if defined(PCBHORUS)
|
||||
extern rotenc_t rotencValue;
|
||||
#define ROTENC_VALUE rotencValue
|
||||
#else
|
||||
#define ROTENC_VALUE g_rotenc[0]
|
||||
#endif
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION) || defined(PCBHORUS)
|
||||
extern rotenc_t rotencValue;
|
||||
static bool rotencAction = false;
|
||||
if (getApp()->getKeyState(KEY_G)) {
|
||||
if (!rotencAction) g_rotenc[0] += ROTARY_ENCODER_GRANULARITY;
|
||||
if (!rotencAction) ROTENC_VALUE += ROTARY_ENCODER_GRANULARITY;
|
||||
rotencAction = true;
|
||||
}
|
||||
else if (getApp()->getKeyState(KEY_D)) {
|
||||
if (!rotencAction) g_rotenc[0] -= ROTARY_ENCODER_GRANULARITY;
|
||||
if (!rotencAction) ROTENC_VALUE -= ROTARY_ENCODER_GRANULARITY;
|
||||
rotencAction = true;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -863,7 +863,7 @@ void RlcFile::flush()
|
|||
}
|
||||
|
||||
#if defined (EEPROM_PROGRESS_BAR)
|
||||
void RlcFile::DisplayProgressBar(uint8_t x)
|
||||
void RlcFile::drawProgressBar(uint8_t x)
|
||||
{
|
||||
if (storageDirtyMsk || isWriting() || eeprom_buffer_size) {
|
||||
uint8_t len = storageDirtyMsk ? 1 : limit((uint8_t)1, (uint8_t)(7 - (m_rlc_len/m_ratio)), (uint8_t)7);
|
||||
|
|
|
@ -208,7 +208,7 @@ class RlcFile: public EFile
|
|||
uint16_t readRlc(uint8_t *buf, uint16_t i_len);
|
||||
|
||||
#if defined (EEPROM_PROGRESS_BAR)
|
||||
void DisplayProgressBar(uint8_t x);
|
||||
void drawProgressBar(uint8_t x);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -230,7 +230,7 @@ inline void eepromWriteProcess()
|
|||
}
|
||||
|
||||
#if defined (EEPROM_PROGRESS_BAR)
|
||||
#define DISPLAY_PROGRESS_BAR(x) theFile.DisplayProgressBar(x)
|
||||
#define DISPLAY_PROGRESS_BAR(x) theFile.drawProgressBar(x)
|
||||
#else
|
||||
#define DISPLAY_PROGRESS_BAR(x)
|
||||
#endif
|
||||
|
|
|
@ -189,6 +189,8 @@ void storageCheck(bool immediately)
|
|||
|
||||
void storageReadAll()
|
||||
{
|
||||
sdInit();
|
||||
|
||||
if (loadGeneralSettings() != NULL) {
|
||||
storageEraseAll(true);
|
||||
strcpy(g_eeGeneral.currModelFilename, "model.bin");
|
||||
|
|
|
@ -838,7 +838,7 @@ void checkSwitches()
|
|||
x += 20;
|
||||
}
|
||||
else if (numWarnings == 6) {
|
||||
lcd_putsAtt(x, y, "...", ALARM_COLOR);
|
||||
lcdDrawText(x, y, "...", ALARM_COLOR);
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
@ -851,7 +851,7 @@ void checkSwitches()
|
|||
x = lcdNextPos + 3;
|
||||
}
|
||||
else if (numWarnings == 7) {
|
||||
lcd_putsAtt(x, y, "...", 0);
|
||||
lcdDrawText(x, y, "...", 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -874,7 +874,7 @@ void checkSwitches()
|
|||
strncpy(s, &STR_VSRCRAW[1+(NUM_STICKS+1+i)*STR_VSRCRAW[0]], STR_VSRCRAW[0]);
|
||||
s[int(STR_VSRCRAW[0])] = '\0';
|
||||
#else
|
||||
lcd_putsiAtt(x, y, STR_VSRCRAW, NUM_STICKS+1+i, INVERS);
|
||||
lcdDrawTextAtIndex(x, y, STR_VSRCRAW, NUM_STICKS+1+i, INVERS);
|
||||
if (IS_POT(POT1+i))
|
||||
lcdDrawChar(lcdNextPos, y, g_model.potsWarnPosition[i] > GET_LOWRES_POT_POSITION(i) ? 126 : 127, INVERS);
|
||||
else
|
||||
|
@ -882,10 +882,10 @@ void checkSwitches()
|
|||
#endif
|
||||
#if defined(COLORLCD)
|
||||
if (++numWarnings < 6) {
|
||||
lcd_putsAtt(x, y, s, ALARM_COLOR);
|
||||
lcdDrawText(x, y, s, ALARM_COLOR);
|
||||
}
|
||||
else if (numWarnings == 6) {
|
||||
lcd_putsAtt(x, y, "...", ALARM_COLOR);
|
||||
lcdDrawText(x, y, "...", ALARM_COLOR);
|
||||
}
|
||||
x += 20;
|
||||
#else
|
||||
|
|
|
@ -248,9 +248,7 @@ void sdInit(void)
|
|||
return;
|
||||
}
|
||||
|
||||
TRACE("AVANT F_MOUNT");
|
||||
if (f_mount(&g_FATFS_Obj, "", 1) == FR_OK) {
|
||||
TRACE("APRES F_MOUNT");
|
||||
// call sdGetFreeSectors() now because f_getfree() takes a long time first time it's called
|
||||
sdGetFreeSectors();
|
||||
|
||||
|
|
|
@ -539,7 +539,7 @@ int main()
|
|||
else {
|
||||
x = 0;
|
||||
}
|
||||
lcd_putsnAtt(INDENT_WIDTH, 16 + FH * i, &Filenames[i][x], DISPLAY_CHAR_WIDTH, 0);
|
||||
lcdDrawTextWithLen(INDENT_WIDTH, 16 + FH * i, &Filenames[i][x], DISPLAY_CHAR_WIDTH, 0);
|
||||
}
|
||||
|
||||
if (event == EVT_KEY_REPT(BOOT_KEY_DOWN) || event == EVT_KEY_FIRST(BOOT_KEY_DOWN)) {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue