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
+1 -1
View File
@@ -39,7 +39,7 @@
#define DEFAULT_SCROLLBAR_X (LCD_W-1)
#define NUM_BODY_LINES (LCD_LINES-1)
#define MENU_HEADER_HEIGHT FH
#define MENU_HEADER_HEIGHT FH
struct MenuItem {
const char *name;
-6
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_
+5 -5
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) {
@@ -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);
}
@@ -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)));
}
@@ -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)
@@ -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]) {
+1 -1
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);
@@ -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
}
@@ -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();
}
+1 -1
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);
{
@@ -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);
@@ -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);
@@ -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) {
+1 -1
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);
@@ -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) {
+1 -1
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) {
@@ -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);
+1 -1
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);
+1 -1
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)
@@ -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)
+2 -2
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) {