[Taranis] Code cleaning
This commit is contained in:
@@ -928,11 +928,6 @@ void menuModelSetup(uint8_t event)
|
|||||||
pxxFlag[INTERNAL_MODULE] = 0;
|
pxxFlag[INTERNAL_MODULE] = 0;
|
||||||
pxxFlag[EXTERNAL_MODULE] = 0;
|
pxxFlag[EXTERNAL_MODULE] = 0;
|
||||||
}
|
}
|
||||||
if (event == EVT_KEY_LONG(KEY_MENU)) {
|
|
||||||
pushMenu(menuChannelsView);
|
|
||||||
killEvents(event);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
@@ -1713,14 +1708,6 @@ void editPhaseTrims(uint8_t x, uint8_t y, uint8_t phase, uint8_t event, uint8_t
|
|||||||
|
|
||||||
void menuModelFlightModesAll(uint8_t event)
|
void menuModelFlightModesAll(uint8_t event)
|
||||||
{
|
{
|
||||||
#if defined(PCBTARANIS)
|
|
||||||
if (event == EVT_KEY_LONG(KEY_MENU)) {
|
|
||||||
pushMenu(menuChannelsView);
|
|
||||||
killEvents(event);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
MENU(STR_MENUFLIGHTPHASES, menuTabModel, e_FlightModesAll, 1+MAX_PHASES+1, {0, NAVIGATION_LINE_BY_LINE|(ITEM_PHASES_LAST-2), NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, 0});
|
MENU(STR_MENUFLIGHTPHASES, menuTabModel, e_FlightModesAll, 1+MAX_PHASES+1, {0, NAVIGATION_LINE_BY_LINE|(ITEM_PHASES_LAST-2), NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, 0});
|
||||||
|
|
||||||
int8_t sub = m_posVert - 1;
|
int8_t sub = m_posVert - 1;
|
||||||
@@ -2064,14 +2051,6 @@ enum menuModelHeliItems {
|
|||||||
|
|
||||||
void menuModelHeli(uint8_t event)
|
void menuModelHeli(uint8_t event)
|
||||||
{
|
{
|
||||||
#if defined(PCBTARANIS)
|
|
||||||
if (event == EVT_KEY_LONG(KEY_MENU)) {
|
|
||||||
pushMenu(menuChannelsView);
|
|
||||||
killEvents(event);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SIMPLE_MENU(STR_MENUHELISETUP, menuTabModel, e_Heli, 7);
|
SIMPLE_MENU(STR_MENUHELISETUP, menuTabModel, e_Heli, 7);
|
||||||
|
|
||||||
uint8_t sub = m_posVert - 1;
|
uint8_t sub = m_posVert - 1;
|
||||||
@@ -3023,14 +3002,6 @@ void onExpoMixMenu(const char *result)
|
|||||||
|
|
||||||
void menuModelExpoMix(uint8_t expo, uint8_t event)
|
void menuModelExpoMix(uint8_t expo, uint8_t event)
|
||||||
{
|
{
|
||||||
#if defined(PCBTARANIS)
|
|
||||||
if (event == EVT_KEY_LONG(KEY_MENU)) {
|
|
||||||
pushMenu(menuChannelsView);
|
|
||||||
killEvents(event);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
uint8_t sub = m_posVert;
|
uint8_t sub = m_posVert;
|
||||||
|
|
||||||
if (s_editMode > 0)
|
if (s_editMode > 0)
|
||||||
@@ -3411,14 +3382,6 @@ void menuModelLimits(uint8_t event)
|
|||||||
{
|
{
|
||||||
uint8_t sub = m_posVert - 1;
|
uint8_t sub = m_posVert - 1;
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
|
||||||
if (event == EVT_KEY_LONG(KEY_MENU)) {
|
|
||||||
pushMenu(menuChannelsView);
|
|
||||||
killEvents(event);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (sub < NUM_CHNOUT) {
|
if (sub < NUM_CHNOUT) {
|
||||||
#if defined(PPM_CENTER_ADJUSTABLE) || defined(PPM_UNIT_US)
|
#if defined(PPM_CENTER_ADJUSTABLE) || defined(PPM_UNIT_US)
|
||||||
lcd_outdezAtt(13*FW, 0, PPM_CH_CENTER(sub)+channelOutputs[sub]/2, 0);
|
lcd_outdezAtt(13*FW, 0, PPM_CH_CENTER(sub)+channelOutputs[sub]/2, 0);
|
||||||
@@ -3616,12 +3579,6 @@ void menuModelCurvesAll(uint8_t event)
|
|||||||
pushMenu(menuModelCurveOne);
|
pushMenu(menuModelCurveOne);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#if defined(PCBTARANIS)
|
|
||||||
case EVT_KEY_LONG(KEY_MENU):
|
|
||||||
pushMenu(menuChannelsView);
|
|
||||||
killEvents(event);
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||||
@@ -3660,14 +3617,6 @@ void menuModelCurvesAll(uint8_t event)
|
|||||||
#if LCD_W >= 212 && defined(GVARS) && defined(FLIGHT_MODES)
|
#if LCD_W >= 212 && defined(GVARS) && defined(FLIGHT_MODES)
|
||||||
void menuModelGVars(uint8_t event)
|
void menuModelGVars(uint8_t event)
|
||||||
{
|
{
|
||||||
#if defined(PCBTARANIS)
|
|
||||||
if (event == EVT_KEY_LONG(KEY_MENU)) {
|
|
||||||
pushMenu(menuChannelsView);
|
|
||||||
killEvents(event);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
MENU(STR_MENUGLOBALVARS, menuTabModel, e_GVars, 1+MAX_GVARS, {0, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES});
|
MENU(STR_MENUGLOBALVARS, menuTabModel, e_GVars, 1+MAX_GVARS, {0, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES, NAVIGATION_LINE_BY_LINE|MAX_PHASES});
|
||||||
|
|
||||||
uint8_t sub = m_posVert - 1;
|
uint8_t sub = m_posVert - 1;
|
||||||
@@ -3949,14 +3898,6 @@ void menuModelCustomSwitches(uint8_t event)
|
|||||||
#define CHECK_INCDEC_CSPARAM(event, var, min, max) var=checkIncDec(event,var,min,max,incdecFlag)
|
#define CHECK_INCDEC_CSPARAM(event, var, min, max) var=checkIncDec(event,var,min,max,incdecFlag)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBTARANIS)
|
|
||||||
if (event == EVT_KEY_LONG(KEY_MENU)) {
|
|
||||||
pushMenu(menuChannelsView);
|
|
||||||
killEvents(event);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
MENU(STR_MENUCUSTOMSWITCHES, menuTabModel, e_CustomSwitches, NUM_CSW+1, {0, NAVIGATION_LINE_BY_LINE|CSW_FIELD_LAST/*repeated...*/});
|
MENU(STR_MENUCUSTOMSWITCHES, menuTabModel, e_CustomSwitches, NUM_CSW+1, {0, NAVIGATION_LINE_BY_LINE|CSW_FIELD_LAST/*repeated...*/});
|
||||||
|
|
||||||
uint8_t y = 0;
|
uint8_t y = 0;
|
||||||
@@ -4130,14 +4071,6 @@ void onCustomFunctionsMenu(const char *result)
|
|||||||
|
|
||||||
void menuModelCustomFunctions(uint8_t event)
|
void menuModelCustomFunctions(uint8_t event)
|
||||||
{
|
{
|
||||||
#if defined(PCBTARANIS)
|
|
||||||
if (event == EVT_KEY_LONG(KEY_MENU)) {
|
|
||||||
pushMenu(menuChannelsView);
|
|
||||||
killEvents(event);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
MENU(STR_MENUCUSTOMFUNC, menuTabModel, e_CustomFunctions, NUM_CFN+1, {0, NAVIGATION_LINE_BY_LINE|3/*repeated*/});
|
MENU(STR_MENUCUSTOMFUNC, menuTabModel, e_CustomFunctions, NUM_CFN+1, {0, NAVIGATION_LINE_BY_LINE|3/*repeated*/});
|
||||||
|
|
||||||
uint8_t y;
|
uint8_t y;
|
||||||
|
|||||||
@@ -327,6 +327,14 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
|||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
int8_t cc = curr;
|
int8_t cc = curr;
|
||||||
switch(event) {
|
switch(event) {
|
||||||
|
case EVT_KEY_LONG(KEY_MENU):
|
||||||
|
if (menuTab == menuTabModel) {
|
||||||
|
pushMenu(menuChannelsView);
|
||||||
|
killEvents(event);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case EVT_KEY_LONG(KEY_PAGE):
|
case EVT_KEY_LONG(KEY_PAGE):
|
||||||
if (curr > 0)
|
if (curr > 0)
|
||||||
cc = curr - 1;
|
cc = curr - 1;
|
||||||
|
|||||||
+4
-4
@@ -39,8 +39,6 @@
|
|||||||
|
|
||||||
#define NO_HI_LEN 25
|
#define NO_HI_LEN 25
|
||||||
|
|
||||||
typedef void (*MenuFuncP)(uint8_t event);
|
|
||||||
|
|
||||||
void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr);
|
void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr);
|
||||||
inline void displayColumnHeader(const char **headers, uint8_t index)
|
inline void displayColumnHeader(const char **headers, uint8_t index)
|
||||||
{
|
{
|
||||||
@@ -87,6 +85,10 @@ extern uint8_t s_noScroll;
|
|||||||
|
|
||||||
void menu_lcd_onoff(uint8_t x, uint8_t y, uint8_t value, LcdFlags attr);
|
void menu_lcd_onoff(uint8_t x, uint8_t y, uint8_t value, LcdFlags attr);
|
||||||
|
|
||||||
|
typedef void (*MenuFuncP)(uint8_t event);
|
||||||
|
typedef void (*MenuFuncP_PROGMEM)(uint8_t event);
|
||||||
|
extern const MenuFuncP_PROGMEM menuTabModel[];
|
||||||
|
|
||||||
extern MenuFuncP g_menuStack[5];
|
extern MenuFuncP g_menuStack[5];
|
||||||
extern uint8_t g_menuStackPtr;
|
extern uint8_t g_menuStackPtr;
|
||||||
|
|
||||||
@@ -198,8 +200,6 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
|||||||
bool check_simple(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, vertpos_t maxrow);
|
bool check_simple(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, vertpos_t maxrow);
|
||||||
bool check_submenu_simple(check_event_t event, uint8_t maxrow);
|
bool check_submenu_simple(check_event_t event, uint8_t maxrow);
|
||||||
|
|
||||||
typedef void (*MenuFuncP_PROGMEM)(uint8_t event);
|
|
||||||
|
|
||||||
void title(const pm_char * s);
|
void title(const pm_char * s);
|
||||||
#define TITLE(str) title(str)
|
#define TITLE(str) title(str)
|
||||||
|
|
||||||
|
|||||||
@@ -675,6 +675,10 @@ enum CswFunctions {
|
|||||||
#endif
|
#endif
|
||||||
extern uint8_t heartbeat;
|
extern uint8_t heartbeat;
|
||||||
|
|
||||||
|
#if defined(CPUARM)
|
||||||
|
void watchdogSetTimeout(uint32_t timeout);
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MAX_ALERT_TIME 60
|
#define MAX_ALERT_TIME 60
|
||||||
|
|
||||||
extern uint8_t inacPrescale;
|
extern uint8_t inacPrescale;
|
||||||
|
|||||||
Reference in New Issue
Block a user