Remove unused latch timer functions
This commit is contained in:
parent
8399dcd3a3
commit
a3c7df2b3e
|
|
@ -79,8 +79,6 @@
|
||||||
#include <voicePromptUtils.h>
|
#include <voicePromptUtils.h>
|
||||||
#include <beeps.h>
|
#include <beeps.h>
|
||||||
|
|
||||||
#define FUNCTION_LATCH_TIMEOUT 3000
|
|
||||||
|
|
||||||
/* 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();
|
||||||
|
|
@ -264,7 +262,6 @@ static bool redraw_needed = true;
|
||||||
|
|
||||||
static bool standby = false;
|
static bool standby = false;
|
||||||
static long long last_event_tick = 0;
|
static long long last_event_tick = 0;
|
||||||
static uint16_t functionLatchTimer = 0;
|
|
||||||
|
|
||||||
// UI event queue
|
// UI event queue
|
||||||
static uint8_t evQueue_rdPos;
|
static uint8_t evQueue_rdPos;
|
||||||
|
|
@ -272,37 +269,6 @@ static uint8_t evQueue_wrPos;
|
||||||
static event_t evQueue[MAX_NUM_EVENTS];
|
static event_t evQueue[MAX_NUM_EVENTS];
|
||||||
|
|
||||||
|
|
||||||
static void RestartFunctionLatchTimer()
|
|
||||||
{
|
|
||||||
if (functionLatchTimer == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
functionLatchTimer = getTick() + FUNCTION_LATCH_TIMEOUT;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ReleaseFunctionLatchIfNeeded()
|
|
||||||
{
|
|
||||||
if (functionLatchTimer == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (getTick() < functionLatchTimer)
|
|
||||||
return;
|
|
||||||
|
|
||||||
functionLatchTimer = 0;
|
|
||||||
vp_beep(BEEP_FUNCTION_LATCH_OFF, LONG_BEEP);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void SetFunctionLatchTimer()
|
|
||||||
{
|
|
||||||
functionLatchTimer= getTick() + FUNCTION_LATCH_TIMEOUT;
|
|
||||||
vp_beep(BEEP_FUNCTION_LATCH_ON, LONG_BEEP);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool FunctionKeyIsLatched()
|
|
||||||
{
|
|
||||||
return (functionLatchTimer > 0) && (getTick() < functionLatchTimer);
|
|
||||||
}
|
|
||||||
|
|
||||||
static layout_t _ui_calculateLayout()
|
static layout_t _ui_calculateLayout()
|
||||||
{
|
{
|
||||||
// Horizontal line height
|
// Horizontal line height
|
||||||
|
|
@ -860,8 +826,6 @@ static bool _ui_exitStandby(long long now)
|
||||||
static void _ui_fsm_menuMacro(kbd_msg_t msg, bool *sync_rtx)
|
static void _ui_fsm_menuMacro(kbd_msg_t msg, bool *sync_rtx)
|
||||||
{
|
{
|
||||||
ui_state.input_number = input_getPressedNumber(msg);
|
ui_state.input_number = input_getPressedNumber(msg);
|
||||||
if (ui_state.input_number != 0)
|
|
||||||
RestartFunctionLatchTimer(); // reset the timer.
|
|
||||||
|
|
||||||
// CTCSS Encode/Decode Selection
|
// CTCSS Encode/Decode Selection
|
||||||
bool tone_tx_enable = state.channel.fm.txToneEn;
|
bool tone_tx_enable = state.channel.fm.txToneEn;
|
||||||
|
|
@ -973,7 +937,6 @@ static void _ui_fsm_menuMacro(kbd_msg_t msg, bool *sync_rtx)
|
||||||
state.settings.sqlLevel = platform_getChSelector() - 1;
|
state.settings.sqlLevel = platform_getChSelector() - 1;
|
||||||
*sync_rtx = true;
|
*sync_rtx = true;
|
||||||
vp_announceSquelch(state.settings.sqlLevel, queueFlags);
|
vp_announceSquelch(state.settings.sqlLevel, queueFlags);
|
||||||
RestartFunctionLatchTimer(); // reset the timer.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(msg.keys & KEY_LEFT || msg.keys & KEY_DOWN)
|
if(msg.keys & KEY_LEFT || msg.keys & KEY_DOWN)
|
||||||
|
|
@ -987,7 +950,6 @@ static void _ui_fsm_menuMacro(kbd_msg_t msg, bool *sync_rtx)
|
||||||
state.settings.sqlLevel -= 1;
|
state.settings.sqlLevel -= 1;
|
||||||
*sync_rtx = true;
|
*sync_rtx = true;
|
||||||
vp_announceSquelch(state.settings.sqlLevel, queueFlags);
|
vp_announceSquelch(state.settings.sqlLevel, queueFlags);
|
||||||
RestartFunctionLatchTimer(); // reset the timer.
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1002,7 +964,6 @@ static void _ui_fsm_menuMacro(kbd_msg_t msg, bool *sync_rtx)
|
||||||
state.settings.sqlLevel += 1;
|
state.settings.sqlLevel += 1;
|
||||||
*sync_rtx = true;
|
*sync_rtx = true;
|
||||||
vp_announceSquelch(state.settings.sqlLevel, queueFlags);
|
vp_announceSquelch(state.settings.sqlLevel, queueFlags);
|
||||||
RestartFunctionLatchTimer(); // reset the timer.
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2121,7 +2082,6 @@ void ui_updateFSM(bool *sync_rtx)
|
||||||
}
|
}
|
||||||
else if(event.type == EVENT_STATUS)
|
else if(event.type == EVENT_STATUS)
|
||||||
{
|
{
|
||||||
ReleaseFunctionLatchIfNeeded();
|
|
||||||
#ifdef GPS_PRESENT
|
#ifdef GPS_PRESENT
|
||||||
if ((state.ui_screen == MENU_GPS) &&
|
if ((state.ui_screen == MENU_GPS) &&
|
||||||
(!vp_isPlaying()) &&
|
(!vp_isPlaying()) &&
|
||||||
|
|
@ -2137,7 +2097,7 @@ void ui_updateFSM(bool *sync_rtx)
|
||||||
if (txOngoing || rtx_rxSquelchOpen())
|
if (txOngoing || rtx_rxSquelchOpen())
|
||||||
{
|
{
|
||||||
if (txOngoing)
|
if (txOngoing)
|
||||||
functionLatchTimer=0; // cancel the latch timer without beeping.
|
macro_latched = 0;
|
||||||
_ui_exitStandby(now);
|
_ui_exitStandby(now);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue