Add diagnostic screens to colorlcd radios (#7140)
Add key diags screen to colorlcd radios
This commit is contained in:
@@ -184,6 +184,8 @@ bool menuModelSensor(event_t event);
|
||||
bool menuModelExpoOne(event_t event);
|
||||
bool menuModelModuleOptions(event_t event);
|
||||
bool menuModelReceiverOptions(event_t event);
|
||||
bool menuRadioDiagKeys(event_t event);
|
||||
bool menuRadioDiagAnalogs(event_t event);
|
||||
|
||||
extern const MenuHandlerFunc menuTabModel[MENU_MODEL_PAGES_COUNT];
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
constexpr coord_t LEFT_NAME_COLUMN = MENUS_MARGIN_LEFT;
|
||||
constexpr coord_t RIGHT_NAME_COLUMN = LCD_W / 2;
|
||||
constexpr coord_t ANA_OFFSET = 150;
|
||||
constexpr coord_t RAS_TOP_POSITION = LCD_H - 45;
|
||||
|
||||
bool menuRadioDiagAnalogs(event_t event)
|
||||
{
|
||||
SIMPLE_SUBMENU(STR_MENU_RADIO_ANALOGS, ICON_MODEL_SETUP, 0);
|
||||
|
||||
for (uint8_t i = 0; i < NUM_STICKS + NUM_POTS + NUM_SLIDERS; i++) {
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + (i / 2) * FH;
|
||||
uint8_t x = i & 1 ? LCD_W / 2 + 10 : LEFT_NAME_COLUMN;
|
||||
lcdDrawNumber(x, y, i + 1, LEADING0 | LEFT, 2);
|
||||
lcdDrawChar(x + 2 * 15 - 2, y, ':');
|
||||
lcdDrawHexNumber(x + 3 * 15 - 1, y, anaIn(i));
|
||||
#if defined(JITTER_MEASURE)
|
||||
lcdDrawNumber(x + ANA_OFFSET - 1, y, rawJitter[i].get(), RIGHT);
|
||||
lcdDrawNumber(x + ANA_OFFSET + 30 - 1, y, avgJitter[i].get(), RIGHT);
|
||||
lcdDrawNumber(x + ANA_OFFSET + 70 - 1, y, (int16_t) calibratedAnalogs[CONVERT_MODE(i)] * 25 / 256, RIGHT);
|
||||
#else
|
||||
lcdDrawNumber(x + ANA_OFFSET - 1, y, (int16_t) calibratedAnalogs[CONVERT_MODE(i)] * 25 / 256, RIGHT);
|
||||
#endif
|
||||
}
|
||||
|
||||
// RAS
|
||||
if ((isModuleXJT(INTERNAL_MODULE) && IS_INTERNAL_MODULE_ON()) || (isModulePXX1(EXTERNAL_MODULE) && !IS_INTERNAL_MODULE_ON())) {
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, RAS_TOP_POSITION, "RAS : ");
|
||||
lcdDrawNumber(lcdNextPos, RAS_TOP_POSITION, telemetryData.swrInternal.value(), 0);
|
||||
lcdDrawText(LCD_W / 2, RAS_TOP_POSITION, "XJTVER : ");
|
||||
lcdDrawNumber(lcdNextPos, RAS_TOP_POSITION, telemetryData.xjtVersion, 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
constexpr coord_t TRIM_COLUMN = LCD_W - 120;
|
||||
constexpr coord_t TRIM_MINUS_COLUMN = TRIM_COLUMN + 60;
|
||||
constexpr coord_t TRIM_PLUS_COLUMN = TRIM_MINUS_COLUMN + 20;
|
||||
constexpr coord_t SWITCHES_COLUMN = LCD_W / 2 - 20;
|
||||
|
||||
#if defined(KEYS_GPIO_PIN_PGUP)
|
||||
constexpr uint8_t KEY_START = 0;
|
||||
#else
|
||||
constexpr uint8_t KEY_START = 1;
|
||||
#endif
|
||||
|
||||
void displayKeyState(coord_t x, coord_t y, uint8_t key)
|
||||
{
|
||||
uint8_t t = keys[key].state();
|
||||
lcdDrawChar(x, y, t + '0', t ? INVERS : 0);
|
||||
}
|
||||
|
||||
bool menuRadioDiagKeys(event_t event)
|
||||
{
|
||||
SIMPLE_SUBMENU(STR_MENU_RADIO_SWITCHES, ICON_MODEL_SETUP, 1);
|
||||
|
||||
lcdDrawText(TRIM_COLUMN, MENU_HEADER_HEIGHT + 1, "Trims");
|
||||
lcdDrawText(TRIM_MINUS_COLUMN, MENU_HEADER_HEIGHT + 1, "-");
|
||||
lcdDrawText(TRIM_PLUS_COLUMN, MENU_HEADER_HEIGHT + 1, "+");
|
||||
|
||||
for (uint8_t i = 0; i < NUM_TRIMS_KEYS; i++) {
|
||||
const uint8_t trimMap[NUM_TRIMS_KEYS] = {6, 7, 4 , 5, 2, 3, 0, 1, 8, 9, 10, 11};
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + FH + FH * (i / 2);
|
||||
if (i & 1) {
|
||||
lcdDrawText(TRIM_COLUMN, y, "T", 0);
|
||||
lcdDrawNumber(lcdNextPos, y, i / 2 + 1, 0);
|
||||
}
|
||||
displayKeyState(i & 1 ? TRIM_PLUS_COLUMN : TRIM_MINUS_COLUMN, y, TRM_BASE + trimMap[i]);
|
||||
}
|
||||
|
||||
for (uint8_t i = KEY_START; i <= 6; i++) {
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + FH * (i - KEY_START);
|
||||
lcdDrawTextAtIndex(MENUS_MARGIN_LEFT, y, STR_VKEYS, (i), 0);
|
||||
displayKeyState(70, y, i);
|
||||
}
|
||||
|
||||
for (uint8_t i = 0; i <= NUM_SWITCHES; i++) {
|
||||
if (SWITCH_EXISTS(i)) {
|
||||
coord_t y = MENU_HEADER_HEIGHT + 1 + FH * i;
|
||||
getvalue_t val = getValue(MIXSRC_FIRST_SWITCH + i);
|
||||
getvalue_t sw = ((val < 0) ? 3 * i + 1 : ((val == 0) ? 3 * i + 2 : 3 * i + 3));
|
||||
drawSwitch(SWITCHES_COLUMN, y, sw, 0, false);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
coord_t y = MENU_HEADER_HEIGHT + FH * (8 - KEY_START);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_ROTARY_ENCODER);
|
||||
lcdDrawNumber(70, y, rotencValue, 0);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -72,6 +72,7 @@ enum MenuRadioHardwareItems {
|
||||
#endif
|
||||
|
||||
ITEM_RADIO_HARDWARE_JITTER_FILTER,
|
||||
ITEM_RADIO_HARDWARE_DEBUG,
|
||||
ITEM_RADIO_HARDWARE_MAX
|
||||
};
|
||||
|
||||
@@ -136,6 +137,7 @@ bool menuRadioHardware(event_t event)
|
||||
|
||||
0, /* aux serial mode */
|
||||
0, /* ADC filter */
|
||||
1, /* Debug */
|
||||
});
|
||||
|
||||
if (menuEvent) {
|
||||
@@ -348,6 +350,18 @@ bool menuRadioHardware(event_t event)
|
||||
g_eeGeneral.jitterFilter = 1 - editCheckBox(b, HW_SETTINGS_COLUMN+50, y, attr, event);
|
||||
break;
|
||||
}
|
||||
|
||||
case ITEM_RADIO_HARDWARE_DEBUG:
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_DEBUG);
|
||||
lcdDrawText(HW_SETTINGS_COLUMN + 50, y, STR_ANALOGS_BTN, menuHorizontalPosition == 0 ? attr : 0);
|
||||
lcdDrawText(lcdNextPos + 10, y, STR_KEYS_BTN, menuHorizontalPosition == 1 ? attr : 0);
|
||||
if (attr && event == EVT_KEY_BREAK(KEY_ENTER)) {
|
||||
if (menuHorizontalPosition == 0)
|
||||
pushMenu(menuRadioDiagAnalogs);
|
||||
else
|
||||
pushMenu(menuRadioDiagKeys);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -139,6 +139,8 @@ set(GUI_SRC
|
||||
bitmaps.cpp
|
||||
radio_sdmanager.cpp
|
||||
radio_hardware.cpp
|
||||
radio_diagkeys.cpp
|
||||
radio_diaganas.cpp
|
||||
model_inputs.cpp
|
||||
model_mixes.cpp
|
||||
model_curves.cpp
|
||||
|
||||
@@ -286,8 +286,8 @@
|
||||
#define TR_VSWASHTYPE "---\0""120\0""120X""140\0""90\0"
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define LEN_VKEYS "\006"
|
||||
#define TR_VKEYS "Menu\0 ""Exit\0 ""Enter\0""Nahoru""Dolů\0 ""Vpravo""Vlevo"
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "PGUP\0""PGDN\0""ENTER""MDL\0 ""RTN\0 ""TELE\0""SYS\0 "
|
||||
#elif defined(RADIO_T12)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Exit\0""Enter""Dolů\0""Nhoru""Vprvo""Vlevo"
|
||||
|
||||
@@ -289,8 +289,8 @@
|
||||
#define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90\0"
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define LEN_VKEYS "\006"
|
||||
#define TR_VKEYS "Menu\0 ""Exit\0 ""Enter\0""Up\0 ""Down\0 ""Right\0""Left"
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "PGUP\0""PGDN\0""ENTER""MDL\0 ""RTN\0 ""TELE\0""SYS\0 "
|
||||
#elif defined(PCBXLITE)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Shift""Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
|
||||
@@ -290,7 +290,7 @@
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Menu\0""Exit\0""Enter""Up\0 ""Down\0""Right""Left\0"
|
||||
#define TR_VKEYS "PGUP\0""PGDN\0""ENTER""MDL\0 ""RTN\0 ""TELE\0""SYS\0 "
|
||||
#elif defined(PCBXLITE)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Shift""Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
|
||||
@@ -305,7 +305,7 @@
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Menu\0""Exit\0""Enter""Up\0 ""Down\0""Right""Left\0"
|
||||
#define TR_VKEYS "PGUP\0""PGDN\0""ENTER""MDL\0 ""RTN\0 ""TELE\0""SYS\0 "
|
||||
#elif defined(PCBXLITE)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Shift""Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
|
||||
@@ -305,7 +305,7 @@
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Menu\0""Exit\0""Enter""Up\0 ""Down\0""Right""Left\0"
|
||||
#define TR_VKEYS "PGUP\0""PGDN\0""ENTER""MDL\0 ""RTN\0 ""TELE\0""SYS\0 "
|
||||
#elif defined(PCBXLITE)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Shift""Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
|
||||
@@ -306,8 +306,8 @@
|
||||
#define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90\0"
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define LEN_VKEYS "\006"
|
||||
#define TR_VKEYS "Menu\0 ""Exit\0 ""Entree""Haut\0 ""Bas\0 ""Droit\0""Gauche"
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "PGUP\0""PGDN\0""ENTER""MDL\0 ""RTN\0 ""TELE\0""SYS\0 "
|
||||
#elif defined(PCBXLITE)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Shift""Exit\0""Enter""Bas\0 ""Haut\0""Droit""Gauch"
|
||||
|
||||
@@ -308,7 +308,7 @@
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Menu\0""Exit\0""Enter""Up\0 ""Down\0""Right""Left\0"
|
||||
#define TR_VKEYS "PGUP\0""PGDN\0""ENTER""MDL\0 ""RTN\0 ""TELE\0""SYS\0 "
|
||||
#elif defined(PCBXLITE)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Shift""Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
|
||||
@@ -290,8 +290,8 @@
|
||||
#define TR_VSWASHTYPE "---\0""120\0""120X""140\0""90\0"
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define LEN_VKEYS "\006"
|
||||
#define TR_VKEYS "Menu\0 ""Exit\0 ""Enter\0""Up\0 ""Down\0 ""Right\0""Left"
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "PGUP\0""PGDN\0""ENTER""MDL\0 ""RTN\0 ""TELE\0""SYS\0 "
|
||||
#elif defined(RADIO_T12)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
|
||||
@@ -308,7 +308,7 @@
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Menu\0""Exit\0""Enter""Up\0 ""Down\0""Right""Left\0"
|
||||
#define TR_VKEYS "PGUP\0""PGDN\0""ENTER""MDL\0 ""RTN\0 ""TELE\0""SYS\0 "
|
||||
#elif defined(PCBXLITE)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Shift""Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
|
||||
@@ -304,8 +304,8 @@
|
||||
#define TR_VSWASHTYPE "--- ""120 ""120X""140 ""90\0 "
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define LEN_VKEYS "\006"
|
||||
#define TR_VKEYS "Menu\0 ""Exit\0 ""Enter\0""Upp\0 ""Ned\0 ""Höger\0""Vänst"
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "PGUP\0""PGDN\0""ENTER""MDL\0 ""RTN\0 ""TELE\0""SYS\0 "
|
||||
#elif defined(RADIO_T12)
|
||||
#define LEN_VKEYS "\005"
|
||||
#define TR_VKEYS "Exit\0""Enter""Down\0""Up\0 ""Right""Left\0"
|
||||
|
||||
Reference in New Issue
Block a user