Cosmetics again ...

This commit is contained in:
Bertrand Songis
2016-08-24 20:39:22 +02:00
parent a95f9b7dde
commit b69c2aa41c
48 changed files with 246 additions and 279 deletions
+5 -6
View File
@@ -279,20 +279,19 @@ void title(const pm_char * s);
SIMPLE_MENU_NOTITLE(tab, menu, lines_count); \
TITLE(title)
#define SIMPLE_SUBMENU(title, lines_count) \
SIMPLE_SUBMENU_NOTITLE(lines_count); \
TITLE(title)
#if defined(CPUARM)
typedef int select_menu_value_t;
typedef int choice_t;
#else
typedef int8_t select_menu_value_t;
typedef int8_t choice_t;
#endif
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);
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const pm_char *label, LcdFlags attr, uint8_t event);
int8_t switchMenuItem(coord_t x, coord_t y, int8_t value, LcdFlags attr, uint8_t event);
choice_t editChoice(coord_t x, coord_t y, const pm_char * label, const pm_char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, uint8_t event);
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const pm_char * label, LcdFlags attr, uint8_t event);
int8_t editSwitch(coord_t x, coord_t y, int8_t value, LcdFlags attr, uint8_t event);
#define ON_OFF_MENU_ITEM(value, x, y, label, attr, event) value = editCheckBox(value, x, y, label, attr, event)
-11
View File
@@ -1016,17 +1016,6 @@ void putsRotaryEncoderMode(coord_t x, coord_t y, uint8_t phase, uint8_t idx, Lcd
#endif
#if defined(CPUARM)
const pm_uint8_t bchunit_ar[] PROGMEM = {
UNIT_DIST, // Alt
UNIT_RAW, // Rpm
UNIT_PERCENT, // Fuel
UNIT_TEMPERATURE, // T1
UNIT_TEMPERATURE, // T2
UNIT_KTS, // Speed
UNIT_DIST, // Dist
UNIT_DIST, // GPS Alt
};
void drawValueWithUnit(coord_t x, coord_t y, lcdint_t val, uint8_t unit, LcdFlags att)
{
// convertUnit(val, unit);
+1 -1
View File
@@ -109,7 +109,7 @@ void menuModelDisplay(uint8_t event)
uint8_t screenIndex = TELEMETRY_CURRENT_SCREEN(k);
drawStringWithIndex(0*FW, y, STR_SCREEN, screenIndex+1);
TelemetryScreenType oldScreenType = TELEMETRY_SCREEN_TYPE(screenIndex);
TelemetryScreenType newScreenType = (TelemetryScreenType)selectMenuItem(DISPLAY_COL2, y, PSTR(""), STR_VTELEMSCREENTYPE, oldScreenType, 0, TELEMETRY_SCREEN_TYPE_MAX, (menuHorizontalPosition==0 ? attr : 0), event);
TelemetryScreenType newScreenType = (TelemetryScreenType)editChoice(DISPLAY_COL2, y, PSTR(""), STR_VTELEMSCREENTYPE, oldScreenType, 0, TELEMETRY_SCREEN_TYPE_MAX, (menuHorizontalPosition==0 ? attr : 0), event);
if (newScreenType != oldScreenType) {
g_model.frsky.screensType = (g_model.frsky.screensType & (~(0x03 << (2*screenIndex)))) | (newScreenType << (2*screenIndex));
memset(&g_model.frsky.screens[screenIndex], 0, sizeof(g_model.frsky.screens[screenIndex]));
+1 -1
View File
@@ -125,7 +125,7 @@ void menuModelPhaseOne(uint8_t event)
break;
case ITEM_MODEL_PHASE_SWITCH:
fm->swtch = switchMenuItem(MIXES_2ND_COLUMN, y, fm->swtch, attr, event);
fm->swtch = editSwitch(MIXES_2ND_COLUMN, y, fm->swtch, attr, event);
break;
case ITEM_MODEL_PHASE_TRIMS:
+2 -2
View File
@@ -252,11 +252,11 @@ void menuModelExpoOne(uint8_t event)
#endif
case EXPO_FIELD_SWITCH:
ed->swtch = switchMenuItem(EXPO_ONE_2ND_COLUMN, y, ed->swtch, RIGHT | attr, event);
ed->swtch = editSwitch(EXPO_ONE_2ND_COLUMN, y, ed->swtch, RIGHT | attr, event);
break;
case EXPO_FIELD_SIDE:
ed->mode = 4 - selectMenuItem(EXPO_ONE_2ND_COLUMN, y, STR_SIDE, STR_VSIDE, 4-ed->mode, 1, 3, RIGHT | attr, event);
ed->mode = 4 - editChoice(EXPO_ONE_2ND_COLUMN, y, STR_SIDE, STR_VSIDE, 4-ed->mode, 1, 3, RIGHT | attr, event);
break;
case EXPO_FIELD_TRIM:
+4 -4
View File
@@ -292,11 +292,11 @@ void menuModelExpoOne(uint8_t event)
#endif
case EXPO_FIELD_SWITCH:
ed->swtch = switchMenuItem(EXPO_ONE_2ND_COLUMN-3*FW, y, ed->swtch, attr, event);
ed->swtch = editSwitch(EXPO_ONE_2ND_COLUMN-3*FW, y, ed->swtch, attr, event);
break;
case EXPO_FIELD_SIDE:
ed->mode = 4 - selectMenuItem(EXPO_ONE_2ND_COLUMN-3*FW, y, STR_SIDE, STR_VSIDE, 4-ed->mode, 1, 3, attr, event);
ed->mode = 4 - editChoice(EXPO_ONE_2ND_COLUMN-3*FW, y, STR_SIDE, STR_VSIDE, 4-ed->mode, 1, 3, attr, event);
break;
}
y += FH;
@@ -513,7 +513,7 @@ void menuModelMixOne(uint8_t event)
break;
#endif
case MIX_FIELD_SWITCH:
md2->swtch = switchMenuItem(COLUMN_X+MIXES_2ND_COLUMN, y, md2->swtch, attr, event);
md2->swtch = editSwitch(COLUMN_X+MIXES_2ND_COLUMN, y, md2->swtch, attr, event);
break;
case MIX_FIELD_WARNING:
drawFieldLabel(COLUMN_X+MIXES_2ND_COLUMN, y, STR_MIXWARNING);
@@ -524,7 +524,7 @@ void menuModelMixOne(uint8_t event)
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, md2->mixWarn, 3);
break;
case MIX_FIELD_MLTPX:
md2->mltpx = selectMenuItem(COLUMN_X+MIXES_2ND_COLUMN, y, STR_MULTPX, STR_VMLTPX, md2->mltpx, 0, 2, attr, event);
md2->mltpx = editChoice(COLUMN_X+MIXES_2ND_COLUMN, y, STR_MULTPX, STR_VMLTPX, md2->mltpx, 0, 2, attr, event);
break;
case MIX_FIELD_DELAY_UP:
md2->delayUp = EDIT_DELAY(COLUMN_X, y, event, attr, STR_DELAYUP, md2->delayUp);
+2 -2
View File
@@ -269,7 +269,7 @@ void menuModelMixOne(uint8_t event)
#endif
case MIX_FIELD_SWITCH:
md2->swtch = switchMenuItem(MIXES_2ND_COLUMN, y, md2->swtch, attr, event);
md2->swtch = editSwitch(MIXES_2ND_COLUMN, y, md2->swtch, attr, event);
break;
case MIX_FIELD_WARNING:
@@ -282,7 +282,7 @@ void menuModelMixOne(uint8_t event)
break;
case MIX_FIELD_MLTPX:
md2->mltpx = selectMenuItem(MIXES_2ND_COLUMN, y, STR_MULTPX, STR_VMLTPX, md2->mltpx, 0, 2, attr, event);
md2->mltpx = editChoice(MIXES_2ND_COLUMN, y, STR_MULTPX, STR_VMLTPX, md2->mltpx, 0, 2, attr, event);
break;
case MIX_FIELD_DELAY_UP:
+7 -7
View File
@@ -329,7 +329,7 @@ void menuModelSetup(uint8_t event)
case ITEM_MODEL_TIMER3_COUNTDOWN_BEEP:
{
TimerData * timer = &g_model.timers[k>=ITEM_MODEL_TIMER3 ? 2 : (k>=ITEM_MODEL_TIMER2 ? 1 : 0)];
timer->countdownBeep = selectMenuItem(MODEL_SETUP_2ND_COLUMN, y, STR_BEEPCOUNTDOWN, STR_VBEEPCOUNTDOWN, timer->countdownBeep, COUNTDOWN_SILENT, COUNTDOWN_COUNT-1, attr, event);
timer->countdownBeep = editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_BEEPCOUNTDOWN, STR_VBEEPCOUNTDOWN, timer->countdownBeep, COUNTDOWN_SILENT, COUNTDOWN_COUNT-1, attr, event);
break;
}
@@ -338,7 +338,7 @@ void menuModelSetup(uint8_t event)
case ITEM_MODEL_TIMER3_PERSISTENT:
{
TimerData * timer = &g_model.timers[k>=ITEM_MODEL_TIMER3 ? 2 : (k>=ITEM_MODEL_TIMER2 ? 1 : 0)];
timer->persistent = selectMenuItem(MODEL_SETUP_2ND_COLUMN, y, STR_PERSISTENT, STR_VPERSISTENT, timer->persistent, 0, 2, attr, event);
timer->persistent = editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_PERSISTENT, STR_VPERSISTENT, timer->persistent, 0, 2, attr, event);
break;
}
#else
@@ -390,7 +390,7 @@ void menuModelSetup(uint8_t event)
case ITEM_MODEL_TIMER2_PERSISTENT:
{
TimerData &timer = g_model.timers[k==ITEM_MODEL_TIMER2_PERSISTENT];
timer.persistent = selectMenuItem(MODEL_SETUP_2ND_COLUMN, y, STR_PERSISTENT, STR_VPERSISTENT, timer.persistent, 0, 2, attr, event);
timer.persistent = editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_PERSISTENT, STR_VPERSISTENT, timer.persistent, 0, 2, attr, event);
break;
}
#endif
@@ -422,12 +422,12 @@ void menuModelSetup(uint8_t event)
#if defined(CPUARM)
case ITEM_MODEL_DISPLAY_TRIMS:
g_model.displayTrims = selectMenuItem(MODEL_SETUP_2ND_COLUMN, y, STR_DISPLAY_TRIMS, STR_VDISPLAYTRIMS, g_model.displayTrims, 0, 2, attr, event);
g_model.displayTrims = editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_DISPLAY_TRIMS, STR_VDISPLAYTRIMS, g_model.displayTrims, 0, 2, attr, event);
break;
#endif
case ITEM_MODEL_TRIM_INC:
g_model.trimInc = selectMenuItem(MODEL_SETUP_2ND_COLUMN, y, STR_TRIMINC, STR_VTRIMINC, g_model.trimInc, -2, 2, attr, event);
g_model.trimInc = editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_TRIMINC, STR_VTRIMINC, g_model.trimInc, -2, 2, attr, event);
break;
case ITEM_MODEL_THROTTLE_REVERSED:
@@ -864,7 +864,7 @@ void menuModelSetup(uint8_t event)
{
uint8_t moduleIdx = CURRENT_MODULE_EDITED(k);
ModuleData & moduleData = g_model.moduleData[moduleIdx];
moduleData.ppm.outputType = selectMenuItem(MODEL_SETUP_2ND_COLUMN, y, STR_OUTPUT_TYPE, STR_VOUTPUT_TYPE, moduleData.ppm.outputType, 0, 1, attr, event);
moduleData.ppm.outputType = editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_OUTPUT_TYPE, STR_VOUTPUT_TYPE, moduleData.ppm.outputType, 0, 1, attr, event);
break;
}
#endif
@@ -918,7 +918,7 @@ void menuModelSetup(uint8_t event)
lcdDrawTextAlignedLeft(y, STR_MULTI_VIDFREQ);
break;
case MM_RF_PROTO_DSM2:
g_model.moduleData[moduleIdx].multi.optionValue = selectMenuItem(MODEL_SETUP_2ND_COLUMN, y, STR_MULTI_DSMFRAME, STR_OPTIONS_DSM, g_model.moduleData[moduleIdx].multi.optionValue, 0, 12, attr, event);
g_model.moduleData[moduleIdx].multi.optionValue = editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_MULTI_DSMFRAME, STR_OPTIONS_DSM, g_model.moduleData[moduleIdx].multi.optionValue, 0, 12, attr, event);
break;
default:
lcdDrawTextAlignedLeft(y, STR_MULTI_OPTION);
+6 -6
View File
@@ -241,7 +241,7 @@ void menuModelSensor(uint8_t event)
break;
case SENSOR_FIELD_TYPE:
sensor->type = selectMenuItem(SENSOR_2ND_COLUMN, y, NO_INDENT(STR_TYPE), STR_VSENSORTYPES, sensor->type, 0, 1, attr, event);
sensor->type = editChoice(SENSOR_2ND_COLUMN, y, NO_INDENT(STR_TYPE), STR_VSENSORTYPES, sensor->type, 0, 1, attr, event);
if (attr && checkIncDec_Ret) {
sensor->instance = 0;
if (sensor->type == TELEM_TYPE_CALCULATED) {
@@ -270,7 +270,7 @@ void menuModelSensor(uint8_t event)
}
}
else {
sensor->formula = selectMenuItem(SENSOR_2ND_COLUMN, y, STR_FORMULA, STR_VFORMULAS, sensor->formula, 0, TELEM_FORMULA_LAST, attr, event);
sensor->formula = editChoice(SENSOR_2ND_COLUMN, y, STR_FORMULA, STR_VFORMULAS, sensor->formula, 0, TELEM_FORMULA_LAST, attr, event);
if (attr && checkIncDec_Ret) {
sensor->param = 0;
if (sensor->formula == TELEM_FORMULA_CELL) {
@@ -291,7 +291,7 @@ void menuModelSensor(uint8_t event)
case SENSOR_FIELD_UNIT:
lcdDrawTextAlignedLeft(y, "Unit");
// TODO flash saving with selectMenuItem where I copied those 2 lines?
// TODO flash saving with editChoice where I copied those 2 lines?
lcdDrawTextAtIndex(SENSOR_2ND_COLUMN, y, STR_VTELEMUNIT, sensor->unit, attr);
if (attr) {
CHECK_INCDEC_MODELVAR_ZERO(event, sensor->unit, UNIT_MAX);
@@ -302,7 +302,7 @@ void menuModelSensor(uint8_t event)
break;
case SENSOR_FIELD_PRECISION:
sensor->prec = selectMenuItem(SENSOR_2ND_COLUMN, y, STR_PRECISION, STR_VPREC, sensor->prec, 0, 2, attr, event);
sensor->prec = editChoice(SENSOR_2ND_COLUMN, y, STR_PRECISION, STR_VPREC, sensor->prec, 0, 2, attr, event);
if (attr && checkIncDec_Ret) {
telemetryItems[s_currIdx].clear();
}
@@ -357,7 +357,7 @@ void menuModelSensor(uint8_t event)
case SENSOR_FIELD_PARAM2:
if (sensor->type == TELEM_TYPE_CALCULATED) {
if (sensor->formula == TELEM_FORMULA_CELL) {
sensor->cell.index = selectMenuItem(SENSOR_2ND_COLUMN, y, STR_CELLINDEX, STR_VCELLINDEX, sensor->cell.index, 0, 8, attr, event);
sensor->cell.index = editChoice(SENSOR_2ND_COLUMN, y, STR_CELLINDEX, STR_VCELLINDEX, sensor->cell.index, 0, 8, attr, event);
break;
}
else if (sensor->formula == TELEM_FORMULA_DIST) {
@@ -806,7 +806,7 @@ void menuModelTelemetryFrsky(uint8_t event)
drawStringWithIndex(0*FW, y, STR_SCREEN, screenIndex);
#if defined(GAUGES)
bool screenType = g_model.frsky.screensType & screenIndex;
if (screenType != (bool)selectMenuItem(TELEM_SCRTYPE_COL, y, PSTR(""), STR_VTELEMSCREENTYPE, screenType, 0, 1, attr, event))
if (screenType != (bool)editChoice(TELEM_SCRTYPE_COL, y, PSTR(""), STR_VTELEMSCREENTYPE, screenType, 0, 1, attr, event))
g_model.frsky.screensType ^= screenIndex;
#endif
break;
+3 -3
View File
@@ -49,7 +49,7 @@ void menuRadioHardware(uint8_t event)
switch(k) {
case ITEM_RADIO_HARDWARE_OPTREX_DISPLAY:
g_eeGeneral.optrexDisplay = selectMenuItem(GENERAL_HW_PARAM_OFS, y, STR_LCD, STR_VLCD, g_eeGeneral.optrexDisplay, 0, 1, attr, event);
g_eeGeneral.optrexDisplay = editChoice(GENERAL_HW_PARAM_OFS, y, STR_LCD, STR_VLCD, g_eeGeneral.optrexDisplay, 0, 1, attr, event);
break;
case ITEM_RADIO_HARDWARE_STICKS_GAINS_LABELS:
@@ -78,13 +78,13 @@ void menuRadioHardware(uint8_t event)
#if defined(ROTARY_ENCODERS)
case ITEM_RADIO_HARDWARE_ROTARY_ENCODER:
g_eeGeneral.rotarySteps = selectMenuItem(GENERAL_HW_PARAM_OFS, y, PSTR("Rotary Encoder"), PSTR("\0062steps4steps"), g_eeGeneral.rotarySteps, 0, 1, attr, event);
g_eeGeneral.rotarySteps = editChoice(GENERAL_HW_PARAM_OFS, y, PSTR("Rotary Encoder"), PSTR("\0062steps4steps"), g_eeGeneral.rotarySteps, 0, 1, attr, event);
break;
#endif
#if defined(BLUETOOTH)
case ITEM_RADIO_HARDWARE_BT_BAUDRATE:
g_eeGeneral.btBaudrate = selectMenuItem(GENERAL_HW_PARAM_OFS, y, STR_BAUDRATE, PSTR("\005115k 9600 19200"), g_eeGeneral.btBaudrate, 0, 2, attr, event);
g_eeGeneral.btBaudrate = editChoice(GENERAL_HW_PARAM_OFS, y, STR_BAUDRATE, PSTR("\005115k 9600 19200"), g_eeGeneral.btBaudrate, 0, 2, attr, event);
if (attr && checkIncDec_Ret) {
btInit();
}
+13 -13
View File
@@ -34,16 +34,16 @@ const pm_uchar sticks[] PROGMEM = {
#define SLIDER_5POS(y, value, label, event, attr) { \
int8_t tmp = value; \
drawSlider(RADIO_SETUP_2ND_COLUMN, y, 2+tmp, 4, attr); \
value = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, label, NULL, tmp, -2, +2, attr, event); \
value = editChoice(RADIO_SETUP_2ND_COLUMN, y, label, NULL, tmp, -2, +2, attr, event); \
}
#elif defined(GRAPHICS)
#define SLIDER_5POS(y, value, label, event, attr) { \
int8_t tmp = value; \
display5posSlider(RADIO_SETUP_2ND_COLUMN, y, tmp, attr); \
value = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, label, NULL, tmp, -2, +2, attr, event); \
value = editChoice(RADIO_SETUP_2ND_COLUMN, y, label, NULL, tmp, -2, +2, attr, event); \
}
#else
#define SLIDER_5POS(y, value, label, event, attr) value = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, label, STR_VBEEPLEN, value, -2, +2, attr, event)
#define SLIDER_5POS(y, value, label, event, attr) value = editChoice(RADIO_SETUP_2ND_COLUMN, y, label, STR_VBEEPLEN, value, -2, +2, attr, event)
#endif
#if defined(SPLASH) && !defined(FSPLASH)
@@ -234,7 +234,7 @@ void menuRadioSetup(uint8_t event)
#if defined(AUDIO)
case ITEM_SETUP_BEEP_MODE:
g_eeGeneral.beepMode = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_SPEAKER, STR_VBEEPMODE, g_eeGeneral.beepMode, -2, 1, attr, event);
g_eeGeneral.beepMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_SPEAKER, STR_VBEEPMODE, g_eeGeneral.beepMode, -2, 1, attr, event);
#if defined(TELEMETRY_FRSKY)
if (attr && checkIncDec_Ret) frskySendAlarms();
#endif
@@ -242,7 +242,7 @@ void menuRadioSetup(uint8_t event)
#if defined(BUZZER) // AUDIO + BUZZER
case ITEM_SETUP_BUZZER_MODE:
g_eeGeneral.buzzerMode = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_BUZZER, STR_VBEEPMODE, g_eeGeneral.buzzerMode, -2, 1, attr, event);
g_eeGeneral.buzzerMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_BUZZER, STR_VBEEPMODE, g_eeGeneral.buzzerMode, -2, 1, attr, event);
#if defined(TELEMETRY_FRSKY)
if (attr && checkIncDec_Ret) frskySendAlarms();
#endif
@@ -250,7 +250,7 @@ void menuRadioSetup(uint8_t event)
#endif
#elif defined(BUZZER) // BUZZER only
case ITEM_SETUP_BUZZER_MODE:
g_eeGeneral.beepMode = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_SPEAKER, STR_VBEEPMODE, g_eeGeneral.beepMode, -2, 1, attr, event);
g_eeGeneral.beepMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_SPEAKER, STR_VBEEPMODE, g_eeGeneral.beepMode, -2, 1, attr, event);
#if defined(TELEMETRY_FRSKY)
if (attr && checkIncDec_Ret) frskySendAlarms();
#endif
@@ -341,7 +341,7 @@ void menuRadioSetup(uint8_t event)
break;
case ITEM_SETUP_HAPTIC_MODE:
g_eeGeneral.hapticMode = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_MODE, STR_VBEEPMODE, g_eeGeneral.hapticMode, -2, 1, attr, event);
g_eeGeneral.hapticMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_MODE, STR_VBEEPMODE, g_eeGeneral.hapticMode, -2, 1, attr, event);
break;
case ITEM_SETUP_HAPTIC_LENGTH:
@@ -411,7 +411,7 @@ void menuRadioSetup(uint8_t event)
#if ROTARY_ENCODERS > 0
case ITEM_SETUP_RE_NAVIGATION:
g_eeGeneral.reNavigation = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_RENAVIG, STR_VRENAVIG, g_eeGeneral.reNavigation, 0, NUM_ROTARY_ENCODERS, attr, event);
g_eeGeneral.reNavigation = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_RENAVIG, STR_VRENAVIG, g_eeGeneral.reNavigation, 0, NUM_ROTARY_ENCODERS, attr, event);
if (attr && checkIncDec_Ret) {
g_rotenc[NAVIGATION_RE_IDX()] = 0;
}
@@ -423,7 +423,7 @@ void menuRadioSetup(uint8_t event)
break;
case ITEM_SETUP_BACKLIGHT_MODE:
g_eeGeneral.backlightMode = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_MODE, STR_VBLMODE, g_eeGeneral.backlightMode, e_backlight_mode_off, e_backlight_mode_on, attr, event);
g_eeGeneral.backlightMode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_MODE, STR_VBLMODE, g_eeGeneral.backlightMode, e_backlight_mode_off, e_backlight_mode_on, attr, event);
break;
case ITEM_SETUP_FLASH_BEEP:
@@ -480,13 +480,13 @@ void menuRadioSetup(uint8_t event)
break;
case ITEM_SETUP_GPSFORMAT:
g_eeGeneral.gpsFormat = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_GPSCOORD, STR_GPSFORMAT, g_eeGeneral.gpsFormat, 0, 1, attr, event);
g_eeGeneral.gpsFormat = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_GPSCOORD, STR_GPSFORMAT, g_eeGeneral.gpsFormat, 0, 1, attr, event);
break;
#endif
#if defined(PXX)
case ITEM_SETUP_COUNTRYCODE:
g_eeGeneral.countryCode = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_COUNTRYCODE, STR_COUNTRYCODES, g_eeGeneral.countryCode, 0, 2, attr, event);
g_eeGeneral.countryCode = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_COUNTRYCODE, STR_COUNTRYCODES, g_eeGeneral.countryCode, 0, 2, attr, event);
break;
#endif
@@ -504,7 +504,7 @@ void menuRadioSetup(uint8_t event)
break;
case ITEM_SETUP_IMPERIAL:
g_eeGeneral.imperial = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_UNITSSYSTEM, STR_VUNITSSYSTEM, g_eeGeneral.imperial, 0, 1, attr, event);
g_eeGeneral.imperial = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_UNITSSYSTEM, STR_VUNITSSYSTEM, g_eeGeneral.imperial, 0, 1, attr, event);
break;
#endif
@@ -522,7 +522,7 @@ void menuRadioSetup(uint8_t event)
#if defined(TELEMETRY_MAVLINK)
case ITEM_MAVLINK_BAUD:
g_eeGeneral.mavbaud = selectMenuItem(RADIO_SETUP_2ND_COLUMN, y, STR_MAVLINK_BAUD_LABEL, STR_MAVLINK_BAUDS, g_eeGeneral.mavbaud, 0, 7, attr, event);
g_eeGeneral.mavbaud = editChoice(RADIO_SETUP_2ND_COLUMN, y, STR_MAVLINK_BAUD_LABEL, STR_MAVLINK_BAUDS, g_eeGeneral.mavbaud, 0, 7, attr, event);
break;
#endif
+4 -4
View File
@@ -72,7 +72,7 @@ void title(const pm_char * s)
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)
choice_t editChoice(coord_t x, coord_t y, const pm_char *label, const pm_char *values, choice_t value, choice_t min, choice_t max, LcdFlags attr, uint8_t event)
{
drawFieldLabel(x, y, label);
if (values) lcdDrawTextAtIndex(x, y, values, value-min, attr);
@@ -84,13 +84,13 @@ uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const pm_char *label,
{
#if defined(GRAPHICS)
drawCheckBox(x, y, value, attr);
return selectMenuItem(x, y, label, NULL, value, 0, 1, attr, event);
return editChoice(x, y, label, NULL, value, 0, 1, attr, event);
#else
return selectMenuItem(x, y, label, STR_OFFON, value, 0, 1, attr, event);
return editChoice(x, y, label, STR_OFFON, value, 0, 1, attr, event);
#endif
}
int8_t switchMenuItem(coord_t x, coord_t y, int8_t value, LcdFlags attr, uint8_t event)
int8_t editSwitch(coord_t x, coord_t y, int8_t value, LcdFlags attr, uint8_t event)
{
drawFieldLabel(x, y, STR_SWITCH);
drawSwitch(x, y, value, attr);