1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-23 00:05:17 +03:00

Constant MENU_TITLE_HEIGHT renamed to MENU_HEADER_HEIGHT

This commit is contained in:
bsongis 2015-02-17 19:50:03 +01:00
parent 8c95e02ceb
commit ae16191e76
43 changed files with 86 additions and 99 deletions

View file

@ -37,9 +37,8 @@
#include "lcd.h"
#include "menus.h"
#define NUM_BODY_LINES LCD_LINES-1
#define MENU_TITLE_HEIGHT FH
#define MENU_NAVIG_HEIGHT 0
#define NUM_BODY_LINES (LCD_LINES-1)
#define MENU_HEADER_HEIGHT FH
void displaySplash();
void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr);

View file

@ -59,9 +59,6 @@
#define FWNUM 5
#define FH 8
#define MENU_TITLE_HEIGHT FH
#define MENU_NAVIG_HEIGHT 0
#define LCD_LINES (LCD_H/FH)
#define LCD_COLS (LCD_W/FW)
@ -283,7 +280,4 @@ char *strSetCursor(char *dest, int position);
char *strAppendDate(char * str, bool time=false);
char *strAppendFilename(char * dest, const char * filename, const int size);
#define MENU_TITLE_HEIGHT FH
#define MENU_NAVIG_HEIGHT 0
#endif

View file

@ -69,14 +69,14 @@ void menuCommonCalib(uint8_t event)
case 0:
// START CALIBRATION
if (!READ_ONLY()) {
lcd_putsLeft(MENU_TITLE_HEIGHT+2*FH, STR_MENUTOSTART);
lcd_putsLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUTOSTART);
}
break;
case 1:
// SET MIDPOINT
lcd_putsAtt(0*FW, MENU_TITLE_HEIGHT+FH, STR_SETMIDPOINT, INVERS);
lcd_putsLeft(MENU_TITLE_HEIGHT+2*FH, STR_MENUWHENDONE);
lcd_putsAtt(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++) {
reusableBuffer.calib.loVals[i] = 15000;
@ -88,8 +88,8 @@ void menuCommonCalib(uint8_t event)
case 2:
// MOVE STICKS/POTS
STICK_SCROLL_DISABLE();
lcd_putsAtt(0*FW, MENU_TITLE_HEIGHT+FH, STR_MOVESTICKSPOTS, INVERS);
lcd_putsLeft(MENU_TITLE_HEIGHT+2*FH, STR_MENUWHENDONE);
lcd_putsAtt(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++) {
if (abs(reusableBuffer.calib.loVals[i]-reusableBuffer.calib.hiVals[i]) > 50) {

View file

@ -52,13 +52,13 @@ void menuGeneralDiagAna(uint8_t event)
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
#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};
uint8_t x = x_coord[i%3];
lcd_outdezNAtt(x, y, i+1, LEADING0|LEFT, 2);
lcd_putc(x+2*FW-2, y, ':');
#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;
putsStrIdx(x, y, PSTR("A"), i+1);
lcd_putc(lcdNextPos, y, ':');
@ -69,17 +69,17 @@ void menuGeneralDiagAna(uint8_t event)
#if !defined(CPUARM)
// 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);
#endif
#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;
adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8;
uint32_t batCalV = (adcBatt + adcBatt*(g_eeGeneral.vBatCalib)/128) * 4191;
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)
lcd_putsLeft(6*FH-2, STR_BATT_CALIB);
// Gruvin wants 2 decimal places and instant update of volts calib field when button pressed

View file

@ -46,25 +46,25 @@ void menuGeneralDiagKeys(uint8_t event)
{
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++) {
coord_t y;
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);
displayKeyState(i&1? 20*FW : 18*FW, y, (EnumKeys)(TRM_BASE+i));
}
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);
displayKeyState(5*FW+2, y, (EnumKeys)(KEY_MENU+(5-i)));
}
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
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)
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_outdezNAtt(18*FW, y, g_rotenc[i], LEFT|(switchState((EnumKeys)(BTN_REa+i)) ? INVERS : 0));
}

View file

