mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-06-19 22:58:04 +03:00
Keylock can be disabled to save 400 bytes.
This commit is contained in:
@ -34,6 +34,7 @@ void UI_DisplayFM(void)
|
||||
|
||||
memset(g_frame_buffer, 0, sizeof(g_frame_buffer));
|
||||
|
||||
#ifdef ENABLE_KEYLOCK
|
||||
if (g_eeprom.key_lock && g_keypad_locked > 0)
|
||||
{ // tell user how to unlock the keyboard
|
||||
backlight_turn_on(0);
|
||||
@ -42,6 +43,7 @@ void UI_DisplayFM(void)
|
||||
ST7565_BlitFullScreen();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
// *************************************
|
||||
// upper text line
|
||||
|
@ -262,8 +262,10 @@ void UI_drawBars(uint8_t *p, const unsigned int level)
|
||||
|
||||
char s[16];
|
||||
|
||||
#ifdef ENABLE_KEYLOCK
|
||||
if (g_eeprom.key_lock && g_keypad_locked > 0)
|
||||
return false; // display is in use
|
||||
#endif
|
||||
|
||||
if (g_current_function == FUNCTION_TRANSMIT ||
|
||||
g_screen_to_display != DISPLAY_MAIN ||
|
||||
@ -370,8 +372,10 @@ void UI_update_rssi(const int16_t rssi, const int vfo)
|
||||
|
||||
// **********************************************************
|
||||
|
||||
#ifdef ENABLE_KEYLOCK
|
||||
if (g_eeprom.key_lock && g_keypad_locked > 0)
|
||||
return; // display is in use
|
||||
#endif
|
||||
|
||||
if (g_current_function == FUNCTION_TRANSMIT || g_screen_to_display != DISPLAY_MAIN)
|
||||
return; // display is in use
|
||||
@ -420,6 +424,7 @@ void UI_DisplayMain(void)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_KEYLOCK
|
||||
if (g_eeprom.key_lock && g_keypad_locked > 0)
|
||||
{ // tell user how to unlock the keyboard
|
||||
backlight_turn_on(10); // 5 seconds
|
||||
@ -428,6 +433,7 @@ void UI_DisplayMain(void)
|
||||
ST7565_BlitFullScreen();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
for (vfo_num = 0; vfo_num < 2; vfo_num++)
|
||||
{
|
||||
|
@ -82,7 +82,9 @@ const t_menu_item g_menu_list[] =
|
||||
{"VOICE", VOICE_ID_VOICE_PROMPT, MENU_VOICE },
|
||||
#endif
|
||||
{"SC REV", VOICE_ID_INVALID, MENU_SCAN_CAR_RESUME }, // was "SC_REV"
|
||||
#ifdef ENABLE_KEYLOCK
|
||||
{"KeyLOC", VOICE_ID_INVALID, MENU_AUTO_KEY_LOCK }, // was "AUTOLk"
|
||||
#endif
|
||||
{"S ADD1", VOICE_ID_INVALID, MENU_S_ADD1 },
|
||||
{"S ADD2", VOICE_ID_INVALID, MENU_S_ADD2 },
|
||||
{"STE", VOICE_ID_INVALID, MENU_STE },
|
||||
@ -716,12 +718,14 @@ void UI_DisplayMenu(void)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_KEYLOCK
|
||||
case MENU_AUTO_KEY_LOCK:
|
||||
if (g_sub_menu_selection == 0)
|
||||
strcpy(String, "OFF");
|
||||
else
|
||||
sprintf(String, "%u secs", key_lock_timeout_500ms / 2);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case MENU_COMPAND:
|
||||
strcpy(String, g_sub_menu_rx_tx[g_sub_menu_selection]);
|
||||
|
18
ui/menu.h
18
ui/menu.h
@ -119,7 +119,9 @@ enum
|
||||
#ifdef ENABLE_VOICE
|
||||
MENU_VOICE,
|
||||
#endif
|
||||
#ifdef ENABLE_KEYLOCK
|
||||
MENU_AUTO_KEY_LOCK,
|
||||
#endif
|
||||
#ifdef ENABLE_SIDE_BUTT_MENU
|
||||
MENU_SIDE1_SHORT,
|
||||
MENU_SIDE1_LONG,
|
||||
@ -134,19 +136,19 @@ enum
|
||||
// ************************************
|
||||
// items after here are normally hidden
|
||||
|
||||
MENU_BAT_CAL, // battery voltage calibration
|
||||
MENU_BAT_CAL, // battery voltage calibration
|
||||
|
||||
#ifdef ENABLE_F_CAL_MENU
|
||||
MENU_F_CALI, // 26MHz reference xtal calibration
|
||||
MENU_F_CALI, // 26MHz reference xtal calibration
|
||||
#endif
|
||||
|
||||
MENU_SCRAMBLER_EN, // scrambler enable/disable
|
||||
MENU_FREQ_LOCK, // lock to a selected region
|
||||
MENU_350_EN, // 350~400MHz enable/disable
|
||||
MENU_174_TX, // 174~350MHz TX enable/disable
|
||||
MENU_350_TX, // 350~400MHz TX enable/disable
|
||||
MENU_470_TX, // 470MHz and up TX enable/disable
|
||||
MENU_TX_EN, // disable the TX entirely
|
||||
MENU_FREQ_LOCK, // lock to a selected region
|
||||
MENU_350_EN, // 350~400MHz enable/disable
|
||||
MENU_174_TX, // 174~350MHz TX enable/disable
|
||||
MENU_350_TX, // 350~400MHz TX enable/disable
|
||||
MENU_470_TX, // 470MHz and up TX enable/disable
|
||||
MENU_TX_EN, // disable the TX entirely
|
||||
|
||||
// ************************************
|
||||
// ************************************
|
||||
|
@ -178,6 +178,7 @@ void UI_DisplayStatus(const bool test_display)
|
||||
x += sizeof(BITMAP_VOX);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_KEYLOCK
|
||||
// KEY-LOCK indicator
|
||||
if (g_eeprom.key_lock || test_display)
|
||||
{
|
||||
@ -186,6 +187,7 @@ void UI_DisplayStatus(const bool test_display)
|
||||
x1 = x;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (g_fkey_pressed)
|
||||
{
|
||||
memmove(line + x, BITMAP_F_KEY, sizeof(BITMAP_F_KEY));
|
||||
|
Reference in New Issue
Block a user