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
+3 -3
View File
@@ -236,11 +236,11 @@ void title(const pm_char * s);
#define SIMPLE_SUBMENU(title, lines_count) \
check_submenu_simple(title, event, lines_count)
typedef int select_menu_value_t;
typedef int choice_t;
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);
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const pm_char *label, LcdFlags attr, uint8_t event);
swsrc_t switchMenuItem(coord_t x, coord_t y, swsrc_t value, LcdFlags attr, uint8_t event);
swsrc_t editSwitch(coord_t x, coord_t y, swsrc_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
@@ -803,17 +803,6 @@ void drawTrimMode(coord_t x, coord_t y, uint8_t phase, uint8_t idx, LcdFlags att
}
}
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, int32_t val, uint8_t unit, LcdFlags att)
{
// convertUnit(val, unit);
+1
View File
@@ -107,6 +107,7 @@ enum MenuModelIndexes {
void menuModelSelect(uint8_t event);
void menuModelSetup(uint8_t event);
void menuModelFailsafe(uint8_t event);
void menuModelHeli(uint8_t event);
void menuModelFlightModesAll(uint8_t event);
void menuModelExposAll(uint8_t event);
+1 -1
View File
@@ -125,7 +125,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]));
+2 -2
View File
@@ -83,11 +83,11 @@ void menuModelGVarOne(uint8_t event)
break;
case GVAR_FIELD_UNIT:
gvar->unit = selectMenuItem(GVAR_2ND_COLUMN, y, STR_UNIT, "\001-%", gvar->unit, 0, 1, attr, event);
gvar->unit = editChoice(GVAR_2ND_COLUMN, y, STR_UNIT, "\001-%", gvar->unit, 0, 1, attr, event);
break;
case GVAR_FIELD_PREC:
gvar->prec = selectMenuItem(GVAR_2ND_COLUMN, y, STR_PRECISION, STR_VPREC, gvar->prec, 0, 1, attr, event);
gvar->prec = editChoice(GVAR_2ND_COLUMN, y, STR_PRECISION, STR_VPREC, gvar->prec, 0, 1, attr, event);
break;
case GVAR_FIELD_MIN:
+2 -2
View File
@@ -249,11 +249,11 @@ void menuModelExpoOne(uint8_t event)
#endif
case EXPO_FIELD_SWITCH:
ed->swtch = switchMenuItem(EXPO_ONE_2ND_COLUMN, y, ed->swtch, attr, event);
ed->swtch = editSwitch(EXPO_ONE_2ND_COLUMN, y, ed->swtch, 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, attr, event);
ed->mode = 4 - editChoice(EXPO_ONE_2ND_COLUMN, y, STR_SIDE, STR_VSIDE, 4-ed->mode, 1, 3, attr, event);
break;
case EXPO_FIELD_TRIM:
+2 -2
View File
@@ -276,7 +276,7 @@ void menuModelMixOne(uint8_t event)
#endif
case MIX_FIELD_SWITCH:
md2->swtch = switchMenuItem(MENU_COLUMN2_X+MIXES_2ND_COLUMN, y, md2->swtch, attr, event);
md2->swtch = editSwitch(MENU_COLUMN2_X+MIXES_2ND_COLUMN, y, md2->swtch, attr, event);
break;
case MIX_FIELD_WARNING:
@@ -289,7 +289,7 @@ void menuModelMixOne(uint8_t event)
break;
case MIX_FIELD_MLTPX:
md2->mltpx = selectMenuItem(MENU_COLUMN2_X+MIXES_2ND_COLUMN, y, STR_MULTPX, STR_VMLTPX, md2->mltpx, 0, 2, attr, event);
md2->mltpx = editChoice(MENU_COLUMN2_X+MIXES_2ND_COLUMN, y, STR_MULTPX, STR_VMLTPX, md2->mltpx, 0, 2, attr, event);
break;
case MIX_FIELD_DELAY_UP:
+6 -7
View File
@@ -21,7 +21,6 @@
#include "opentx.h"
uint8_t g_moduleIdx;
void menuModelFailsafe(uint8_t event);
enum MenuModelSetupItems {
ITEM_MODEL_NAME,
@@ -355,7 +354,7 @@ void menuModelSetup(uint8_t event)
break;
case ITEM_MODEL_TIMER1_PERSISTENT:
g_model.timers[0].persistent = selectMenuItem(MODEL_SETUP_2ND_COLUMN, y, STR_PERSISTENT, STR_VPERSISTENT, g_model.timers[0].persistent, 0, 2, attr, event);
g_model.timers[0].persistent = editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_PERSISTENT, STR_VPERSISTENT, g_model.timers[0].persistent, 0, 2, attr, event);
break;
#if TIMERS > 1
@@ -376,7 +375,7 @@ void menuModelSetup(uint8_t event)
break;
case ITEM_MODEL_TIMER2_PERSISTENT:
g_model.timers[1].persistent = selectMenuItem(MODEL_SETUP_2ND_COLUMN, y, STR_PERSISTENT, STR_VPERSISTENT, g_model.timers[1].persistent, 0, 2, attr, event);
g_model.timers[1].persistent = editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_PERSISTENT, STR_VPERSISTENT, g_model.timers[1].persistent, 0, 2, attr, event);
break;
#endif
@@ -398,7 +397,7 @@ void menuModelSetup(uint8_t event)
break;
case ITEM_MODEL_TIMER3_PERSISTENT:
g_model.timers[2].persistent = selectMenuItem(MODEL_SETUP_2ND_COLUMN, y, STR_PERSISTENT, STR_VPERSISTENT, g_model.timers[2].persistent, 0, 2, attr, event);
g_model.timers[2].persistent = editChoice(MODEL_SETUP_2ND_COLUMN, y, STR_PERSISTENT, STR_VPERSISTENT, g_model.timers[2].persistent, 0, 2, attr, event);
break;
#endif
@@ -433,11 +432,11 @@ void menuModelSetup(uint8_t event)
break;
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;
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_LABEL:
@@ -990,7 +989,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);
+10 -10
View File
@@ -122,7 +122,7 @@ enum SensorFields {
#define SENSOR_FILTER_ROWS (sensor->isConfigurable() ? (uint8_t)0 : HIDDEN_ROW)
#define SENSOR_PERSISTENT_ROWS (sensor->type == TELEM_TYPE_CALCULATED ? (uint8_t)0 : HIDDEN_ROW)
void menuModelSensor(uint8_t event)
void menuModelSensor(event_t event)
{
TelemetrySensor * sensor = &g_model.telemetrySensors[s_currIdx];
@@ -132,7 +132,7 @@ void menuModelSensor(uint8_t event)
SUBMENU(STR_MENUSENSOR, SENSOR_FIELD_MAX, { 0, 0, sensor->type == TELEM_TYPE_CALCULATED ? (uint8_t)0 : (uint8_t)1, SENSOR_UNIT_ROWS, SENSOR_PREC_ROWS, SENSOR_PARAM1_ROWS, SENSOR_PARAM2_ROWS, SENSOR_PARAM3_ROWS, SENSOR_PARAM4_ROWS, SENSOR_AUTOOFFSET_ROWS, SENSOR_ONLYPOS_ROWS, SENSOR_FILTER_ROWS, SENSOR_PERSISTENT_ROWS, 0 });
for (int i=0; i<NUM_BODY_LINES; i++) {
for (uint8_t i=0; i<NUM_BODY_LINES; i++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
int k = i + menuVerticalOffset;
@@ -152,7 +152,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) {
@@ -181,7 +181,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) {
@@ -202,7 +202,7 @@ void menuModelSensor(uint8_t event)
case SENSOR_FIELD_UNIT:
lcdDrawTextAlignedLeft(y, STR_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);
@@ -216,7 +216,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();
}
@@ -279,7 +279,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) {
@@ -358,7 +358,7 @@ void menuModelSensor(uint8_t event)
void onSensorMenu(const char *result)
{
int index = menuVerticalPosition - ITEM_TELEMETRY_SENSOR1;
uint8_t index = menuVerticalPosition - ITEM_TELEMETRY_SENSOR1;
if (index < MAX_TELEMETRY_SENSORS) {
if (result == STR_EDIT) {
@@ -391,7 +391,7 @@ void onSensorMenu(const char *result)
}
}
void menuModelTelemetryFrsky(uint8_t event)
void menuModelTelemetryFrsky(event_t event)
{
if (warningResult) {
warningResult = 0;
@@ -402,7 +402,7 @@ void menuModelTelemetryFrsky(uint8_t event)
MENU(STR_MENUTELEMETRY, menuTabModel, MENU_MODEL_TELEMETRY_FRSKY, ITEM_TELEMETRY_MAX, { TELEMETRY_TYPE_ROWS RSSI_ROWS SENSORS_ROWS VARIO_ROWS });
for (int i=0; i<NUM_BODY_LINES; i++) {
for (uint8_t i=0; i<NUM_BODY_LINES; i++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
int k = i + menuVerticalOffset;
for (int j=0; j<=k; j++) {
+4 -4
View File
@@ -126,7 +126,7 @@ void menuRadioHardware(uint8_t event)
else
lcdDrawTextAtIndex(HW_SETTINGS_COLUMN, y, STR_MMMINV, 0, 0);
uint8_t potType = (g_eeGeneral.slidersConfig & mask) >> idx;
potType = selectMenuItem(HW_SETTINGS_COLUMN+5*FW, y, "", STR_SLIDERTYPES, potType, SLIDER_NONE, SLIDER_WITH_DETENT, menuHorizontalPosition == 1 ? attr : 0, event);
potType = editChoice(HW_SETTINGS_COLUMN+5*FW, y, "", STR_SLIDERTYPES, potType, SLIDER_NONE, SLIDER_WITH_DETENT, menuHorizontalPosition == 1 ? attr : 0, event);
g_eeGeneral.slidersConfig &= ~mask;
g_eeGeneral.slidersConfig |= (potType << idx);
break;
@@ -153,7 +153,7 @@ void menuRadioHardware(uint8_t event)
else
lcdDrawTextAtIndex(HW_SETTINGS_COLUMN, y, STR_MMMINV, 0, 0);
uint8_t potType = (g_eeGeneral.potsConfig & mask) >> shift;
potType = selectMenuItem(HW_SETTINGS_COLUMN+5*FW, y, "", STR_POTTYPES, potType, POT_NONE, POT_WITHOUT_DETENT, menuHorizontalPosition == 1 ? attr : 0, event);
potType = editChoice(HW_SETTINGS_COLUMN+5*FW, y, "", STR_POTTYPES, potType, POT_NONE, POT_WITHOUT_DETENT, menuHorizontalPosition == 1 ? attr : 0, event);
g_eeGeneral.potsConfig &= ~mask;
g_eeGeneral.potsConfig |= (potType << shift);
break;
@@ -189,7 +189,7 @@ void menuRadioHardware(uint8_t event)
editName(HW_SETTINGS_COLUMN, y, g_eeGeneral.switchNames[index], LEN_SWITCH_NAME, event, menuHorizontalPosition == 0 ? attr : 0);
else
lcdDrawTextAtIndex(HW_SETTINGS_COLUMN, y, STR_MMMINV, 0, 0);
config = selectMenuItem(HW_SETTINGS_COLUMN+5*FW, y, "", STR_SWTYPES, config, SWITCH_NONE, SWITCH_TYPE_MAX(index), menuHorizontalPosition == 1 ? attr : 0, event);
config = editChoice(HW_SETTINGS_COLUMN+5*FW, y, "", STR_SWTYPES, config, SWITCH_NONE, SWITCH_TYPE_MAX(index), menuHorizontalPosition == 1 ? attr : 0, event);
if (attr && checkIncDec_Ret) {
swconfig_t mask = (swconfig_t)0x03 << (2*index);
g_eeGeneral.switchConfig = (g_eeGeneral.switchConfig & ~mask) | ((swconfig_t(config) & 0x03) << (2*index));
@@ -207,7 +207,7 @@ void menuRadioHardware(uint8_t event)
break;
#endif
case ITEM_RADIO_HARDWARE_UART3_MODE:
g_eeGeneral.serial2Mode = selectMenuItem(HW_SETTINGS_COLUMN, y, STR_UART3MODE, STR_UART3MODES, g_eeGeneral.serial2Mode, 0, UART_MODE_MAX, attr, event);
g_eeGeneral.serial2Mode = editChoice(HW_SETTINGS_COLUMN, y, STR_UART3MODE, STR_UART3MODES, g_eeGeneral.serial2Mode, 0, UART_MODE_MAX, attr, event);
if (attr && checkIncDec_Ret) {
serial2Init(g_eeGeneral.serial2Mode, MODEL_TELEMETRY_PROTOCOL());
}
+8 -8
View File
@@ -33,7 +33,7 @@ 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); \
}
#if defined(SPLASH) && !defined(FSPLASH)
@@ -215,7 +215,7 @@ void menuRadioSetup(uint8_t event)
break;
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
@@ -298,7 +298,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:
@@ -355,7 +355,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:
@@ -419,13 +419,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
@@ -442,7 +442,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;
#if defined(FAI_CHOICE)
@@ -459,7 +459,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
+3 -3
View File
@@ -129,7 +129,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);
@@ -140,10 +140,10 @@ select_menu_value_t selectMenuItem(coord_t x, coord_t y, const pm_char *label, c
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const pm_char *label, LcdFlags attr, uint8_t event )
{
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);
}
swsrc_t switchMenuItem(coord_t x, coord_t y, swsrc_t value, LcdFlags attr, uint8_t event)
swsrc_t editSwitch(coord_t x, coord_t y, swsrc_t value, LcdFlags attr, uint8_t event)
{
drawFieldLabel(x, y, STR_SWITCH);
drawSwitch(x, y, value, attr);