mirror of
https://github.com/opentx/opentx.git
synced 2025-07-26 09:45:21 +03:00
parent
5ca7cbc91e
commit
6ec64b227c
2 changed files with 21 additions and 7 deletions
|
@ -70,7 +70,7 @@ void onCustomFunctionsFileSelectionMenu(const char * result)
|
||||||
}
|
}
|
||||||
#endif // CPUARM && SDCARD
|
#endif // CPUARM && SDCARD
|
||||||
|
|
||||||
#if defined(PCBX7)
|
#if defined(PCBTARANIS)
|
||||||
|
|
||||||
void onAdjustGvarSourceLongEnterPress(const char * result)
|
void onAdjustGvarSourceLongEnterPress(const char * result)
|
||||||
{
|
{
|
||||||
|
@ -103,7 +103,7 @@ void onAdjustGvarSourceLongEnterPress(const char * result)
|
||||||
|
|
||||||
void onCustomFunctionsMenu(const char * result)
|
void onCustomFunctionsMenu(const char * result)
|
||||||
{
|
{
|
||||||
int sub = menuVerticalPosition;
|
int sub = menuVerticalPosition - HEADER_LINE;
|
||||||
CustomFunctionData * cfn;
|
CustomFunctionData * cfn;
|
||||||
uint8_t eeFlags;
|
uint8_t eeFlags;
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ void onCustomFunctionsMenu(const char * result)
|
||||||
storageDirty(eeFlags);
|
storageDirty(eeFlags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // CPUARM
|
#endif // PCBTARANIS
|
||||||
|
|
||||||
void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomFunctionsContext * functionsContext)
|
void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomFunctionsContext * functionsContext)
|
||||||
{
|
{
|
||||||
|
@ -151,8 +151,14 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||||
uint8_t eeFlags = EE_MODEL;
|
uint8_t eeFlags = EE_MODEL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBX7)
|
#if defined(PCBTARANIS)
|
||||||
|
#if defined(PCBXLITE)
|
||||||
|
if (menuHorizontalPosition==0 && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) {
|
||||||
|
killEvents(KEY_ENTER);
|
||||||
|
if (IS_SHIFT_PRESSED()) { // ENT LONG on xlite brings up switch type menu, so this menu is activated with SHIT + ENT LONG
|
||||||
|
#else
|
||||||
if (menuHorizontalPosition<0 && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) {
|
if (menuHorizontalPosition<0 && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) {
|
||||||
|
#endif
|
||||||
killEvents(event);
|
killEvents(event);
|
||||||
CustomFunctionData *cfn = &functions[sub];
|
CustomFunctionData *cfn = &functions[sub];
|
||||||
if (!CFN_EMPTY(cfn))
|
if (!CFN_EMPTY(cfn))
|
||||||
|
@ -171,7 +177,10 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||||
}
|
}
|
||||||
POPUP_MENU_START(onCustomFunctionsMenu);
|
POPUP_MENU_START(onCustomFunctionsMenu);
|
||||||
}
|
}
|
||||||
#endif // PCBX7
|
#if defined(PCBXLITE)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif // PCBTARANIS
|
||||||
|
|
||||||
for (uint8_t 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;
|
coord_t y = MENU_HEADER_HEIGHT + 1 + i*FH;
|
||||||
|
|
|
@ -438,7 +438,7 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
|
||||||
|
|
||||||
#if defined(PCBXLITE)
|
#if defined(PCBXLITE)
|
||||||
if (i_flags & INCDEC_SOURCE) {
|
if (i_flags & INCDEC_SOURCE) {
|
||||||
if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
if (event == EVT_KEY_LONG(KEY_ENTER) && !IS_SHIFT_PRESSED()) {
|
||||||
killEvents(event);
|
killEvents(event);
|
||||||
checkIncDecSelection = MIXSRC_NONE;
|
checkIncDecSelection = MIXSRC_NONE;
|
||||||
|
|
||||||
|
@ -487,7 +487,7 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (i_flags & INCDEC_SWITCH) {
|
else if (i_flags & INCDEC_SWITCH) {
|
||||||
if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
if (event == EVT_KEY_LONG(KEY_ENTER) && !IS_SHIFT_PRESSED()) {
|
||||||
killEvents(event);
|
killEvents(event);
|
||||||
checkIncDecSelection = SWSRC_NONE;
|
checkIncDecSelection = SWSRC_NONE;
|
||||||
if (i_min <= SWSRC_FIRST_SWITCH && i_max >= SWSRC_LAST_SWITCH) POPUP_MENU_ADD_ITEM(STR_MENU_SWITCHES);
|
if (i_min <= SWSRC_FIRST_SWITCH && i_max >= SWSRC_LAST_SWITCH) POPUP_MENU_ADD_ITEM(STR_MENU_SWITCHES);
|
||||||
|
@ -896,7 +896,12 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t
|
||||||
menuHorizontalPosition = l_posHorz;
|
menuHorizontalPosition = l_posHorz;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
#if defined(PCBXLITE)
|
||||||
|
#define MAXCOL_RAW(row) (horTab ? pgm_read_byte(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0)
|
||||||
|
#define MAXCOL(row) (MAXCOL_RAW(row) >= HIDDEN_ROW ? MAXCOL_RAW(row) : (const uint8_t)(MAXCOL_RAW(row) & (~NAVIGATION_LINE_BY_LINE)))
|
||||||
|
#else
|
||||||
#define MAXCOL(row) (horTab ? pgm_read_byte(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0)
|
#define MAXCOL(row) (horTab ? pgm_read_byte(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0)
|
||||||
|
#endif
|
||||||
#define POS_HORZ_INIT(posVert) 0
|
#define POS_HORZ_INIT(posVert) 0
|
||||||
|
|
||||||
void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow)
|
void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue