mirror of
https://github.com/opentx/opentx.git
synced 2025-07-24 16:55:20 +03:00
Indication of current flight mode in global vars - 1st part: the 2
seconds
This commit is contained in:
parent
eaefefa4f0
commit
62f921404e
3 changed files with 21 additions and 1 deletions
|
@ -4087,7 +4087,15 @@ void onGVARSMenu(const char *result)
|
|||
|
||||
void menuModelGVars(uint8_t event)
|
||||
{
|
||||
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});
|
||||
tmr10ms_t tmr10ms = get_tmr10ms();
|
||||
const char * menuTitle;
|
||||
|
||||
if (tmr10ms - menuEntryTime > 200/*2 seconds*/)
|
||||
menuTitle = "GLOBAL V."; // TODO translate
|
||||
else
|
||||
menuTitle = STR_MENUGLOBALVARS;
|
||||
|
||||
MENU(menuTitle, 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;
|
||||
|
||||
|
|
|
@ -358,6 +358,10 @@ void onLongMenuPress(const char *result)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
tmr10ms_t menuEntryTime;
|
||||
#endif
|
||||
|
||||
bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow)
|
||||
{
|
||||
vertpos_t l_posVert = m_posVert;
|
||||
|
@ -522,6 +526,9 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
|||
switch(event)
|
||||
{
|
||||
case EVT_ENTRY:
|
||||
#if defined(CPUARM)
|
||||
menuEntryTime = get_tmr10ms();
|
||||
#endif
|
||||
l_posVert = POS_VERT_INIT;
|
||||
l_posHorz = POS_HORZ_INIT(l_posVert);
|
||||
SET_SCROLLBAR_X(LCD_W-1);
|
||||
|
@ -538,6 +545,7 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
|
|||
|
||||
#if defined(PCBTARANIS)
|
||||
case EVT_ENTRY_UP:
|
||||
menuEntryTime = get_tmr10ms();
|
||||
s_editMode = 0;
|
||||
l_posHorz = POS_HORZ_INIT(l_posVert);
|
||||
SET_SCROLLBAR_X(LCD_W-1);
|
||||
|
|
|
@ -88,6 +88,10 @@ inline void displayColumnHeader(const char **headers, uint8_t index)
|
|||
#define horzpos_t uint8_t
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
extern tmr10ms_t menuEntryTime;
|
||||
#endif
|
||||
|
||||
extern vertpos_t m_posVert;
|
||||
extern horzpos_t m_posHorz;
|
||||
extern vertpos_t s_pgOfs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue