Move analogs and switches debugs for main RADIO menu, X9 version

This commit is contained in:
3djc
2019-03-16 10:57:03 +01:00
parent 9d7628e2bd
commit 0aa3153f4d
17 changed files with 48 additions and 36 deletions
+2 -5
View File
@@ -2,7 +2,7 @@
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
@@ -26,10 +26,7 @@ const MenuHandlerFunc menuTabGeneral[] = {
menuRadioSpecialFunctions,
menuRadioTrainer,
menuRadioVersion,
menuRadioDiagKeys,
menuRadioDiagAnalogs,
menuRadioHardware,
menuRadioCalibration
menuRadioHardware
};
void menuRadioSpecialFunctions(event_t event)
-3
View File
@@ -66,10 +66,7 @@ enum MenuRadioIndexes {
MENU_RADIO_SPECIAL_FUNCTIONS,
MENU_RADIO_TRAINER,
MENU_RADIO_VERSION,
MENU_RADIO_SWITCHES_TEST,
MENU_RADIO_ANALOGS_TEST,
MENU_RADIO_HARDWARE,
MENU_RADIO_CALIBRATION,
MENU_RADIO_PAGES_COUNT
};
+2 -2
View File
@@ -2,7 +2,7 @@
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
@@ -195,7 +195,7 @@ void menuCommonCalib(event_t event)
void menuRadioCalibration(event_t event)
{
check_simple(STR_MENUCALIBRATION, event, MENU_RADIO_CALIBRATION, menuTabGeneral, DIM(menuTabGeneral), 0);
check_submenu_simple(STR_MENUCALIBRATION, event, 0);
menuCommonCalib(READ_ONLY() ? 0 : event);
if (menuEvent) {
menuCalibrationState = CALIB_START;
+1 -1
View File
@@ -22,7 +22,7 @@
void menuRadioDiagAnalogs(event_t event)
{
SIMPLE_MENU(STR_MENU_RADIO_ANALOGS, menuTabGeneral, MENU_RADIO_ANALOGS_TEST, 0);
SIMPLE_SUBMENU(STR_MENU_RADIO_ANALOGS, 0);
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS+NUM_SLIDERS; i++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + (i/2)*FH;
+2 -2
View File
@@ -2,7 +2,7 @@
* Copyright (C) OpenTX
*
* Based on code named
* th9x - http://code.google.com/p/th9x
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
@@ -28,7 +28,7 @@ void displayKeyState(uint8_t x, uint8_t y, uint8_t key)
void menuRadioDiagKeys(event_t event)
{
SIMPLE_MENU(STR_MENU_RADIO_SWITCHES, menuTabGeneral, MENU_RADIO_SWITCHES_TEST, 1);
SIMPLE_SUBMENU(STR_MENU_RADIO_SWITCHES, 1);
lcdDrawText(14*FW, MENU_HEADER_HEIGHT+2*FH, STR_VTRIM);
+19 -1
View File
@@ -60,6 +60,7 @@ enum menuRadioHwItems {
#endif
ITEM_RADIO_HARDWARE_UART3_MODE,
ITEM_RADIO_HARDWARE_JITTER_FILTER,
ITEM_RADIO_HARDWARE_DEBUG,
ITEM_RADIO_HARDWARE_MAX
};
@@ -90,7 +91,7 @@ enum menuRadioHwItems {
void menuRadioHardware(event_t event)
{
MENU(STR_HARDWARE, menuTabGeneral, MENU_RADIO_HARDWARE, ITEM_RADIO_HARDWARE_MAX, { LABEL(Sticks), 0, 0, 0, 0, LABEL(Pots), POTS_ROWS, LABEL(Switches), SWITCHES_ROWS, BLUETOOTH_ROWS 0 });
MENU(STR_HARDWARE, menuTabGeneral, MENU_RADIO_HARDWARE, ITEM_RADIO_HARDWARE_MAX, { 0, 0, 0, 0, 0, LABEL(Pots), POTS_ROWS, LABEL(Switches), SWITCHES_ROWS, BLUETOOTH_ROWS 0, 1 });
uint8_t sub = menuVerticalPosition;
@@ -105,6 +106,10 @@ void menuRadioHardware(event_t event)
switch (k) {
case ITEM_RADIO_HARDWARE_LABEL_STICKS:
lcdDrawTextAlignedLeft(y, STR_STICKS);
lcdDrawText(HW_SETTINGS_COLUMN, y, STR_CALIB_BTN, attr);
if (attr && event == EVT_KEY_FIRST(KEY_ENTER)) {
pushMenu(menuRadioCalibration);
}
break;
case ITEM_RADIO_HARDWARE_STICK1:
case ITEM_RADIO_HARDWARE_STICK2:
@@ -233,6 +238,19 @@ void menuRadioHardware(event_t event)
g_eeGeneral.jitterFilter = 1 - editCheckBox(b, HW_SETTINGS_COLUMN, y, STR_JITTER_FILTER, attr, event);
break;
}
case ITEM_RADIO_HARDWARE_DEBUG:
lcdDrawTextAlignedLeft(y, STR_DEBUG);
lcdDrawText(HW_SETTINGS_COLUMN
, y, STR_ANALOGS_BTN, menuHorizontalPosition == 0 ? attr : 0);
lcdDrawText(lcdLastRightPos + 2, y, STR_SWITCHES_BTN, menuHorizontalPosition == 1 ? attr : 0);
if (attr && event == EVT_KEY_FIRST(KEY_ENTER)) {
if (menuHorizontalPosition == 0)
pushMenu(menuRadioDiagAnalogs);
else
pushMenu(menuRadioDiagKeys);
}
break;
}
}
}