@ -56,7 +56,7 @@ void menuGeneralHardware(uint8_t event)
uint8_t sub = m_posVert - 1;
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 blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
uint8_t attr = (sub == k ? blink : 0);

View file

@ -281,7 +281,7 @@ void menuGeneralSdManager(uint8_t _event)
reusableBuffer.sdmanager.offset = s_pgOfs;
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;
uint8_t attr = (m_posVert-1-s_pgOfs == i ? BSS|INVERS : BSS);
if (reusableBuffer.sdmanager.lines[i][0]) {

View file

@ -152,7 +152,7 @@ void menuGeneralSetup(uint8_t event)
uint8_t sub = m_posVert - 1;
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 blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
uint8_t attr = (sub == k ? blink : 0);

View file

@ -52,9 +52,9 @@ void menuGeneralTrainer(uint8_t event)
uint8_t attr;
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++) {
uint8_t chan = channel_order(i);
@ -87,19 +87,19 @@ void menuGeneralTrainer(uint8_t event)
}
attr = (m_posVert==5) ? blink : 0;
lcd_putsLeft(MENU_TITLE_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_putsLeft(MENU_HEADER_HEIGHT+1+5*FH, STR_MULTIPLIER);
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);
attr = (m_posVert==6) ? INVERS : 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++) {
uint8_t x = (i*TRAINER_CALIB_POS+16)*FW/2;
#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
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
}

View file

