extracted logic for testing if the function key is latched into its own function for readability.
This commit is contained in:
parent
bc7ce57f9b
commit
9038745b6f
|
|
@ -107,7 +107,10 @@ static void SetFunctionLatchTimer()
|
||||||
{
|
{
|
||||||
functionLatchTimer= getTick() + FUNCTION_LATCH_TIMEOUT;
|
functionLatchTimer= getTick() + FUNCTION_LATCH_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
static bool FunctionKeyIsLatched()
|
||||||
|
{
|
||||||
|
return (functionLatchTimer > 0) && (getTick() < functionLatchTimer);
|
||||||
|
}
|
||||||
/* UI main screen functions, their implementation is in "ui_main.c" */
|
/* UI main screen functions, their implementation is in "ui_main.c" */
|
||||||
extern void _ui_drawMainBackground();
|
extern void _ui_drawMainBackground();
|
||||||
extern void _ui_drawMainTop();
|
extern void _ui_drawMainTop();
|
||||||
|
|
@ -1100,7 +1103,7 @@ void ui_updateFSM(bool *sync_rtx)
|
||||||
|
|
||||||
// If MONI is pressed, activate MACRO functions
|
// If MONI is pressed, activate MACRO functions
|
||||||
bool moniPressed=(msg.keys & KEY_MONI) ? true : false;
|
bool moniPressed=(msg.keys & KEY_MONI) ? true : false;
|
||||||
if(moniPressed || ((functionLatchTimer > 0) && (getTick() < functionLatchTimer) ))
|
if(moniPressed || FunctionKeyIsLatched())
|
||||||
{
|
{
|
||||||
macro_menu = true;
|
macro_menu = true;
|
||||||
// long press moni on its own latches function.
|
// long press moni on its own latches function.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue