0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 06:39:49 +03:00

Keylock can be disabled to save 400 bytes.

This commit is contained in:
cloudwindy
2023-10-20 21:40:17 +08:00
parent 989f8cb56e
commit a81ecadfe1
19 changed files with 113 additions and 41 deletions

View File

@ -2125,6 +2125,7 @@ void APP_time_slice_500ms(void)
g_search_css_state == SEARCH_CSS_STATE_REPEAT))
{
#ifdef ENABLE_KEYLOCK
if (g_eeprom.auto_keypad_lock &&
g_key_lock_count_down_500ms > 0 &&
!g_dtmf_input_mode &&
@ -2137,6 +2138,7 @@ void APP_time_slice_500ms(void)
g_update_status = true;
}
}
#endif
if (exit_menu)
{
@ -2428,9 +2430,11 @@ static void APP_process_key(const key_code_t Key, const bool key_pressed, const
// stay awake - for now
g_battery_save_count_down_10ms = battery_save_count_10ms;
#ifdef ENABLE_KEYLOCK
// keep the auto keylock at bay
if (g_eeprom.auto_keypad_lock)
g_key_lock_count_down_500ms = key_lock_timeout_500ms;
#endif
if (g_fkey_pressed && (Key == KEY_PTT || Key == KEY_EXIT || Key == KEY_SIDE1 || Key == KEY_SIDE2))
{ // cancel the F-key
@ -2440,6 +2444,7 @@ static void APP_process_key(const key_code_t Key, const bool key_pressed, const
// ********************
#ifdef ENABLE_KEYLOCK
if (g_eeprom.key_lock && g_current_function != FUNCTION_TRANSMIT && Key != KEY_PTT)
{ // keyboard is locked
@ -2482,6 +2487,7 @@ static void APP_process_key(const key_code_t Key, const bool key_pressed, const
return;
}
}
#endif
// key beep
// if (Key != KEY_PTT && !key_held && key_pressed)

View File

@ -51,6 +51,7 @@ void GENERIC_Key_F(bool key_pressed, bool key_held)
if (key_held)
{ // f-key held
#ifdef ENABLE_KEYLOCK
if (key_pressed && g_screen_to_display != DISPLAY_MENU && g_current_function != FUNCTION_TRANSMIT)
{ // toggle the keyboad lock
@ -66,6 +67,7 @@ void GENERIC_Key_F(bool key_pressed, bool key_held)
g_keypad_locked = 4; // 2 second pop-up
g_update_display = true;
}
#endif
return;
}

View File

@ -249,7 +249,9 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
#endif
case MENU_BUSY_CHAN_LOCK:
case MENU_BEEP:
#ifdef ENABLE_KEYLOCK
case MENU_AUTO_KEY_LOCK:
#endif
case MENU_S_ADD1:
case MENU_S_ADD2:
case MENU_STE:
@ -614,10 +616,12 @@ void MENU_AcceptSetting(void)
g_eeprom.channel_display_mode = g_sub_menu_selection;
break;
#ifdef ENABLE_KEYLOCK
case MENU_AUTO_KEY_LOCK:
g_eeprom.auto_keypad_lock = g_sub_menu_selection;
g_key_lock_count_down_500ms = key_lock_timeout_500ms;
break;
#endif
case MENU_S_ADD1:
g_tx_vfo->scanlist_1_participation = g_sub_menu_selection;
@ -1091,9 +1095,11 @@ void MENU_ShowCurrentSetting(void)
g_sub_menu_selection = g_eeprom.channel_display_mode;
break;
#ifdef ENABLE_KEYLOCK
case MENU_AUTO_KEY_LOCK:
g_sub_menu_selection = g_eeprom.auto_keypad_lock;
break;
#endif
case MENU_S_ADD1:
g_sub_menu_selection = g_tx_vfo->scanlist_1_participation;