Indication of current flight mode in global vars - 1st part: the 2
seconds
This commit is contained in:
@@ -4087,7 +4087,15 @@ void onGVARSMenu(const char *result)
|
|||||||
|
|
||||||
void menuModelGVars(uint8_t event)
|
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;
|
uint8_t sub = m_posVert - 1;
|
||||||
|
|
||||||
|
|||||||
@@ -358,6 +358,10 @@ void onLongMenuPress(const char *result)
|
|||||||
}
|
}
|
||||||
#endif
|
#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)
|
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;
|
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)
|
switch(event)
|
||||||
{
|
{
|
||||||
case EVT_ENTRY:
|
case EVT_ENTRY:
|
||||||
|
#if defined(CPUARM)
|
||||||
|
menuEntryTime = get_tmr10ms();
|
||||||
|
#endif
|
||||||
l_posVert = POS_VERT_INIT;
|
l_posVert = POS_VERT_INIT;
|
||||||
l_posHorz = POS_HORZ_INIT(l_posVert);
|
l_posHorz = POS_HORZ_INIT(l_posVert);
|
||||||
SET_SCROLLBAR_X(LCD_W-1);
|
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)
|
#if defined(PCBTARANIS)
|
||||||
case EVT_ENTRY_UP:
|
case EVT_ENTRY_UP:
|
||||||
|
menuEntryTime = get_tmr10ms();
|
||||||
s_editMode = 0;
|
s_editMode = 0;
|
||||||
l_posHorz = POS_HORZ_INIT(l_posVert);
|
l_posHorz = POS_HORZ_INIT(l_posVert);
|
||||||
SET_SCROLLBAR_X(LCD_W-1);
|
SET_SCROLLBAR_X(LCD_W-1);
|
||||||
|
|||||||
@@ -88,6 +88,10 @@ inline void displayColumnHeader(const char **headers, uint8_t index)
|
|||||||
#define horzpos_t uint8_t
|
#define horzpos_t uint8_t
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(CPUARM)
|
||||||
|
extern tmr10ms_t menuEntryTime;
|
||||||
|
#endif
|
||||||
|
|
||||||
extern vertpos_t m_posVert;
|
extern vertpos_t m_posVert;
|
||||||
extern horzpos_t m_posHorz;
|
extern horzpos_t m_posHorz;
|
||||||
extern vertpos_t s_pgOfs;
|
extern vertpos_t s_pgOfs;
|
||||||
|
|||||||
Reference in New Issue
Block a user