@ -40,7 +40,7 @@ void menuGeneralVersion(uint8_t event)
{
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 (Coproc_valid == 1) {

View file

@ -248,7 +248,7 @@ void menuModelCurvesAll(uint8_t event)
}
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 attr = (sub == k ? INVERS : 0);
#if defined(GVARS) && defined(PCBSTD)

View file

@ -85,7 +85,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
#endif
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;
CustomFunctionData *cfn = &functions[k];

View file

@ -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;
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;
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);
@ -244,10 +244,10 @@ void menuModelFlightModesAll(uint8_t event)
uint8_t att;
for (uint8_t i=0; i<MAX_FLIGHT_MODES; i++) {
#if defined(CPUARM)
coord_t y = MENU_TITLE_HEIGHT + 1 + (i-s_pgOfs)*FH;
if (y<MENU_TITLE_HEIGHT+1 || y>(LCD_LINES-1)*FH+MENU_TITLE_HEIGHT-FH) continue;
coord_t y = MENU_HEADER_HEIGHT + 1 + (i-s_pgOfs)*FH;
if (y<MENU_HEADER_HEIGHT+1 || y>(LCD_LINES-1)*FH+MENU_HEADER_HEIGHT-FH) continue;
#else
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
#endif
att = (i==sub ? INVERS : 0);
FlightModeData *p = flightModeAddress(i);

View file

@ -53,7 +53,7 @@ void menuModelHeli(uint8_t event)
uint8_t sub = m_posVert - 1;
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);
switch(i) {
case ITEM_HELI_SWASHTYPE:

View file

@ -303,7 +303,7 @@ void menuModelExpoOne(uint8_t event)
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++) {
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;
#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;
#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++) {
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 (s_pgOfs < cur && cur-s_pgOfs < LCD_LINES) {
if (expo) {

View file

@ -129,7 +129,7 @@ void menuModelLimits(uint8_t event)
}
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;
if (k==NUM_CHNOUT) {

View file

@ -107,7 +107,7 @@ void menuModelLogicalSwitchOne(uint8_t event)
int v1_val = cs->v1;
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 attr = (sub==i ? (s_editMode>0 ? BLINK|INVERS : INVERS) : 0);
uint8_t cstate = lswFamily(cs->func);
@ -319,7 +319,7 @@ void menuModelLogicalSwitches(uint8_t event)
horzpos_t horz = m_posHorz;
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;
uint8_t attr = (sub==k ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
uint8_t attr1 = (horz==1 ? attr : 0);

View file

@ -316,7 +316,7 @@ void menuModelSelect(uint8_t event)
TITLE(STR_MENUMODELSEL);
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;
lcd_outdezNAtt(3*FW+2, y, k+1, LEADING0+((!s_copyMode && sub==k) ? INVERS : 0), 2);

View file

@ -155,7 +155,7 @@ void menuModelSetup(uint8_t event)
int8_t editMode = s_editMode;
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;
#if defined(CPUARM)
for (int j=0; j<=k; j++) {

View file

@ -262,7 +262,7 @@ void menuModelSensor(uint8_t event)
int8_t sub = m_posVert;
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;
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++) {
coord_t y = MENU_TITLE_HEIGHT + 1 + i*FH;
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
uint8_t k = i + s_pgOfs;
#if defined(CPUARM)
for (int j=0; j<=k; j++) {

View file

@ -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;
for (uint8_t i=0; i<LCD_LINES-1 && k<TMPL_COUNT; i++) {
k = i+s_pgOfs;

View file

@ -54,9 +54,6 @@
#define FWNUM 5
#define FH 8
#define MENU_TITLE_HEIGHT FH
#define MENU_NAVIG_HEIGHT 0
#define LCD_LINES (LCD_H/FH)
#define LCD_COLS (LCD_W/FW)
@ -259,7 +256,4 @@ char *strSetCursor(char *dest, int position);
char *strAppendDate(char * str, bool time=false);
char *strAppendFilename(char * dest, const char * filename, const int size);
#define MENU_TITLE_HEIGHT FH
#define MENU_NAVIG_HEIGHT 0
#endif // _LCD_H_

View file

@ -97,14 +97,14 @@ void menuCommonCalib(uint8_t event)
case 0:
// START CALIBRATION
if (!READ_ONLY()) {
lcd_putsLeft(MENU_TITLE_HEIGHT+2*FH, STR_MENUTOSTART);
lcd_putsLeft(MENU_HEADER_HEIGHT+2*FH, STR_MENUTOSTART);
}
break;
case 1:
// SET MIDPOINT
lcd_putsAtt(0*FW, MENU_TITLE_HEIGHT+FH, STR_SETMIDPOINT, INVERS);
lcd_putsLeft(MENU_TITLE_HEIGHT+2*FH, STR_MENUWHENDONE);
lcd_putsAtt(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++) {
reusableBuffer.calib.loVals[i] = 15000;
@ -120,8 +120,8 @@ void menuCommonCalib(uint8_t event)
case 2:
// MOVE STICKS/POTS
STICK_SCROLL_DISABLE();
lcd_putsAtt(0*FW, MENU_TITLE_HEIGHT+FH, STR_MOVESTICKSPOTS, INVERS);
lcd_putsLeft(MENU_TITLE_HEIGHT+2*FH, STR_MENUWHENDONE);
lcd_putsAtt(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++) {
if (abs(reusableBuffer.calib.loVals[i]-reusableBuffer.calib.hiVals[i]) > 50) {

View file

@ -44,13 +44,13 @@ void menuGeneralDiagAna(uint8_t event)
for (int i=0; i<NUM_STICKS+NUM_POTS; i++) {
#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};
uint8_t x = x_coord[i%3];
lcd_outdezNAtt(x, y, i+1, LEADING0|LEFT, 2);
lcd_putc(x+2*FW-2, y, ':');
#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;
putsStrIdx(x, y, PSTR("A"), i+1);
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_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;
adcBatt = ((adcBatt * 7) + anaIn(TX_VOLTAGE)) / 8;
uint32_t batCalV = (adcBatt + (adcBatt*g_eeGeneral.vBatCalib)/128) * BATT_SCALE;
batCalV >>= 11;
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);
}

View file

@ -46,19 +46,19 @@ void menuGeneralDiagKeys(uint8_t event)
{
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++) {
coord_t y;
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);
displayKeyState(i&1? 20*FW : 18*FW, y, (EnumKeys)(TRM_BASE+i));
}
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);
displayKeyState(5*FW+2, y, (EnumKeys)(KEY_MENU+(5-i)));
}

View file

@ -96,7 +96,7 @@ void menuGeneralHardware(uint8_t event)
uint8_t sub = m_posVert;
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;
for (int j=0; j<=k; j++) {
if (mstate_tab[j] == HIDDEN_ROW)

View file

@ -391,7 +391,7 @@ void menuGeneralSdManager(uint8_t _event)
reusableBuffer.sdmanager.offset = s_pgOfs;
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;
LcdFlags attr = (index == i ? BSS|INVERS : BSS);
if (reusableBuffer.sdmanager.lines[i][0]) {

View file

@ -131,7 +131,7 @@ void menuGeneralSetup(uint8_t event)
int sub = m_posVert;
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 blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
uint8_t attr = (sub == k ? blink : 0);

View file

@ -53,9 +53,9 @@ void menuGeneralTrainer(uint8_t event)
LcdFlags attr;
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;
for (int i=1; i<=NUM_STICKS; i++) {
@ -89,19 +89,19 @@ void menuGeneralTrainer(uint8_t event)
}
attr = (sub==5) ? blink : 0;
lcd_putsLeft(MENU_TITLE_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_putsLeft(MENU_HEADER_HEIGHT+1+5*FH, STR_MULTIPLIER);
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);
attr = (sub==6) ? INVERS : 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++) {
uint8_t x = (i*TRAINER_CALIB_POS+16)*FW/2;
#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
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
}

View file

@ -95,9 +95,9 @@ void menuGeneralVersion(uint8_t event)
{
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)) {
backupEeprom();
}

View file

@ -305,7 +305,7 @@ void menuModelCurvesAll(uint8_t event)
}
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;
LcdFlags attr = (sub == k ? INVERS : 0);
{

View file

@ -135,7 +135,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
}
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;
putsStrIdx(0, y, functions == g_model.customFn ? STR_SF : STR_GF, k+1, (sub==k && m_posHorz<0) ? INVERS : 0);

View file

@ -76,7 +76,7 @@ void menuModelCustomScriptOne(uint8_t event)
int8_t sub = m_posVert;
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;
LcdFlags attr = (sub==i ? (s_editMode>0 ? BLINK|INVERS : INVERS) : 0);

View file

@ -77,7 +77,7 @@ void menuModelFlightModesAll(uint8_t event)
}
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;
if (k==MAX_FLIGHT_MODES) {

View file

@ -79,7 +79,7 @@ void menuModelGVars(uint8_t event)
for (int l=0; l<LCD_LINES-1; l++) {
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, '!');
putsStrIdx(0, y, STR_GV, i+1, (sub==i && m_posHorz<0) ? INVERS : 0);

View file

@ -318,7 +318,7 @@ void menuModelExpoOne(uint8_t event)
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++) {
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++) {
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 (cur-s_pgOfs >= 0 && cur-s_pgOfs < NUM_BODY_LINES) {
if (expo) {

View file

@ -140,7 +140,7 @@ void menuModelLimits(uint8_t event)
}
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;
if (k==NUM_CHNOUT) {

View file

@ -119,7 +119,7 @@ void menuModelLogicalSwitches(uint8_t event)
}
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;
LcdFlags attr = (sub==k ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
LcdFlags attr1 = (horz==1 ? attr : 0);

View file

@ -244,7 +244,7 @@ void menuModelSelect(uint8_t event)
TITLE(STR_MENUMODELSEL);
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;
lcd_outdezNAtt(3*FW+2, y, k+1, LEADING0+((!s_copyMode && sub==k) ? INVERS : 0), 2);

View file

@ -205,7 +205,7 @@ void menuModelSetup(uint8_t event)
int sub = m_posVert;
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;
for (int j=0; j<=k; j++) {
if (mstate_tab[j] == HIDDEN_ROW)

View file

@ -216,7 +216,7 @@ void menuModelSensor(uint8_t event)
int sub = m_posVert;
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;
for (int j=0; j<k; j++) {
@ -440,7 +440,7 @@ void menuModelTelemetry(uint8_t event)
int sub = m_posVert;
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;
for (int j=0; j<=k; j++) {
if (mstate_tab[j] == HIDDEN_ROW)

View file

@ -279,7 +279,7 @@ void check(const char *name, check_event_t event, uint8_t curr, const MenuFuncP
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);
@ -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) {
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) {