mirror of
https://github.com/opentx/opentx.git
synced 2025-07-22 15:55:26 +03:00
Constant MENU_TITLE_HEIGHT renamed to MENU_HEADER_HEIGHT
This commit is contained in:
parent
8c95e02ceb
commit
ae16191e76
43 changed files with 86 additions and 99 deletions
|
@ -37,9 +37,8 @@
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
#include "menus.h"
|
#include "menus.h"
|
||||||
|
|
||||||
#define NUM_BODY_LINES LCD_LINES-1
|
#define NUM_BODY_LINES (LCD_LINES-1)
|
||||||
#define MENU_TITLE_HEIGHT FH
|
#define MENU_HEADER_HEIGHT FH
|
||||||
#define MENU_NAVIG_HEIGHT 0
|
|
||||||
|
|
||||||
void displaySplash();
|
void displaySplash();
|
||||||
void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr);
|
void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr);
|
||||||
|
|
|
@ -59,9 +59,6 @@
|
||||||
#define FWNUM 5
|
#define FWNUM 5
|
||||||
#define FH 8
|
#define FH 8
|
||||||
|
|
||||||
#define MENU_TITLE_HEIGHT FH
|
|
||||||
#define MENU_NAVIG_HEIGHT 0
|
|
||||||
|
|
||||||
#define LCD_LINES (LCD_H/FH)
|
#define LCD_LINES (LCD_H/FH)
|
||||||
#define LCD_COLS (LCD_W/FW)
|
#define LCD_COLS (LCD_W/FW)
|
||||||
|
|
||||||
|
@ -283,7 +280,4 @@ char *strSetCursor(char *dest, int position);
|
||||||
char *strAppendDate(char * str, bool time=false);
|
char *strAppendDate(char * str, bool time=false);
|
||||||
char *strAppendFilename(char * dest, const char * filename, const int size);
|
char *strAppendFilename(char * dest, const char * filename, const int size);
|
||||||
|
|
||||||
#define MENU_TITLE_HEIGHT FH
|
|
||||||
#define MENU_NAVIG_HEIGHT 0
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -69,14 +69,14 @@ void menuCommonCalib(uint8_t event)
|
||||||
case 0:
|
case 0:
|
||||||
// START CALIBRATION
|
// START CALIBRATION
|
||||||
if (!READ_ONLY()) {
|
if (!READ_ONLY()) {
|
||||||
lcd_putsLeft(MENU_TITLE_HEIGHT+2*FH, STR_MENUTOSTART);
|
lcd_putsLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUTOSTART);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
// SET MIDPOINT
|
// SET MIDPOINT
|
||||||
lcd_putsAtt(0*FW, MENU_TITLE_HEIGHT+FH, STR_SETMIDPOINT, INVERS);
|
lcd_putsAtt(0*FW, MENU_HEADER_HEIGHT+FH, STR_SETMIDPOINT, INVERS);
|
||||||
lcd_putsLeft(MENU_TITLE_HEIGHT+2*FH, STR_MENUWHENDONE);
|
lcd_putsLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUWHENDONE);
|
||||||
|
|
||||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
||||||
reusableBuffer.calib.loVals[i] = 15000;
|
reusableBuffer.calib.loVals[i] = 15000;
|
||||||
|
@ -88,8 +88,8 @@ void menuCommonCalib(uint8_t event)
|
||||||
case 2:
|
case 2:
|
||||||
// MOVE STICKS/POTS
|
// MOVE STICKS/POTS
|
||||||
STICK_SCROLL_DISABLE();
|
STICK_SCROLL_DISABLE();
|
||||||
lcd_putsAtt(0*FW, MENU_TITLE_HEIGHT+FH, STR_MOVESTICKSPOTS, INVERS);
|
lcd_putsAtt(0*FW, MENU_HEADER_HEIGHT+FH, STR_MOVESTICKSPOTS, INVERS);
|
||||||
lcd_putsLeft(MENU_TITLE_HEIGHT+2*FH, STR_MENUWHENDONE);
|
lcd_putsLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUWHENDONE);
|
||||||
|
|
||||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
||||||
if (abs(reusableBuffer.calib.loVals[i]-reusableBuffer.calib.hiVals[i]) > 50) {
|
if (abs(reusableBuffer.calib.loVals[i]-reusableBuffer.calib.hiVals[i]) > 50) {
|
||||||
|
|
|
@ -52,13 +52,13 @@ void menuGeneralDiagAna(uint8_t event)
|
||||||
|
|
||||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
||||||
#if (NUM_STICKS+NUM_POTS) > 9
|
#if (NUM_STICKS+NUM_POTS) > 9
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + (i/3)*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + (i/3)*FH;
|
||||||
const uint8_t x_coord[] = {0, 70, 154};
|
const uint8_t x_coord[] = {0, 70, 154};
|
||||||
uint8_t x = x_coord[i%3];
|
uint8_t x = x_coord[i%3];
|
||||||
lcd_outdezNAtt(x, y, i+1, LEADING0|LEFT, 2);
|
lcd_outdezNAtt(x, y, i+1, LEADING0|LEFT, 2);
|
||||||
lcd_putc(x+2*FW-2, y, ':');
|
lcd_putc(x+2*FW-2, y, ':');
|
||||||
#else
|
#else
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + (i/2)*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + (i/2)*FH;
|
||||||
uint8_t x = i&1 ? 64+5 : 0;
|
uint8_t x = i&1 ? 64+5 : 0;
|
||||||
putsStrIdx(x, y, PSTR("A"), i+1);
|
putsStrIdx(x, y, PSTR("A"), i+1);
|
||||||
lcd_putc(lcdNextPos, y, ':');
|
lcd_putc(lcdNextPos, y, ':');
|
||||||
|
@ -69,17 +69,17 @@ void menuGeneralDiagAna(uint8_t event)
|
||||||
|
|
||||||
#if !defined(CPUARM)
|
#if !defined(CPUARM)
|
||||||
// Display raw BandGap result (debug)
|
// Display raw BandGap result (debug)
|
||||||
lcd_puts(64+5, MENU_TITLE_HEIGHT+1+3*FH, STR_BG);
|
lcd_puts(64+5, MENU_HEADER_HEIGHT+1+3*FH, STR_BG);
|
||||||
lcd_outdezAtt(64+5+6*FW-3, 1+4*FH, BandGap, 0);
|
lcd_outdezAtt(64+5+6*FW-3, 1+4*FH, BandGap, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBSKY9X)
|
#if defined(PCBSKY9X)
|
||||||
lcd_putsLeft(MENU_TITLE_HEIGHT+1+4*FH, STR_BATT_CALIB);
|
lcd_putsLeft(MENU_HEADER_HEIGHT+1+4*FH, STR_BATT_CALIB);
|
||||||
static int32_t adcBatt;
|
static int32_t adcBatt;
|
||||||
adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8;
|
adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8;
|
||||||
uint32_t batCalV = (adcBatt + adcBatt*(g_eeGeneral.vBatCalib)/128) * 4191;
|
uint32_t batCalV = (adcBatt + adcBatt*(g_eeGeneral.vBatCalib)/128) * 4191;
|
||||||
batCalV /= 55296;
|
batCalV /= 55296;
|
||||||
putsVolts(LEN_CALIB_FIELDS*FW+4*FW, MENU_TITLE_HEIGHT+1+4*FH, batCalV, (m_posVert==1 ? INVERS : 0));
|
putsVolts(LEN_CALIB_FIELDS*FW+4*FW, MENU_HEADER_HEIGHT+1+4*FH, batCalV, (m_posVert==1 ? INVERS : 0));
|
||||||
#elif defined(PCBGRUVIN9X)
|
#elif defined(PCBGRUVIN9X)
|
||||||
lcd_putsLeft(6*FH-2, STR_BATT_CALIB);
|
lcd_putsLeft(6*FH-2, STR_BATT_CALIB);
|
||||||
// Gruvin wants 2 decimal places and instant update of volts calib field when button pressed
|
// Gruvin wants 2 decimal places and instant update of volts calib field when button pressed
|
||||||
|
|
|
@ -46,25 +46,25 @@ void menuGeneralDiagKeys(uint8_t event)
|
||||||
{
|
{
|
||||||
SIMPLE_MENU(STR_MENUDIAG, menuTabGeneral, e_Keys, 1);
|
SIMPLE_MENU(STR_MENUDIAG, menuTabGeneral, e_Keys, 1);
|
||||||
|
|
||||||
lcd_puts(14*FW, MENU_TITLE_HEIGHT+2*FH, STR_VTRIM);
|
lcd_puts(14*FW, MENU_HEADER_HEIGHT+2*FH, STR_VTRIM);
|
||||||
|
|
||||||
for(uint8_t i=0; i<9; i++) {
|
for(uint8_t i=0; i<9; i++) {
|
||||||
coord_t y;
|
coord_t y;
|
||||||
|
|
||||||
if (i<8) {
|
if (i<8) {
|
||||||
y = MENU_TITLE_HEIGHT + FH*3 + FH*(i/2);
|
y = MENU_HEADER_HEIGHT + FH*3 + FH*(i/2);
|
||||||
if (i&1) lcd_img(14*FW, y, sticks, i/2, 0);
|
if (i&1) lcd_img(14*FW, y, sticks, i/2, 0);
|
||||||
displayKeyState(i&1? 20*FW : 18*FW, y, (EnumKeys)(TRM_BASE+i));
|
displayKeyState(i&1? 20*FW : 18*FW, y, (EnumKeys)(TRM_BASE+i));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i<6) {
|
if (i<6) {
|
||||||
y = i*FH+MENU_TITLE_HEIGHT+FH;
|
y = i*FH+MENU_HEADER_HEIGHT+FH;
|
||||||
lcd_putsiAtt(0, y, STR_VKEYS, (5-i), 0);
|
lcd_putsiAtt(0, y, STR_VKEYS, (5-i), 0);
|
||||||
displayKeyState(5*FW+2, y, (EnumKeys)(KEY_MENU+(5-i)));
|
displayKeyState(5*FW+2, y, (EnumKeys)(KEY_MENU+(5-i)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i != SW_ID0-SW_BASE) {
|
if (i != SW_ID0-SW_BASE) {
|
||||||
y = MENU_TITLE_HEIGHT+i*FH-2*FH;
|
y = MENU_HEADER_HEIGHT+i*FH-2*FH;
|
||||||
putsSwitches(8*FW, y, i+1, 0); //ohne off,on
|
putsSwitches(8*FW, y, i+1, 0); //ohne off,on
|
||||||
displayKeyState(11*FW+2, y, (EnumKeys)(SW_BASE+i));
|
displayKeyState(11*FW+2, y, (EnumKeys)(SW_BASE+i));
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ void menuGeneralDiagKeys(uint8_t event)
|
||||||
|
|
||||||
#if defined(ROTARY_ENCODERS) || defined(ROTARY_ENCODER_NAVIGATION)
|
#if defined(ROTARY_ENCODERS) || defined(ROTARY_ENCODER_NAVIGATION)
|
||||||
for(uint8_t i=0; i<DIM(g_rotenc); i++) {
|
for(uint8_t i=0; i<DIM(g_rotenc); i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT /* ??? + 1 ??? */ + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT /* ??? + 1 ??? */ + i*FH;
|
||||||
lcd_putsiAtt(14*FW, y, STR_VRENCODERS, i, 0);
|
lcd_putsiAtt(14*FW, y, STR_VRENCODERS, i, 0);
|
||||||
lcd_outdezNAtt(18*FW, y, g_rotenc[i], LEFT|(switchState((EnumKeys)(BTN_REa+i)) ? INVERS : 0));
|
lcd_outdezNAtt(18*FW, y, g_rotenc[i], LEFT|(switchState((EnumKeys)(BTN_REa+i)) ? INVERS : 0));
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ void menuGeneralHardware(uint8_t event)
|
||||||
uint8_t sub = m_posVert - 1;
|
uint8_t sub = m_posVert - 1;
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i+s_pgOfs;
|
uint8_t k = i+s_pgOfs;
|
||||||
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
||||||
uint8_t attr = (sub == k ? blink : 0);
|
uint8_t attr = (sub == k ? blink : 0);
|
||||||
|
|
|
@ -281,7 +281,7 @@ void menuGeneralSdManager(uint8_t _event)
|
||||||
reusableBuffer.sdmanager.offset = s_pgOfs;
|
reusableBuffer.sdmanager.offset = s_pgOfs;
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
lcdNextPos = 0;
|
lcdNextPos = 0;
|
||||||
uint8_t attr = (m_posVert-1-s_pgOfs == i ? BSS|INVERS : BSS);
|
uint8_t attr = (m_posVert-1-s_pgOfs == i ? BSS|INVERS : BSS);
|
||||||
if (reusableBuffer.sdmanager.lines[i][0]) {
|
if (reusableBuffer.sdmanager.lines[i][0]) {
|
||||||
|
|
|
@ -152,7 +152,7 @@ void menuGeneralSetup(uint8_t event)
|
||||||
uint8_t sub = m_posVert - 1;
|
uint8_t sub = m_posVert - 1;
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i+s_pgOfs;
|
uint8_t k = i+s_pgOfs;
|
||||||
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
||||||
uint8_t attr = (sub == k ? blink : 0);
|
uint8_t attr = (sub == k ? blink : 0);
|
||||||
|
|
|
@ -52,9 +52,9 @@ void menuGeneralTrainer(uint8_t event)
|
||||||
uint8_t attr;
|
uint8_t attr;
|
||||||
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
||||||
|
|
||||||
lcd_puts(3*FW, MENU_TITLE_HEIGHT+1, STR_MODESRC);
|
lcd_puts(3*FW, MENU_HEADER_HEIGHT+1, STR_MODESRC);
|
||||||
|
|
||||||
y = MENU_TITLE_HEIGHT + 1 + FH;
|
y = MENU_HEADER_HEIGHT + 1 + FH;
|
||||||
|
|
||||||
for (uint8_t i=1; i<=NUM_STICKS; i++) {
|
for (uint8_t i=1; i<=NUM_STICKS; i++) {
|
||||||
uint8_t chan = channel_order(i);
|
uint8_t chan = channel_order(i);
|
||||||
|
@ -87,19 +87,19 @@ void menuGeneralTrainer(uint8_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
attr = (m_posVert==5) ? blink : 0;
|
attr = (m_posVert==5) ? blink : 0;
|
||||||
lcd_putsLeft(MENU_TITLE_HEIGHT+1+5*FH, STR_MULTIPLIER);
|
lcd_putsLeft(MENU_HEADER_HEIGHT+1+5*FH, STR_MULTIPLIER);
|
||||||
lcd_outdezAtt(LEN_MULTIPLIER*FW+3*FW, MENU_TITLE_HEIGHT+1+5*FH, g_eeGeneral.PPM_Multiplier+10, attr|PREC1);
|
lcd_outdezAtt(LEN_MULTIPLIER*FW+3*FW, MENU_HEADER_HEIGHT+1+5*FH, g_eeGeneral.PPM_Multiplier+10, attr|PREC1);
|
||||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.PPM_Multiplier, -10, 40);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.PPM_Multiplier, -10, 40);
|
||||||
|
|
||||||
attr = (m_posVert==6) ? INVERS : 0;
|
attr = (m_posVert==6) ? INVERS : 0;
|
||||||
if (attr) s_editMode = 0;
|
if (attr) s_editMode = 0;
|
||||||
lcd_putsAtt(0*FW, MENU_TITLE_HEIGHT+1+6*FH, STR_CAL, attr);
|
lcd_putsAtt(0*FW, MENU_HEADER_HEIGHT+1+6*FH, STR_CAL, attr);
|
||||||
for (uint8_t i=0; i<4; i++) {
|
for (uint8_t i=0; i<4; i++) {
|
||||||
uint8_t x = (i*TRAINER_CALIB_POS+16)*FW/2;
|
uint8_t x = (i*TRAINER_CALIB_POS+16)*FW/2;
|
||||||
#if defined (PPM_UNIT_PERCENT_PREC1)
|
#if defined (PPM_UNIT_PERCENT_PREC1)
|
||||||
lcd_outdezAtt(x, MENU_TITLE_HEIGHT+1+6*FH, (g_ppmIns[i]-g_eeGeneral.trainer.calib[i])*2, PREC1);
|
lcd_outdezAtt(x, MENU_HEADER_HEIGHT+1+6*FH, (g_ppmIns[i]-g_eeGeneral.trainer.calib[i])*2, PREC1);
|
||||||
#else
|
#else
|
||||||
lcd_outdezAtt(x, MENU_TITLE_HEIGHT+1+6*FH, (g_ppmIns[i]-g_eeGeneral.trainer.calib[i])/5, 0);
|
lcd_outdezAtt(x, MENU_HEADER_HEIGHT+1+6*FH, (g_ppmIns[i]-g_eeGeneral.trainer.calib[i])/5, 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ void menuGeneralVersion(uint8_t event)
|
||||||
{
|
{
|
||||||
SIMPLE_MENU(STR_MENUVERSION, menuTabGeneral, e_Vers, 1);
|
SIMPLE_MENU(STR_MENUVERSION, menuTabGeneral, e_Vers, 1);
|
||||||
|
|
||||||
lcd_putsLeft(MENU_TITLE_HEIGHT+FH, vers_stamp);
|
lcd_putsLeft(MENU_HEADER_HEIGHT+FH, vers_stamp);
|
||||||
|
|
||||||
#if defined(COPROCESSOR)
|
#if defined(COPROCESSOR)
|
||||||
if (Coproc_valid == 1) {
|
if (Coproc_valid == 1) {
|
||||||
|
|
|
@ -248,7 +248,7 @@ void menuModelCurvesAll(uint8_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i + s_pgOfs;
|
uint8_t k = i + s_pgOfs;
|
||||||
uint8_t attr = (sub == k ? INVERS : 0);
|
uint8_t attr = (sub == k ? INVERS : 0);
|
||||||
#if defined(GVARS) && defined(PCBSTD)
|
#if defined(GVARS) && defined(PCBSTD)
|
||||||
|
|
|
@ -85,7 +85,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i+s_pgOfs;
|
uint8_t k = i+s_pgOfs;
|
||||||
|
|
||||||
CustomFunctionData *cfn = &functions[k];
|
CustomFunctionData *cfn = &functions[k];
|
||||||
|
|
|
@ -97,7 +97,7 @@ void menuModelPhaseOne(uint8_t event)
|
||||||
if (s_currIdx == 0 && sub>=ITEM_MODEL_PHASE_SWITCH) sub += ITEM_MODEL_PHASE_FADE_IN-ITEM_MODEL_PHASE_SWITCH;
|
if (s_currIdx == 0 && sub>=ITEM_MODEL_PHASE_SWITCH) sub += ITEM_MODEL_PHASE_FADE_IN-ITEM_MODEL_PHASE_SWITCH;
|
||||||
|
|
||||||
for (uint8_t k=0; k<LCD_LINES-1; k++) {
|
for (uint8_t k=0; k<LCD_LINES-1; k++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + k*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + k*FH;
|
||||||
int8_t i = k + s_pgOfs;
|
int8_t i = k + s_pgOfs;
|
||||||
if (s_currIdx == 0 && i>=ITEM_MODEL_PHASE_SWITCH) i += ITEM_MODEL_PHASE_FADE_IN-ITEM_MODEL_PHASE_SWITCH;
|
if (s_currIdx == 0 && i>=ITEM_MODEL_PHASE_SWITCH) i += ITEM_MODEL_PHASE_FADE_IN-ITEM_MODEL_PHASE_SWITCH;
|
||||||
uint8_t attr = (sub==i ? (editMode>0 ? BLINK|INVERS : INVERS) : 0);
|
uint8_t attr = (sub==i ? (editMode>0 ? BLINK|INVERS : INVERS) : 0);
|
||||||
|
@ -244,10 +244,10 @@ void menuModelFlightModesAll(uint8_t event)
|
||||||
uint8_t att;
|
uint8_t att;
|
||||||
for (uint8_t i=0; i<MAX_FLIGHT_MODES; i++) {
|
for (uint8_t i=0; i<MAX_FLIGHT_MODES; i++) {
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + (i-s_pgOfs)*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + (i-s_pgOfs)*FH;
|
||||||
if (y<MENU_TITLE_HEIGHT+1 || y>(LCD_LINES-1)*FH+MENU_TITLE_HEIGHT-FH) continue;
|
if (y<MENU_HEADER_HEIGHT+1 || y>(LCD_LINES-1)*FH+MENU_HEADER_HEIGHT-FH) continue;
|
||||||
#else
|
#else
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
#endif
|
#endif
|
||||||
att = (i==sub ? INVERS : 0);
|
att = (i==sub ? INVERS : 0);
|
||||||
FlightModeData *p = flightModeAddress(i);
|
FlightModeData *p = flightModeAddress(i);
|
||||||
|
|
|
@ -53,7 +53,7 @@ void menuModelHeli(uint8_t event)
|
||||||
uint8_t sub = m_posVert - 1;
|
uint8_t sub = m_posVert - 1;
|
||||||
|
|
||||||
for (uint8_t i=0; i<6; i++) {
|
for (uint8_t i=0; i<6; i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
uint8_t attr = (sub == i ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
uint8_t attr = (sub == i ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
||||||
switch(i) {
|
switch(i) {
|
||||||
case ITEM_HELI_SWASHTYPE:
|
case ITEM_HELI_SWASHTYPE:
|
||||||
|
|
|
@ -303,7 +303,7 @@ void menuModelExpoOne(uint8_t event)
|
||||||
|
|
||||||
int8_t sub = m_posVert;
|
int8_t sub = m_posVert;
|
||||||
|
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1;
|
coord_t y = MENU_HEADER_HEIGHT + 1;
|
||||||
|
|
||||||
for (uint8_t i=0; i<EXPO_FIELD_MAX+1; i++) {
|
for (uint8_t i=0; i<EXPO_FIELD_MAX+1; i++) {
|
||||||
uint8_t attr = (sub==i ? (s_editMode>0 ? BLINK|INVERS : INVERS) : 0);
|
uint8_t attr = (sub==i ? (s_editMode>0 ? BLINK|INVERS : INVERS) : 0);
|
||||||
|
@ -503,7 +503,7 @@ void menuModelMixOne(uint8_t event)
|
||||||
}
|
}
|
||||||
int8_t i = k;
|
int8_t i = k;
|
||||||
#else
|
#else
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + k*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + k*FH;
|
||||||
int8_t i = k + s_pgOfs;
|
int8_t i = k + s_pgOfs;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -906,7 +906,7 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
||||||
|
|
||||||
for (uint8_t ch=1; ch<=(expo ? NUM_INPUTS : NUM_CHNOUT); ch++) {
|
for (uint8_t ch=1; ch<=(expo ? NUM_INPUTS : NUM_CHNOUT); ch++) {
|
||||||
void *pointer = NULL; MixData * &md = (MixData * &)pointer; ExpoData * &ed = (ExpoData * &)pointer;
|
void *pointer = NULL; MixData * &md = (MixData * &)pointer; ExpoData * &ed = (ExpoData * &)pointer;
|
||||||
coord_t y = MENU_TITLE_HEIGHT-FH+1+(cur-s_pgOfs)*FH;
|
coord_t y = MENU_HEADER_HEIGHT-FH+1+(cur-s_pgOfs)*FH;
|
||||||
if (expo ? (i<MAX_EXPOS && (ed=expoAddress(i))->chn+1 == ch && EXPO_VALID(ed)) : (i<MAX_MIXERS && (md=mixAddress(i))->srcRaw && md->destCh+1 == ch)) {
|
if (expo ? (i<MAX_EXPOS && (ed=expoAddress(i))->chn+1 == ch && EXPO_VALID(ed)) : (i<MAX_MIXERS && (md=mixAddress(i))->srcRaw && md->destCh+1 == ch)) {
|
||||||
if (s_pgOfs < cur && cur-s_pgOfs < LCD_LINES) {
|
if (s_pgOfs < cur && cur-s_pgOfs < LCD_LINES) {
|
||||||
if (expo) {
|
if (expo) {
|
||||||
|
|
|
@ -129,7 +129,7 @@ void menuModelLimits(uint8_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i+s_pgOfs;
|
uint8_t k = i+s_pgOfs;
|
||||||
|
|
||||||
if (k==NUM_CHNOUT) {
|
if (k==NUM_CHNOUT) {
|
||||||
|
|
|
@ -107,7 +107,7 @@ void menuModelLogicalSwitchOne(uint8_t event)
|
||||||
int v1_val = cs->v1;
|
int v1_val = cs->v1;
|
||||||
|
|
||||||
for (uint8_t k=0; k<LCD_LINES-1; k++) {
|
for (uint8_t k=0; k<LCD_LINES-1; k++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + k*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + k*FH;
|
||||||
uint8_t i = k + s_pgOfs;
|
uint8_t i = k + s_pgOfs;
|
||||||
uint8_t attr = (sub==i ? (s_editMode>0 ? BLINK|INVERS : INVERS) : 0);
|
uint8_t attr = (sub==i ? (s_editMode>0 ? BLINK|INVERS : INVERS) : 0);
|
||||||
uint8_t cstate = lswFamily(cs->func);
|
uint8_t cstate = lswFamily(cs->func);
|
||||||
|
@ -319,7 +319,7 @@ void menuModelLogicalSwitches(uint8_t event)
|
||||||
horzpos_t horz = m_posHorz;
|
horzpos_t horz = m_posHorz;
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
k = i+s_pgOfs;
|
k = i+s_pgOfs;
|
||||||
uint8_t attr = (sub==k ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
uint8_t attr = (sub==k ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
||||||
uint8_t attr1 = (horz==1 ? attr : 0);
|
uint8_t attr1 = (horz==1 ? attr : 0);
|
||||||
|
|
|
@ -316,7 +316,7 @@ void menuModelSelect(uint8_t event)
|
||||||
TITLE(STR_MENUMODELSEL);
|
TITLE(STR_MENUMODELSEL);
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i+s_pgOfs;
|
uint8_t k = i+s_pgOfs;
|
||||||
|
|
||||||
lcd_outdezNAtt(3*FW+2, y, k+1, LEADING0+((!s_copyMode && sub==k) ? INVERS : 0), 2);
|
lcd_outdezNAtt(3*FW+2, y, k+1, LEADING0+((!s_copyMode && sub==k) ? INVERS : 0), 2);
|
||||||
|
|
|
@ -155,7 +155,7 @@ void menuModelSetup(uint8_t event)
|
||||||
int8_t editMode = s_editMode;
|
int8_t editMode = s_editMode;
|
||||||
|
|
||||||
for (uint8_t i=0; i<NUM_BODY_LINES; ++i) {
|
for (uint8_t i=0; i<NUM_BODY_LINES; ++i) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i+s_pgOfs;
|
uint8_t k = i+s_pgOfs;
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
for (int j=0; j<=k; j++) {
|
for (int j=0; j<=k; j++) {
|
||||||
|
|
|
@ -262,7 +262,7 @@ void menuModelSensor(uint8_t event)
|
||||||
int8_t sub = m_posVert;
|
int8_t sub = m_posVert;
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i + s_pgOfs;
|
uint8_t k = i + s_pgOfs;
|
||||||
|
|
||||||
for (int j=0; j<k; j++) {
|
for (int j=0; j<k; j++) {
|
||||||
|
@ -476,7 +476,7 @@ void menuModelTelemetry(uint8_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i + s_pgOfs;
|
uint8_t k = i + s_pgOfs;
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
for (int j=0; j<=k; j++) {
|
for (int j=0; j<=k; j++) {
|
||||||
|
|
|
@ -54,7 +54,7 @@ void menuModelTemplates(uint8_t event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1;
|
coord_t y = MENU_HEADER_HEIGHT + 1;
|
||||||
uint8_t k = 0;
|
uint8_t k = 0;
|
||||||
for (uint8_t i=0; i<LCD_LINES-1 && k<TMPL_COUNT; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1 && k<TMPL_COUNT; i++) {
|
||||||
k = i+s_pgOfs;
|
k = i+s_pgOfs;
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
#define DEFAULT_SCROLLBAR_X (LCD_W-1)
|
#define DEFAULT_SCROLLBAR_X (LCD_W-1)
|
||||||
#define NUM_BODY_LINES (LCD_LINES-1)
|
#define NUM_BODY_LINES (LCD_LINES-1)
|
||||||
#define MENU_HEADER_HEIGHT FH
|
#define MENU_HEADER_HEIGHT FH
|
||||||
|
|
||||||
struct MenuItem {
|
struct MenuItem {
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
|
@ -54,9 +54,6 @@
|
||||||
#define FWNUM 5
|
#define FWNUM 5
|
||||||
#define FH 8
|
#define FH 8
|
||||||
|
|
||||||
#define MENU_TITLE_HEIGHT FH
|
|
||||||
#define MENU_NAVIG_HEIGHT 0
|
|
||||||
|
|
||||||
#define LCD_LINES (LCD_H/FH)
|
#define LCD_LINES (LCD_H/FH)
|
||||||
#define LCD_COLS (LCD_W/FW)
|
#define LCD_COLS (LCD_W/FW)
|
||||||
|
|
||||||
|
@ -259,7 +256,4 @@ char *strSetCursor(char *dest, int position);
|
||||||
char *strAppendDate(char * str, bool time=false);
|
char *strAppendDate(char * str, bool time=false);
|
||||||
char *strAppendFilename(char * dest, const char * filename, const int size);
|
char *strAppendFilename(char * dest, const char * filename, const int size);
|
||||||
|
|
||||||
#define MENU_TITLE_HEIGHT FH
|
|
||||||
#define MENU_NAVIG_HEIGHT 0
|
|
||||||
|
|
||||||
#endif // _LCD_H_
|
#endif // _LCD_H_
|
||||||
|
|
|
@ -97,14 +97,14 @@ void menuCommonCalib(uint8_t event)
|
||||||
case 0:
|
case 0:
|
||||||
// START CALIBRATION
|
// START CALIBRATION
|
||||||
if (!READ_ONLY()) {
|
if (!READ_ONLY()) {
|
||||||
lcd_putsLeft(MENU_TITLE_HEIGHT+2*FH, STR_MENUTOSTART);
|
lcd_putsLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUTOSTART);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
// SET MIDPOINT
|
// SET MIDPOINT
|
||||||
lcd_putsAtt(0*FW, MENU_TITLE_HEIGHT+FH, STR_SETMIDPOINT, INVERS);
|
lcd_putsAtt(0*FW, MENU_HEADER_HEIGHT+FH, STR_SETMIDPOINT, INVERS);
|
||||||
lcd_putsLeft(MENU_TITLE_HEIGHT+2*FH, STR_MENUWHENDONE);
|
lcd_putsLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUWHENDONE);
|
||||||
|
|
||||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
||||||
reusableBuffer.calib.loVals[i] = 15000;
|
reusableBuffer.calib.loVals[i] = 15000;
|
||||||
|
@ -120,8 +120,8 @@ void menuCommonCalib(uint8_t event)
|
||||||
case 2:
|
case 2:
|
||||||
// MOVE STICKS/POTS
|
// MOVE STICKS/POTS
|
||||||
STICK_SCROLL_DISABLE();
|
STICK_SCROLL_DISABLE();
|
||||||
lcd_putsAtt(0*FW, MENU_TITLE_HEIGHT+FH, STR_MOVESTICKSPOTS, INVERS);
|
lcd_putsAtt(0*FW, MENU_HEADER_HEIGHT+FH, STR_MOVESTICKSPOTS, INVERS);
|
||||||
lcd_putsLeft(MENU_TITLE_HEIGHT+2*FH, STR_MENUWHENDONE);
|
lcd_putsLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUWHENDONE);
|
||||||
|
|
||||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
||||||
if (abs(reusableBuffer.calib.loVals[i]-reusableBuffer.calib.hiVals[i]) > 50) {
|
if (abs(reusableBuffer.calib.loVals[i]-reusableBuffer.calib.hiVals[i]) > 50) {
|
||||||
|
|
|
@ -44,13 +44,13 @@ void menuGeneralDiagAna(uint8_t event)
|
||||||
|
|
||||||
for (int i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
for (int i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
||||||
#if (NUM_STICKS+NUM_POTS) > 9
|
#if (NUM_STICKS+NUM_POTS) > 9
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + (i/3)*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + (i/3)*FH;
|
||||||
const uint8_t x_coord[] = {0, 70, 154};
|
const uint8_t x_coord[] = {0, 70, 154};
|
||||||
uint8_t x = x_coord[i%3];
|
uint8_t x = x_coord[i%3];
|
||||||
lcd_outdezNAtt(x, y, i+1, LEADING0|LEFT, 2);
|
lcd_outdezNAtt(x, y, i+1, LEADING0|LEFT, 2);
|
||||||
lcd_putc(x+2*FW-2, y, ':');
|
lcd_putc(x+2*FW-2, y, ':');
|
||||||
#else
|
#else
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + (i/2)*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + (i/2)*FH;
|
||||||
uint8_t x = i&1 ? 64+5 : 0;
|
uint8_t x = i&1 ? 64+5 : 0;
|
||||||
putsStrIdx(x, y, PSTR("A"), i+1);
|
putsStrIdx(x, y, PSTR("A"), i+1);
|
||||||
lcd_putc(lcdNextPos, y, ':');
|
lcd_putc(lcdNextPos, y, ':');
|
||||||
|
@ -59,12 +59,12 @@ void menuGeneralDiagAna(uint8_t event)
|
||||||
lcd_outdez8(x+10*FW-1, y, (int16_t)calibratedStick[CONVERT_MODE(i)]*25/256);
|
lcd_outdez8(x+10*FW-1, y, (int16_t)calibratedStick[CONVERT_MODE(i)]*25/256);
|
||||||
}
|
}
|
||||||
|
|
||||||
lcd_putsLeft(MENU_TITLE_HEIGHT+1+5*FH, STR_BATT_CALIB);
|
lcd_putsLeft(MENU_HEADER_HEIGHT+1+5*FH, STR_BATT_CALIB);
|
||||||
static int32_t adcBatt;
|
static int32_t adcBatt;
|
||||||
adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8;
|
adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8;
|
||||||
uint32_t batCalV = (adcBatt + (adcBatt*g_eeGeneral.vBatCalib)/128) * BATT_SCALE;
|
uint32_t batCalV = (adcBatt + (adcBatt*g_eeGeneral.vBatCalib)/128) * BATT_SCALE;
|
||||||
batCalV >>= 11;
|
batCalV >>= 11;
|
||||||
batCalV += 2; // because of the diode
|
batCalV += 2; // because of the diode
|
||||||
putsVolts(LEN_CALIB_FIELDS*FW+4*FW, MENU_TITLE_HEIGHT+1+5*FH, batCalV, s_editMode > 0 ? BLINK|INVERS : INVERS);
|
putsVolts(LEN_CALIB_FIELDS*FW+4*FW, MENU_HEADER_HEIGHT+1+5*FH, batCalV, s_editMode > 0 ? BLINK|INVERS : INVERS);
|
||||||
if (s_editMode > 0) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatCalib, -127, 127);
|
if (s_editMode > 0) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatCalib, -127, 127);
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,19 +46,19 @@ void menuGeneralDiagKeys(uint8_t event)
|
||||||
{
|
{
|
||||||
SIMPLE_MENU(STR_MENUDIAG, menuTabGeneral, e_Keys, 1);
|
SIMPLE_MENU(STR_MENUDIAG, menuTabGeneral, e_Keys, 1);
|
||||||
|
|
||||||
lcd_puts(14*FW, MENU_TITLE_HEIGHT+2*FH, STR_VTRIM);
|
lcd_puts(14*FW, MENU_HEADER_HEIGHT+2*FH, STR_VTRIM);
|
||||||
|
|
||||||
for(uint8_t i=0; i<9; i++) {
|
for(uint8_t i=0; i<9; i++) {
|
||||||
coord_t y;
|
coord_t y;
|
||||||
|
|
||||||
if (i<8) {
|
if (i<8) {
|
||||||
y = MENU_TITLE_HEIGHT + FH*3 + FH*(i/2);
|
y = MENU_HEADER_HEIGHT + FH*3 + FH*(i/2);
|
||||||
if (i&1) lcd_img(14*FW, y, sticks, i/2, 0);
|
if (i&1) lcd_img(14*FW, y, sticks, i/2, 0);
|
||||||
displayKeyState(i&1? 20*FW : 18*FW, y, (EnumKeys)(TRM_BASE+i));
|
displayKeyState(i&1? 20*FW : 18*FW, y, (EnumKeys)(TRM_BASE+i));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i<6) {
|
if (i<6) {
|
||||||
y = i*FH+MENU_TITLE_HEIGHT+FH;
|
y = i*FH+MENU_HEADER_HEIGHT+FH;
|
||||||
lcd_putsiAtt(0, y, STR_VKEYS, (5-i), 0);
|
lcd_putsiAtt(0, y, STR_VKEYS, (5-i), 0);
|
||||||
displayKeyState(5*FW+2, y, (EnumKeys)(KEY_MENU+(5-i)));
|
displayKeyState(5*FW+2, y, (EnumKeys)(KEY_MENU+(5-i)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,7 @@ void menuGeneralHardware(uint8_t event)
|
||||||
uint8_t sub = m_posVert;
|
uint8_t sub = m_posVert;
|
||||||
|
|
||||||
for (int i=0; i<NUM_BODY_LINES; ++i) {
|
for (int i=0; i<NUM_BODY_LINES; ++i) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
int k = i + s_pgOfs;
|
int k = i + s_pgOfs;
|
||||||
for (int j=0; j<=k; j++) {
|
for (int j=0; j<=k; j++) {
|
||||||
if (mstate_tab[j] == HIDDEN_ROW)
|
if (mstate_tab[j] == HIDDEN_ROW)
|
||||||
|
|
|
@ -391,7 +391,7 @@ void menuGeneralSdManager(uint8_t _event)
|
||||||
reusableBuffer.sdmanager.offset = s_pgOfs;
|
reusableBuffer.sdmanager.offset = s_pgOfs;
|
||||||
|
|
||||||
for (int i=0; i<NUM_BODY_LINES; i++) {
|
for (int i=0; i<NUM_BODY_LINES; i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
lcdNextPos = 0;
|
lcdNextPos = 0;
|
||||||
LcdFlags attr = (index == i ? BSS|INVERS : BSS);
|
LcdFlags attr = (index == i ? BSS|INVERS : BSS);
|
||||||
if (reusableBuffer.sdmanager.lines[i][0]) {
|
if (reusableBuffer.sdmanager.lines[i][0]) {
|
||||||
|
|
|
@ -131,7 +131,7 @@ void menuGeneralSetup(uint8_t event)
|
||||||
int sub = m_posVert;
|
int sub = m_posVert;
|
||||||
|
|
||||||
for (unsigned int i=0; i<NUM_BODY_LINES; i++) {
|
for (unsigned int i=0; i<NUM_BODY_LINES; i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i+s_pgOfs;
|
uint8_t k = i+s_pgOfs;
|
||||||
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
uint8_t blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
||||||
uint8_t attr = (sub == k ? blink : 0);
|
uint8_t attr = (sub == k ? blink : 0);
|
||||||
|
|
|
@ -53,9 +53,9 @@ void menuGeneralTrainer(uint8_t event)
|
||||||
LcdFlags attr;
|
LcdFlags attr;
|
||||||
LcdFlags blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
LcdFlags blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
||||||
|
|
||||||
lcd_puts(3*FW, MENU_TITLE_HEIGHT+1, STR_MODESRC);
|
lcd_puts(3*FW, MENU_HEADER_HEIGHT+1, STR_MODESRC);
|
||||||
|
|
||||||
y = MENU_TITLE_HEIGHT + 1 + FH;
|
y = MENU_HEADER_HEIGHT + 1 + FH;
|
||||||
int sub = m_posVert + 1;
|
int sub = m_posVert + 1;
|
||||||
|
|
||||||
for (int i=1; i<=NUM_STICKS; i++) {
|
for (int i=1; i<=NUM_STICKS; i++) {
|
||||||
|
@ -89,19 +89,19 @@ void menuGeneralTrainer(uint8_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
attr = (sub==5) ? blink : 0;
|
attr = (sub==5) ? blink : 0;
|
||||||
lcd_putsLeft(MENU_TITLE_HEIGHT+1+5*FH, STR_MULTIPLIER);
|
lcd_putsLeft(MENU_HEADER_HEIGHT+1+5*FH, STR_MULTIPLIER);
|
||||||
lcd_outdezAtt(LEN_MULTIPLIER*FW+3*FW, MENU_TITLE_HEIGHT+1+5*FH, g_eeGeneral.PPM_Multiplier+10, attr|PREC1);
|
lcd_outdezAtt(LEN_MULTIPLIER*FW+3*FW, MENU_HEADER_HEIGHT+1+5*FH, g_eeGeneral.PPM_Multiplier+10, attr|PREC1);
|
||||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.PPM_Multiplier, -10, 40);
|
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.PPM_Multiplier, -10, 40);
|
||||||
|
|
||||||
attr = (sub==6) ? INVERS : 0;
|
attr = (sub==6) ? INVERS : 0;
|
||||||
if (attr) s_editMode = 0;
|
if (attr) s_editMode = 0;
|
||||||
lcd_putsAtt(0*FW, MENU_TITLE_HEIGHT+1+6*FH, STR_CAL, attr);
|
lcd_putsAtt(0*FW, MENU_HEADER_HEIGHT+1+6*FH, STR_CAL, attr);
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
uint8_t x = (i*TRAINER_CALIB_POS+16)*FW/2;
|
uint8_t x = (i*TRAINER_CALIB_POS+16)*FW/2;
|
||||||
#if defined (PPM_UNIT_PERCENT_PREC1)
|
#if defined (PPM_UNIT_PERCENT_PREC1)
|
||||||
lcd_outdezAtt(x, MENU_TITLE_HEIGHT+1+6*FH, (g_ppmIns[i]-g_eeGeneral.trainer.calib[i])*2, PREC1);
|
lcd_outdezAtt(x, MENU_HEADER_HEIGHT+1+6*FH, (g_ppmIns[i]-g_eeGeneral.trainer.calib[i])*2, PREC1);
|
||||||
#else
|
#else
|
||||||
lcd_outdezAtt(x, MENU_TITLE_HEIGHT+1+6*FH, (g_ppmIns[i]-g_eeGeneral.trainer.calib[i])/5, 0);
|
lcd_outdezAtt(x, MENU_HEADER_HEIGHT+1+6*FH, (g_ppmIns[i]-g_eeGeneral.trainer.calib[i])/5, 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,9 +95,9 @@ void menuGeneralVersion(uint8_t event)
|
||||||
{
|
{
|
||||||
SIMPLE_MENU(STR_MENUVERSION, menuTabGeneral, e_Vers, 1);
|
SIMPLE_MENU(STR_MENUVERSION, menuTabGeneral, e_Vers, 1);
|
||||||
|
|
||||||
lcd_putsLeft(MENU_TITLE_HEIGHT+FH, vers_stamp);
|
lcd_putsLeft(MENU_HEADER_HEIGHT+FH, vers_stamp);
|
||||||
|
|
||||||
lcd_putsLeft(MENU_TITLE_HEIGHT+6*FH, STR_EEBACKUP);
|
lcd_putsLeft(MENU_HEADER_HEIGHT+6*FH, STR_EEBACKUP);
|
||||||
if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
||||||
backupEeprom();
|
backupEeprom();
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,7 +305,7 @@ void menuModelCurvesAll(uint8_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i<LCD_LINES-1; i++) {
|
for (int i=0; i<LCD_LINES-1; i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
int k = i + s_pgOfs;
|
int k = i + s_pgOfs;
|
||||||
LcdFlags attr = (sub == k ? INVERS : 0);
|
LcdFlags attr = (sub == k ? INVERS : 0);
|
||||||
{
|
{
|
||||||
|
|
|
@ -135,7 +135,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i<NUM_BODY_LINES; i++) {
|
for (int i=0; i<NUM_BODY_LINES; i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
int k = i+s_pgOfs;
|
int k = i+s_pgOfs;
|
||||||
|
|
||||||
putsStrIdx(0, y, functions == g_model.customFn ? STR_SF : STR_GF, k+1, (sub==k && m_posHorz<0) ? INVERS : 0);
|
putsStrIdx(0, y, functions == g_model.customFn ? STR_SF : STR_GF, k+1, (sub==k && m_posHorz<0) ? INVERS : 0);
|
||||||
|
|
|
@ -76,7 +76,7 @@ void menuModelCustomScriptOne(uint8_t event)
|
||||||
int8_t sub = m_posVert;
|
int8_t sub = m_posVert;
|
||||||
|
|
||||||
for (int k=0; k<LCD_LINES-1; k++) {
|
for (int k=0; k<LCD_LINES-1; k++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + k*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + k*FH;
|
||||||
int i = k + s_pgOfs;
|
int i = k + s_pgOfs;
|
||||||
LcdFlags attr = (sub==i ? (s_editMode>0 ? BLINK|INVERS : INVERS) : 0);
|
LcdFlags attr = (sub==i ? (s_editMode>0 ? BLINK|INVERS : INVERS) : 0);
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ void menuModelFlightModesAll(uint8_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i+s_pgOfs;
|
uint8_t k = i+s_pgOfs;
|
||||||
|
|
||||||
if (k==MAX_FLIGHT_MODES) {
|
if (k==MAX_FLIGHT_MODES) {
|
||||||
|
|
|
@ -79,7 +79,7 @@ void menuModelGVars(uint8_t event)
|
||||||
|
|
||||||
for (int l=0; l<LCD_LINES-1; l++) {
|
for (int l=0; l<LCD_LINES-1; l++) {
|
||||||
int i = l+s_pgOfs;
|
int i = l+s_pgOfs;
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + l*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + l*FH;
|
||||||
|
|
||||||
if (g_model.gvars[i].popup) lcd_putc(3*FW, y, '!');
|
if (g_model.gvars[i].popup) lcd_putc(3*FW, y, '!');
|
||||||
putsStrIdx(0, y, STR_GV, i+1, (sub==i && m_posHorz<0) ? INVERS : 0);
|
putsStrIdx(0, y, STR_GV, i+1, (sub==i && m_posHorz<0) ? INVERS : 0);
|
||||||
|
|
|
@ -318,7 +318,7 @@ void menuModelExpoOne(uint8_t event)
|
||||||
|
|
||||||
int8_t sub = m_posVert;
|
int8_t sub = m_posVert;
|
||||||
|
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1;
|
coord_t y = MENU_HEADER_HEIGHT + 1;
|
||||||
|
|
||||||
for (unsigned int k=0; k<NUM_BODY_LINES; k++) {
|
for (unsigned int k=0; k<NUM_BODY_LINES; k++) {
|
||||||
int i = k + s_pgOfs;
|
int i = k + s_pgOfs;
|
||||||
|
@ -834,7 +834,7 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
||||||
|
|
||||||
for (int ch=1; ch<=(expo ? NUM_INPUTS : NUM_CHNOUT); ch++) {
|
for (int ch=1; ch<=(expo ? NUM_INPUTS : NUM_CHNOUT); ch++) {
|
||||||
void *pointer = NULL; MixData * &md = (MixData * &)pointer; ExpoData * &ed = (ExpoData * &)pointer;
|
void *pointer = NULL; MixData * &md = (MixData * &)pointer; ExpoData * &ed = (ExpoData * &)pointer;
|
||||||
coord_t y = MENU_TITLE_HEIGHT+1+(cur-s_pgOfs)*FH;
|
coord_t y = MENU_HEADER_HEIGHT+1+(cur-s_pgOfs)*FH;
|
||||||
if (expo ? (i<MAX_EXPOS && (ed=expoAddress(i))->chn+1 == ch && EXPO_VALID(ed)) : (i<MAX_MIXERS && (md=mixAddress(i))->srcRaw && md->destCh+1 == ch)) {
|
if (expo ? (i<MAX_EXPOS && (ed=expoAddress(i))->chn+1 == ch && EXPO_VALID(ed)) : (i<MAX_MIXERS && (md=mixAddress(i))->srcRaw && md->destCh+1 == ch)) {
|
||||||
if (cur-s_pgOfs >= 0 && cur-s_pgOfs < NUM_BODY_LINES) {
|
if (cur-s_pgOfs >= 0 && cur-s_pgOfs < NUM_BODY_LINES) {
|
||||||
if (expo) {
|
if (expo) {
|
||||||
|
|
|
@ -140,7 +140,7 @@ void menuModelLimits(uint8_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i<NUM_BODY_LINES; i++) {
|
for (int i=0; i<NUM_BODY_LINES; i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i+s_pgOfs;
|
uint8_t k = i+s_pgOfs;
|
||||||
|
|
||||||
if (k==NUM_CHNOUT) {
|
if (k==NUM_CHNOUT) {
|
||||||
|
|
|
@ -119,7 +119,7 @@ void menuModelLogicalSwitches(uint8_t event)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i<NUM_BODY_LINES; ++i) {
|
for (int i=0; i<NUM_BODY_LINES; ++i) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
k = i+s_pgOfs;
|
k = i+s_pgOfs;
|
||||||
LcdFlags attr = (sub==k ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
LcdFlags attr = (sub==k ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
||||||
LcdFlags attr1 = (horz==1 ? attr : 0);
|
LcdFlags attr1 = (horz==1 ? attr : 0);
|
||||||
|
|
|
@ -244,7 +244,7 @@ void menuModelSelect(uint8_t event)
|
||||||
TITLE(STR_MENUMODELSEL);
|
TITLE(STR_MENUMODELSEL);
|
||||||
|
|
||||||
for (uint8_t i=0; i<NUM_BODY_LINES; i++) {
|
for (uint8_t i=0; i<NUM_BODY_LINES; i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i+s_pgOfs;
|
uint8_t k = i+s_pgOfs;
|
||||||
|
|
||||||
lcd_outdezNAtt(3*FW+2, y, k+1, LEADING0+((!s_copyMode && sub==k) ? INVERS : 0), 2);
|
lcd_outdezNAtt(3*FW+2, y, k+1, LEADING0+((!s_copyMode && sub==k) ? INVERS : 0), 2);
|
||||||
|
|
|
@ -205,7 +205,7 @@ void menuModelSetup(uint8_t event)
|
||||||
int sub = m_posVert;
|
int sub = m_posVert;
|
||||||
|
|
||||||
for (uint8_t i=0; i<NUM_BODY_LINES; ++i) {
|
for (uint8_t i=0; i<NUM_BODY_LINES; ++i) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
uint8_t k = i+s_pgOfs;
|
uint8_t k = i+s_pgOfs;
|
||||||
for (int j=0; j<=k; j++) {
|
for (int j=0; j<=k; j++) {
|
||||||
if (mstate_tab[j] == HIDDEN_ROW)
|
if (mstate_tab[j] == HIDDEN_ROW)
|
||||||
|
|
|
@ -216,7 +216,7 @@ void menuModelSensor(uint8_t event)
|
||||||
int sub = m_posVert;
|
int sub = m_posVert;
|
||||||
|
|
||||||
for (int i=0; i<NUM_BODY_LINES; i++) {
|
for (int i=0; i<NUM_BODY_LINES; i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
int k = i + s_pgOfs;
|
int k = i + s_pgOfs;
|
||||||
|
|
||||||
for (int j=0; j<k; j++) {
|
for (int j=0; j<k; j++) {
|
||||||
|
@ -440,7 +440,7 @@ void menuModelTelemetry(uint8_t event)
|
||||||
int sub = m_posVert;
|
int sub = m_posVert;
|
||||||
|
|
||||||
for (int i=0; i<NUM_BODY_LINES; i++) {
|
for (int i=0; i<NUM_BODY_LINES; i++) {
|
||||||
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
int k = i + s_pgOfs;
|
int k = i + s_pgOfs;
|
||||||
for (int j=0; j<=k; j++) {
|
for (int j=0; j<=k; j++) {
|
||||||
if (mstate_tab[j] == HIDDEN_ROW)
|
if (mstate_tab[j] == HIDDEN_ROW)
|
||||||
|
|
|
@ -279,7 +279,7 @@ void check(const char *name, check_event_t event, uint8_t curr, const MenuFuncP
|
||||||
displayScreenIndex(curr, menuTabSize, 0);
|
displayScreenIndex(curr, menuTabSize, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
drawFilledRect(0, 0, LCD_W, MENU_TITLE_HEIGHT, SOLID, FILL_WHITE|GREY_DEFAULT);
|
drawFilledRect(0, 0, LCD_W, MENU_HEADER_HEIGHT, SOLID, FILL_WHITE|GREY_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
DISPLAY_PROGRESS_BAR(menuTab ? lcdLastPos-2*FW-((curr+1)/10*FWNUM)-2 : 20*FW+1);
|
DISPLAY_PROGRESS_BAR(menuTab ? lcdLastPos-2*FW-((curr+1)/10*FWNUM)-2 : 20*FW+1);
|
||||||
|
@ -463,7 +463,7 @@ void check(const char *name, check_event_t event, uint8_t curr, const MenuFuncP
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scrollbar_X && linesCount > NUM_BODY_LINES) {
|
if (scrollbar_X && linesCount > NUM_BODY_LINES) {
|
||||||
displayScrollbar(scrollbar_X, MENU_TITLE_HEIGHT, LCD_H-MENU_TITLE_HEIGHT-MENU_NAVIG_HEIGHT, s_pgOfs, linesCount, NUM_BODY_LINES);
|
displayScrollbar(scrollbar_X, MENU_HEADER_HEIGHT, LCD_H-MENU_HEADER_HEIGHT, s_pgOfs, linesCount, NUM_BODY_LINES);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name) {
|
if (name) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue