diff --git a/openrtx/src/ui/ui.c b/openrtx/src/ui/ui.c index 0ad8305c..d47aa08c 100644 --- a/openrtx/src/ui/ui.c +++ b/openrtx/src/ui/ui.c @@ -85,6 +85,7 @@ static uint16_t functionLatchTimer = 0; // 3000 ms. #define FUNCTION_LATCH_TIMEOUT 3000 + // When a key is pressed while Moni is latched, the latch timer is restarted. static void RestartFunctionLatchTimer() { @@ -101,16 +102,20 @@ static void ReleaseFunctionLatchIfNeeded() return; functionLatchTimer=0; + // Play beep for function latch release. } static void SetFunctionLatchTimer() { functionLatchTimer= getTick() + FUNCTION_LATCH_TIMEOUT; + // Play beep for set function latch. } + static bool FunctionKeyIsLatched() { return (functionLatchTimer > 0) && (getTick() < functionLatchTimer); } + /* UI main screen functions, their implementation is in "ui_main.c" */ extern void _ui_drawMainBackground(); extern void _ui_drawMainTop(); @@ -1110,7 +1115,6 @@ void ui_updateFSM(bool *sync_rtx) if (moniPressed && msg.long_press && !input_getPressedNumber(msg)) { SetFunctionLatchTimer(); // 3000 ms. - // Need to play beep to alert latch state enabled. } else {