0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-29 06:41:25 +03:00

Merge pull request #195 from cloudwindy/main

Make side button menu and keylock optional to save 1 kb of memory
This commit is contained in:
OneOfEleven 2023-10-20 14:53:54 +01:00 committed by GitHub
commit 76b6072a04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 204 additions and 105 deletions

View File

@ -3,21 +3,30 @@
# 0 = remove code # 0 = remove code
# 1 = include code # 1 = include code
# When testing the extra options, be careful not to exceed the
# 64 kb flash memory limit.
ENABLE_CLANG := 0 ENABLE_CLANG := 0
ENABLE_SWD := 0 ENABLE_SWD := 0
ENABLE_OVERLAY := 0 ENABLE_OVERLAY := 0
ENABLE_LTO := 1 ENABLE_LTO := 1
# UART Programming 2.9 kb
ENABLE_UART := 1 ENABLE_UART := 1
ENABLE_UART_DEBUG := 0 ENABLE_UART_DEBUG := 0
ENABLE_AIRCOPY := 1 ENABLE_AIRCOPY := 1
ENABLE_AIRCOPY_REMEMBER_FREQ := 1 ENABLE_AIRCOPY_REMEMBER_FREQ := 1
ENABLE_AIRCOPY_RX_REBOOT := 0 ENABLE_AIRCOPY_RX_REBOOT := 0
# FM Radio 4.2 kb
ENABLE_FMRADIO := 1 ENABLE_FMRADIO := 1
# NOAA 1.2 kb
ENABLE_NOAA := 0 ENABLE_NOAA := 0
# Voice 1.7 kb
ENABLE_VOICE := 0 ENABLE_VOICE := 0
ENABLE_MUTE_RADIO_FOR_VOICE := 1 ENABLE_MUTE_RADIO_FOR_VOICE := 1
# Tx on Voice 1.0 kb
ENABLE_VOX := 0 ENABLE_VOX := 0
ENABLE_REDUCE_LOW_MID_TX_POWER := 1 ENABLE_REDUCE_LOW_MID_TX_POWER := 1
# Tx Alarm 0.6 kb
ENABLE_ALARM := 0 ENABLE_ALARM := 0
ENABLE_TX1750 := 0 ENABLE_TX1750 := 0
ENABLE_PWRON_PASSWORD := 0 ENABLE_PWRON_PASSWORD := 0
@ -37,16 +46,25 @@ ENABLE_SHOW_CHARGE_LEVEL := 0
ENABLE_REVERSE_BAT_SYMBOL := 1 ENABLE_REVERSE_BAT_SYMBOL := 1
ENABLE_FREQ_SEARCH_TIMEOUT := 0 ENABLE_FREQ_SEARCH_TIMEOUT := 0
ENABLE_CODE_SEARCH_TIMEOUT := 0 ENABLE_CODE_SEARCH_TIMEOUT := 0
# Kill and Revive 0.4 kb
ENABLE_KILL_REVIVE := 0 ENABLE_KILL_REVIVE := 0
# AM Fix 0.8 kb
ENABLE_AM_FIX := 1 ENABLE_AM_FIX := 1
ENABLE_AM_FIX_SHOW_DATA := 0 ENABLE_AM_FIX_SHOW_DATA := 0
ENABLE_SQUELCH_MORE_SENSITIVE := 1 ENABLE_SQUELCH_MORE_SENSITIVE := 1
ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS := 1 ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS := 1
ENABLE_FASTER_CHANNEL_SCAN := 1 ENABLE_FASTER_CHANNEL_SCAN := 1
ENABLE_RX_SIGNAL_BAR := 1
ENABLE_TX_TIMEOUT_BAR := 0
ENABLE_TX_AUDIO_BAR := 1
ENABLE_COPY_CHAN_TO_VFO_TO_CHAN := 1 ENABLE_COPY_CHAN_TO_VFO_TO_CHAN := 1
# Rx Signal Bar 0.4 kb
ENABLE_RX_SIGNAL_BAR := 1
# Tx Timeout Bar 0.2 kb
ENABLE_TX_TIMEOUT_BAR := 0
# Tx Audio Bar 0.3 kb
ENABLE_TX_AUDIO_BAR := 1
# Side Button Menu 0.3 kb
ENABLE_SIDE_BUTT_MENU := 1
# Key Lock 0.4 kb
ENABLE_KEYLOCK := 1
#ENABLE_PANADAPTER := 0 #ENABLE_PANADAPTER := 0
#ENABLE_SINGLE_VFO_CHAN := 0 #ENABLE_SINGLE_VFO_CHAN := 0
@ -375,6 +393,12 @@ endif
ifeq ($(ENABLE_COPY_CHAN_TO_VFO_TO_CHAN),1) ifeq ($(ENABLE_COPY_CHAN_TO_VFO_TO_CHAN),1)
CFLAGS += -DENABLE_COPY_CHAN_TO_VFO_TO_CHAN CFLAGS += -DENABLE_COPY_CHAN_TO_VFO_TO_CHAN
endif endif
ifeq ($(ENABLE_SIDE_BUTT_MENU),1)
CFLAGS += -DENABLE_SIDE_BUTT_MENU
endif
ifeq ($(ENABLE_KEYLOCK),1)
CFLAGS += -DENABLE_KEYLOCK
endif
ifeq ($(ENABLE_SINGLE_VFO_CHAN),1) ifeq ($(ENABLE_SINGLE_VFO_CHAN),1)
CFLAGS += -DENABLE_SINGLE_VFO_CHAN CFLAGS += -DENABLE_SINGLE_VFO_CHAN
endif endif

View File

@ -37,20 +37,20 @@ You'll find the options at the top of "Makefile" ('0' = remove code, '1' = inclu
ENABLE_CLANG := 0 **experimental, builds with clang instead of gcc (LTO will be disabled if you enable this) ENABLE_CLANG := 0 **experimental, builds with clang instead of gcc (LTO will be disabled if you enable this)
ENABLE_SWD := 0 only needed if using CPU's SWD port (debugging/programming) ENABLE_SWD := 0 only needed if using CPU's SWD port (debugging/programming)
ENABLE_OVERLAY := 0 cpu FLASH stuff, not needed ENABLE_OVERLAY := 0 cpu FLASH stuff, not needed
ENABLE_LTO := 0 **experimental, reduces size of compiled firmware but might break EEPROM reads (OVERLAY will be disabled if you enable this) ENABLE_LTO := 1 **experimental, reduces size of compiled firmware but might break EEPROM reads (OVERLAY will be disabled if you enable this)
ENABLE_UART := 1 without this you can't configure radio via PC ENABLE_UART := 1 without this you can't configure radio via PC
ENABLE_UART_DEBUG := 0 just for code debugging, it sends debug info along the USB serial connection (programming lead) ENABLE_UART_DEBUG := 0 just for code debugging, it sends debug info along the USB serial connection (programming lead)
ENABLE_AIRCOPY := 1 clone radio-to-radio via RF ENABLE_AIRCOPY := 1 clone radio-to-radio via RF
ENABLE_AIRCOPY_REMEMBER_FREQ := 1 remember the aircopy frequency ENABLE_AIRCOPY_REMEMBER_FREQ := 1 remember the aircopy frequency
ENABLE_AIRCOPY_RX_REBOOT := 0 auto reboot on an aircopy successful RX completion ENABLE_AIRCOPY_RX_REBOOT := 0 auto reboot on an aircopy successful RX completion
ENABLE_FMRADIO := 1 WBFM VHF broadcast band receiver ENABLE_FMRADIO := 1 WBFM VHF broadcast band receiver
ENABLE_NOAA := 1 everything NOAA (only of any use in the USA) ENABLE_NOAA := 0 everything NOAA (only of any use in the USA)
ENABLE_VOICE := 0 want to hear voices ? ENABLE_VOICE := 0 want to hear voices ?
ENABLE_MUTE_RADIO_FOR_VOICE := 1 mute the radios audio when a voice is playing ENABLE_MUTE_RADIO_FOR_VOICE := 1 mute the radios audio when a voice is playing
ENABLE_VOX := 1 voice operated transmission ENABLE_VOX := 0 voice operated transmission
ENABLE_REDUCE_LOW_MID_TX_POWER := 1 reduce the low and mid TX power levels (high remains unchanged) ENABLE_REDUCE_LOW_MID_TX_POWER := 1 reduce the low and mid TX power levels (high remains unchanged)
ENABLE_ALARM := 1 TX alarms ENABLE_ALARM := 0 TX alarms
ENABLE_1750HZ := 1 side key 1750Hz TX tone (older style repeater access) ENABLE_1750HZ := 0 side key 1750Hz TX tone (older style repeater access)
ENABLE_PWRON_PASSWORD := 0 include power-on password code ENABLE_PWRON_PASSWORD := 0 include power-on password code
ENABLE_RESET_AES_KEY := 1 '1' = reset/clear the AES key stored in the eeprom (only if it's set) ENABLE_RESET_AES_KEY := 1 '1' = reset/clear the AES key stored in the eeprom (only if it's set)
ENABLE_BIG_FREQ := 0 big font frequencies (like original QS firmware) ENABLE_BIG_FREQ := 0 big font frequencies (like original QS firmware)
@ -66,18 +66,20 @@ ENABLE_BOOT_BEEPS := 0 gives user audio feedback on volume
ENABLE_DTMF_CALL_FLASH_LIGHT := 1 flash the flash light LED when a DTMF call is received ENABLE_DTMF_CALL_FLASH_LIGHT := 1 flash the flash light LED when a DTMF call is received
ENABLE_SHOW_CHARGE_LEVEL := 0 show the charge level when the radio is on charge ENABLE_SHOW_CHARGE_LEVEL := 0 show the charge level when the radio is on charge
ENABLE_REVERSE_BAT_SYMBOL := 1 mirror the battery symbol on the status bar (+ pole on the right) ENABLE_REVERSE_BAT_SYMBOL := 1 mirror the battery symbol on the status bar (+ pole on the right)
ENABLE_FREQ_SEARCH_TIMEOUT := 1 timeout if FREQ not found when using F+4 search function ENABLE_FREQ_SEARCH_TIMEOUT := 0 timeout if FREQ not found when using F+4 search function
ENABLE_CODE_SEARCH_TIMEOUT := 0 timeout if CTCSS/CDCSS not found when using F+* search function ENABLE_CODE_SEARCH_TIMEOUT := 0 timeout if CTCSS/CDCSS not found when using F+* search function
ENABLE_KILL_REVIVE := 0 include kill and revive code ENABLE_KILL_REVIVE := 0 include kill and revive code
ENABLE_AM_FIX := 1 dynamically adjust the front end gains when in AM mode to helo prevent AM demodulator saturation, ignore the on-screen RSSI level (for now) ENABLE_AM_FIX := 1 dynamically adjust the front end gains when in AM mode to help prevent AM demodulator saturation, ignore the on-screen RSSI level (for now)
ENABLE_AM_FIX_SHOW_DATA := 0 show debug data for the AM fix (still tweaking it) ENABLE_AM_FIX_SHOW_DATA := 1 show debug data for the AM fix (still tweaking it)
ENABLE_SQUELCH_MORE_SENSITIVE := 1 make squelch levels a little bit more sensitive - I plan to let user adjust the values themselves ENABLE_SQUELCH_MORE_SENSITIVE := 1 make squelch levels a little bit more sensitive - I plan to let user adjust the values themselves
ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS := 1 open the squelch when holding down UP or DN buttons when in frequency mode ENABLE_SQ_OPEN_WITH_UP_DN_BUTTS := 1 open the squelch when holding down UP or DN buttons when in frequency mode
ENABLE_FASTER_CHANNEL_SCAN := 1 increases the channel scan speed, but the squelch is also made more twitchy ENABLE_FASTER_CHANNEL_SCAN := 1 increase the channel scan speed, but also make the squelch more twitchy
ENABLE_COPY_CHAN_TO_VFO_TO_CHAN := 1 long press M, copy channel to VFO, or VFO to channel
ENABLE_RX_SIGNAL_BAR := 1 enable a dBm/Sn RSSI bar graph level inplace of the little antenna symbols ENABLE_RX_SIGNAL_BAR := 1 enable a dBm/Sn RSSI bar graph level inplace of the little antenna symbols
ENABLE_TX_TIMEOUT_BAR := 0 show the remainng TX time ENABLE_TX_TIMEOUT_BAR := 0 show the remainng TX time
ENABLE_TX_AUDIO_BAR := 1 enable TX audio level bar, includes remaining TX time (in seconds) ENABLE_TX_AUDIO_BAR := 1 enable TX audio level bar, includes remaining TX time (in seconds)
ENABLE_COPY_CHAN_TO_VFO_TO_CHAN := 1 long press M, copy channel to VFO, or VFO to channel ENABLE_SIDE_BUTT_MENU := 1 change programmable side buttons in menu
ENABLE_KEYLOCK := 1 auto lock after 30 sec or long press F to lock
#ENABLE_BAND_SCOPE := 0 not yet implemented - spectrum/pan-adapter #ENABLE_BAND_SCOPE := 0 not yet implemented - spectrum/pan-adapter
#ENABLE_SINGLE_VFO_CHAN := 0 not yet implemented - single VFO on display when possible #ENABLE_SINGLE_VFO_CHAN := 0 not yet implemented - single VFO on display when possible
``` ```

View File

@ -1538,12 +1538,14 @@ void APP_time_slice_10ms(void)
{ {
g_flash_light_blink_counter++; g_flash_light_blink_counter++;
#ifdef ENABLE_UART
if (UART_IsCommandAvailable()) if (UART_IsCommandAvailable())
{ {
__disable_irq(); __disable_irq();
UART_HandleCommand(); UART_HandleCommand();
__enable_irq(); __enable_irq();
} }
#endif
// *********** // ***********
@ -2123,6 +2125,7 @@ void APP_time_slice_500ms(void)
g_search_css_state == SEARCH_CSS_STATE_REPEAT)) g_search_css_state == SEARCH_CSS_STATE_REPEAT))
{ {
#ifdef ENABLE_KEYLOCK
if (g_eeprom.auto_keypad_lock && if (g_eeprom.auto_keypad_lock &&
g_key_lock_count_down_500ms > 0 && g_key_lock_count_down_500ms > 0 &&
!g_dtmf_input_mode && !g_dtmf_input_mode &&
@ -2135,6 +2138,7 @@ void APP_time_slice_500ms(void)
g_update_status = true; g_update_status = true;
} }
} }
#endif
if (exit_menu) if (exit_menu)
{ {
@ -2426,9 +2430,11 @@ static void APP_process_key(const key_code_t Key, const bool key_pressed, const
// stay awake - for now // stay awake - for now
g_battery_save_count_down_10ms = battery_save_count_10ms; g_battery_save_count_down_10ms = battery_save_count_10ms;
#ifdef ENABLE_KEYLOCK
// keep the auto keylock at bay // keep the auto keylock at bay
if (g_eeprom.auto_keypad_lock) if (g_eeprom.auto_keypad_lock)
g_key_lock_count_down_500ms = key_lock_timeout_500ms; 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)) if (g_fkey_pressed && (Key == KEY_PTT || Key == KEY_EXIT || Key == KEY_SIDE1 || Key == KEY_SIDE2))
{ // cancel the F-key { // cancel the F-key
@ -2438,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) if (g_eeprom.key_lock && g_current_function != FUNCTION_TRANSMIT && Key != KEY_PTT)
{ // keyboard is locked { // keyboard is locked
@ -2480,6 +2487,7 @@ static void APP_process_key(const key_code_t Key, const bool key_pressed, const
return; return;
} }
} }
#endif
// key beep // key beep
// if (Key != KEY_PTT && !key_held && key_pressed) // 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) if (key_held)
{ // f-key held { // f-key held
#ifdef ENABLE_KEYLOCK
if (key_pressed && g_screen_to_display != DISPLAY_MENU && g_current_function != FUNCTION_TRANSMIT) if (key_pressed && g_screen_to_display != DISPLAY_MENU && g_current_function != FUNCTION_TRANSMIT)
{ // toggle the keyboad lock { // 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_keypad_locked = 4; // 2 second pop-up
g_update_display = true; g_update_display = true;
} }
#endif
return; return;
} }

View File

@ -201,13 +201,15 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
break; break;
#endif #endif
case MENU_SIDE1_SHORT: #ifdef ENABLE_SIDE_BUTT_MENU
case MENU_SIDE1_LONG: case MENU_SIDE1_SHORT:
case MENU_SIDE2_SHORT: case MENU_SIDE1_LONG:
case MENU_SIDE2_LONG: case MENU_SIDE2_SHORT:
*pMin = 0; case MENU_SIDE2_LONG:
*pMax = ARRAY_SIZE(g_sub_menu_SIDE_BUTT) - 1; *pMin = 0;
break; *pMax = ARRAY_SIZE(g_sub_menu_SIDE_BUTT) - 1;
break;
#endif
case MENU_RESET: case MENU_RESET:
*pMin = 0; *pMin = 0;
@ -247,7 +249,9 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
#endif #endif
case MENU_BUSY_CHAN_LOCK: case MENU_BUSY_CHAN_LOCK:
case MENU_BEEP: case MENU_BEEP:
#ifdef ENABLE_KEYLOCK
case MENU_AUTO_KEY_LOCK: case MENU_AUTO_KEY_LOCK:
#endif
case MENU_S_ADD1: case MENU_S_ADD1:
case MENU_S_ADD2: case MENU_S_ADD2:
case MENU_STE: case MENU_STE:
@ -612,10 +616,12 @@ void MENU_AcceptSetting(void)
g_eeprom.channel_display_mode = g_sub_menu_selection; g_eeprom.channel_display_mode = g_sub_menu_selection;
break; break;
#ifdef ENABLE_KEYLOCK
case MENU_AUTO_KEY_LOCK: case MENU_AUTO_KEY_LOCK:
g_eeprom.auto_keypad_lock = g_sub_menu_selection; g_eeprom.auto_keypad_lock = g_sub_menu_selection;
g_key_lock_count_down_500ms = key_lock_timeout_500ms; g_key_lock_count_down_500ms = key_lock_timeout_500ms;
break; break;
#endif
case MENU_S_ADD1: case MENU_S_ADD1:
g_tx_vfo->scanlist_1_participation = g_sub_menu_selection; g_tx_vfo->scanlist_1_participation = g_sub_menu_selection;
@ -793,6 +799,7 @@ void MENU_AcceptSetting(void)
g_flag_reset_vfos = true; g_flag_reset_vfos = true;
return; return;
#ifdef ENABLE_SIDE_BUTT_MENU
case MENU_SIDE1_SHORT: case MENU_SIDE1_SHORT:
g_eeprom.key1_short_press_action = g_sub_menu_selection; g_eeprom.key1_short_press_action = g_sub_menu_selection;
break; break;
@ -808,6 +815,7 @@ void MENU_AcceptSetting(void)
case MENU_SIDE2_LONG: case MENU_SIDE2_LONG:
g_eeprom.key2_long_press_action = g_sub_menu_selection; g_eeprom.key2_long_press_action = g_sub_menu_selection;
break; break;
#endif
case MENU_RESET: case MENU_RESET:
BOARD_FactoryReset(g_sub_menu_selection); BOARD_FactoryReset(g_sub_menu_selection);
@ -844,11 +852,11 @@ void MENU_AcceptSetting(void)
g_setting_tx_enable = g_sub_menu_selection; g_setting_tx_enable = g_sub_menu_selection;
break; break;
#ifdef ENABLE_F_CAL_MENU #ifdef ENABLE_F_CAL_MENU
case MENU_F_CALI: case MENU_F_CALI:
writeXtalFreqCal(g_sub_menu_selection, true); writeXtalFreqCal(g_sub_menu_selection, true);
return; return;
#endif #endif
case MENU_BAT_CAL: case MENU_BAT_CAL:
{ {
@ -1014,11 +1022,11 @@ void MENU_ShowCurrentSetting(void)
break; break;
case MENU_MEM_SAVE: case MENU_MEM_SAVE:
#if 0 #if 0
g_sub_menu_selection = g_eeprom.user_channel[0]; g_sub_menu_selection = g_eeprom.user_channel[0];
#else #else
g_sub_menu_selection = g_eeprom.user_channel[g_eeprom.tx_vfo]; g_sub_menu_selection = g_eeprom.user_channel[g_eeprom.tx_vfo];
#endif #endif
break; break;
case MENU_MEM_NAME: case MENU_MEM_NAME:
@ -1029,11 +1037,11 @@ void MENU_ShowCurrentSetting(void)
g_sub_menu_selection = g_eeprom.battery_save; g_sub_menu_selection = g_eeprom.battery_save;
break; break;
#ifdef ENABLE_VOX #ifdef ENABLE_VOX
case MENU_VOX: case MENU_VOX:
g_sub_menu_selection = g_eeprom.vox_switch ? g_eeprom.vox_level + 1 : 0; g_sub_menu_selection = g_eeprom.vox_switch ? g_eeprom.vox_level + 1 : 0;
break; break;
#endif #endif
case MENU_AUTO_BACKLITE: case MENU_AUTO_BACKLITE:
g_sub_menu_selection = g_eeprom.backlight; g_sub_menu_selection = g_eeprom.backlight;
@ -1046,11 +1054,11 @@ void MENU_ShowCurrentSetting(void)
g_sub_menu_selection = g_setting_backlight_on_tx_rx; g_sub_menu_selection = g_setting_backlight_on_tx_rx;
break; break;
#ifdef ENABLE_CONTRAST #ifdef ENABLE_CONTRAST
case MENU_CONTRAST: case MENU_CONTRAST:
g_sub_menu_selection = g_setting_contrast; g_sub_menu_selection = g_setting_contrast;
break; break;
#endif #endif
case MENU_DUAL_WATCH: case MENU_DUAL_WATCH:
// g_sub_menu_selection = g_eeprom.dual_watch; // g_sub_menu_selection = g_eeprom.dual_watch;
@ -1073,11 +1081,11 @@ void MENU_ShowCurrentSetting(void)
g_sub_menu_selection = g_eeprom.tx_timeout_timer; g_sub_menu_selection = g_eeprom.tx_timeout_timer;
break; break;
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
case MENU_VOICE: case MENU_VOICE:
g_sub_menu_selection = g_eeprom.voice_prompt; g_sub_menu_selection = g_eeprom.voice_prompt;
break; break;
#endif #endif
case MENU_SCAN_CAR_RESUME: case MENU_SCAN_CAR_RESUME:
g_sub_menu_selection = g_eeprom.scan_resume_mode; g_sub_menu_selection = g_eeprom.scan_resume_mode;
@ -1087,9 +1095,11 @@ void MENU_ShowCurrentSetting(void)
g_sub_menu_selection = g_eeprom.channel_display_mode; g_sub_menu_selection = g_eeprom.channel_display_mode;
break; break;
#ifdef ENABLE_KEYLOCK
case MENU_AUTO_KEY_LOCK: case MENU_AUTO_KEY_LOCK:
g_sub_menu_selection = g_eeprom.auto_keypad_lock; g_sub_menu_selection = g_eeprom.auto_keypad_lock;
break; break;
#endif
case MENU_S_ADD1: case MENU_S_ADD1:
g_sub_menu_selection = g_tx_vfo->scanlist_1_participation; g_sub_menu_selection = g_tx_vfo->scanlist_1_participation;
@ -1111,17 +1121,17 @@ void MENU_ShowCurrentSetting(void)
g_sub_menu_selection = g_eeprom.mic_sensitivity; g_sub_menu_selection = g_eeprom.mic_sensitivity;
break; break;
#ifdef ENABLE_TX_AUDIO_BAR #ifdef ENABLE_TX_AUDIO_BAR
case MENU_TX_BAR: case MENU_TX_BAR:
g_sub_menu_selection = g_setting_mic_bar; g_sub_menu_selection = g_setting_mic_bar;
break; break;
#endif #endif
#ifdef ENABLE_RX_SIGNAL_BAR #ifdef ENABLE_RX_SIGNAL_BAR
case MENU_RX_BAR: case MENU_RX_BAR:
g_sub_menu_selection = g_setting_rssi_bar; g_sub_menu_selection = g_setting_rssi_bar;
break; break;
#endif #endif
case MENU_COMPAND: case MENU_COMPAND:
g_sub_menu_selection = g_tx_vfo->compand; g_sub_menu_selection = g_tx_vfo->compand;
@ -1143,11 +1153,11 @@ void MENU_ShowCurrentSetting(void)
g_sub_menu_selection = RADIO_FindNextChannel(0, 1, true, 1); g_sub_menu_selection = RADIO_FindNextChannel(0, 1, true, 1);
break; break;
#ifdef ENABLE_ALARM #ifdef ENABLE_ALARM
case MENU_ALARM_MODE: case MENU_ALARM_MODE:
g_sub_menu_selection = g_eeprom.alarm_mode; g_sub_menu_selection = g_eeprom.alarm_mode;
break; break;
#endif #endif
case MENU_DTMF_ST: case MENU_DTMF_ST:
g_sub_menu_selection = g_eeprom.dtmf_side_tone; g_sub_menu_selection = g_eeprom.dtmf_side_tone;
@ -1221,32 +1231,33 @@ void MENU_ShowCurrentSetting(void)
g_sub_menu_selection = g_tx_vfo->am_mode; g_sub_menu_selection = g_tx_vfo->am_mode;
break; break;
#ifdef ENABLE_AM_FIX #ifdef ENABLE_AM_FIX
case MENU_AM_FIX: case MENU_AM_FIX:
g_sub_menu_selection = g_setting_am_fix; g_sub_menu_selection = g_setting_am_fix;
break; break;
#endif #endif
#ifdef ENABLE_AM_FIX_TEST1 #ifdef ENABLE_AM_FIX_TEST1
case MENU_AM_FIX_TEST1: case MENU_AM_FIX_TEST1:
g_sub_menu_selection = g_setting_am_fix_test1; g_sub_menu_selection = g_setting_am_fix_test1;
break; break;
#endif #endif
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
case MENU_NOAA_SCAN: case MENU_NOAA_SCAN:
g_sub_menu_selection = g_eeprom.noaa_auto_scan; g_sub_menu_selection = g_eeprom.noaa_auto_scan;
break; break;
#endif #endif
case MENU_MEM_DEL: case MENU_MEM_DEL:
#if 0 #if 0
g_sub_menu_selection = RADIO_FindNextChannel(g_eeprom.user_channel[0], 1, false, 1); g_sub_menu_selection = RADIO_FindNextChannel(g_eeprom.user_channel[0], 1, false, 1);
#else #else
g_sub_menu_selection = RADIO_FindNextChannel(g_eeprom.user_channel[g_eeprom.tx_vfo], 1, false, 1); g_sub_menu_selection = RADIO_FindNextChannel(g_eeprom.user_channel[g_eeprom.tx_vfo], 1, false, 1);
#endif #endif
break; break;
#ifdef ENABLE_SIDE_BUTT_MENU
case MENU_SIDE1_SHORT: case MENU_SIDE1_SHORT:
g_sub_menu_selection = g_eeprom.key1_short_press_action; g_sub_menu_selection = g_eeprom.key1_short_press_action;
break; break;
@ -1262,6 +1273,7 @@ void MENU_ShowCurrentSetting(void)
case MENU_SIDE2_LONG: case MENU_SIDE2_LONG:
g_sub_menu_selection = g_eeprom.key2_long_press_action; g_sub_menu_selection = g_eeprom.key2_long_press_action;
break; break;
#endif
case MENU_350_TX: case MENU_350_TX:
g_sub_menu_selection = g_setting_350_tx_enable; g_sub_menu_selection = g_setting_350_tx_enable;
@ -1291,11 +1303,11 @@ void MENU_ShowCurrentSetting(void)
g_sub_menu_selection = g_setting_tx_enable; g_sub_menu_selection = g_setting_tx_enable;
break; break;
#ifdef ENABLE_F_CAL_MENU #ifdef ENABLE_F_CAL_MENU
case MENU_F_CALI: case MENU_F_CALI:
g_sub_menu_selection = g_eeprom.BK4819_xtal_freq_low; g_sub_menu_selection = g_eeprom.BK4819_xtal_freq_low;
break; break;
#endif #endif
case MENU_BAT_CAL: case MENU_BAT_CAL:
g_sub_menu_selection = g_battery_calibration[3]; g_sub_menu_selection = g_battery_calibration[3];
@ -1399,15 +1411,15 @@ static void MENU_Key_0_to_9(key_code_t Key, bool key_pressed, bool key_held)
if (g_input_box_index < 6) if (g_input_box_index < 6)
{ // invalid frequency { // invalid frequency
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
g_another_voice_id = (voice_id_t)Key; g_another_voice_id = (voice_id_t)Key;
#endif #endif
return; return;
} }
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
g_another_voice_id = (voice_id_t)Key; g_another_voice_id = (voice_id_t)Key;
#endif #endif
NUMBER_Get(g_input_box, &Frequency); NUMBER_Get(g_input_box, &Frequency);
g_sub_menu_selection = FREQUENCY_FloorToStep(Frequency + 75, g_tx_vfo->step_freq, 0); g_sub_menu_selection = FREQUENCY_FloorToStep(Frequency + 75, g_tx_vfo->step_freq, 0);
@ -1424,9 +1436,9 @@ static void MENU_Key_0_to_9(key_code_t Key, bool key_pressed, bool key_held)
if (g_input_box_index < 3) if (g_input_box_index < 3)
{ {
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
g_another_voice_id = (voice_id_t)Key; g_another_voice_id = (voice_id_t)Key;
#endif #endif
g_request_display_screen = DISPLAY_MENU; g_request_display_screen = DISPLAY_MENU;
return; return;
} }
@ -1437,9 +1449,9 @@ static void MENU_Key_0_to_9(key_code_t Key, bool key_pressed, bool key_held)
if (Value <= USER_CHANNEL_LAST) if (Value <= USER_CHANNEL_LAST)
{ // user channel { // user channel
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
g_another_voice_id = (voice_id_t)Key; g_another_voice_id = (voice_id_t)Key;
#endif #endif
g_sub_menu_selection = Value; g_sub_menu_selection = Value;
return; return;
} }
@ -1500,9 +1512,9 @@ static void MENU_Key_EXIT(bool key_pressed, bool key_held)
g_input_box_index = 0; g_input_box_index = 0;
g_flag_refresh_menu = true; g_flag_refresh_menu = true;
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
g_another_voice_id = VOICE_ID_CANCEL; g_another_voice_id = VOICE_ID_CANCEL;
#endif #endif
} }
else else
g_input_box[--g_input_box_index] = 10; g_input_box[--g_input_box_index] = 10;
@ -1513,9 +1525,9 @@ static void MENU_Key_EXIT(bool key_pressed, bool key_held)
return; return;
} }
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
g_another_voice_id = VOICE_ID_CANCEL; g_another_voice_id = VOICE_ID_CANCEL;
#endif #endif
g_request_display_screen = DISPLAY_MAIN; g_request_display_screen = DISPLAY_MAIN;
@ -1529,9 +1541,9 @@ static void MENU_Key_EXIT(bool key_pressed, bool key_held)
{ {
MENU_stop_css_scan(); MENU_stop_css_scan();
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
g_another_voice_id = VOICE_ID_SCANNING_STOP; g_another_voice_id = VOICE_ID_SCANNING_STOP;
#endif #endif
g_request_display_screen = DISPLAY_MENU; g_request_display_screen = DISPLAY_MENU;
} }
@ -1549,16 +1561,16 @@ static void MENU_Key_MENU(const bool key_pressed, const bool key_held)
if (!g_is_in_sub_menu) if (!g_is_in_sub_menu)
{ {
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
if (g_menu_cursor != MENU_SCRAMBLER) if (g_menu_cursor != MENU_SCRAMBLER)
g_another_voice_id = g_menu_list[g_menu_list_sorted[g_menu_cursor]].voice_id; g_another_voice_id = g_menu_list[g_menu_list_sorted[g_menu_cursor]].voice_id;
#endif #endif
#if 1 #if 1
if (g_menu_cursor == MENU_MEM_DEL || g_menu_cursor == MENU_MEM_NAME) if (g_menu_cursor == MENU_MEM_DEL || g_menu_cursor == MENU_MEM_NAME)
if (!RADIO_CheckValidChannel(g_sub_menu_selection, false, 0)) if (!RADIO_CheckValidChannel(g_sub_menu_selection, false, 0))
return; // invalid channel return; // invalid channel
#endif #endif
g_ask_for_confirmation = 0; g_ask_for_confirmation = 0;
g_is_in_sub_menu = true; g_is_in_sub_menu = true;
@ -1637,18 +1649,18 @@ static void MENU_Key_MENU(const bool key_pressed, const bool key_held)
if (g_menu_cursor == MENU_RESET) if (g_menu_cursor == MENU_RESET)
{ {
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
AUDIO_SetVoiceID(0, VOICE_ID_CONFIRM); AUDIO_SetVoiceID(0, VOICE_ID_CONFIRM);
AUDIO_PlaySingleVoice(true); AUDIO_PlaySingleVoice(true);
#endif #endif
MENU_AcceptSetting(); MENU_AcceptSetting();
#if defined(ENABLE_OVERLAY) #if defined(ENABLE_OVERLAY)
overlay_FLASH_RebootToBootloader(); overlay_FLASH_RebootToBootloader();
#else #else
NVIC_SystemReset(); NVIC_SystemReset();
#endif #endif
} }
g_flag_accept_setting = true; g_flag_accept_setting = true;
@ -1669,12 +1681,12 @@ static void MENU_Key_MENU(const bool key_pressed, const bool key_held)
g_update_status = true; g_update_status = true;
} }
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
if (g_menu_cursor == MENU_SCRAMBLER) if (g_menu_cursor == MENU_SCRAMBLER)
g_another_voice_id = (g_sub_menu_selection == 0) ? VOICE_ID_SCRAMBLER_OFF : VOICE_ID_SCRAMBLER_ON; g_another_voice_id = (g_sub_menu_selection == 0) ? VOICE_ID_SCRAMBLER_OFF : VOICE_ID_SCRAMBLER_ON;
else else
g_another_voice_id = VOICE_ID_CONFIRM; g_another_voice_id = VOICE_ID_CONFIRM;
#endif #endif
g_input_box_index = 0; g_input_box_index = 0;
} }
@ -1716,18 +1728,18 @@ static void MENU_Key_STAR(const bool key_pressed, const bool key_held)
{ {
MENU_start_css_scan(1); MENU_start_css_scan(1);
g_request_display_screen = DISPLAY_MENU; g_request_display_screen = DISPLAY_MENU;
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
AUDIO_SetVoiceID(0, VOICE_ID_SCANNING_BEGIN); AUDIO_SetVoiceID(0, VOICE_ID_SCANNING_BEGIN);
AUDIO_PlaySingleVoice(1); AUDIO_PlaySingleVoice(1);
#endif #endif
} }
else else
{ {
MENU_stop_css_scan(); MENU_stop_css_scan();
g_request_display_screen = DISPLAY_MENU; g_request_display_screen = DISPLAY_MENU;
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
g_another_voice_id = VOICE_ID_SCANNING_STOP; g_another_voice_id = VOICE_ID_SCANNING_STOP;
#endif #endif
} }
} }
@ -1921,9 +1933,9 @@ void MENU_process_key(key_code_t Key, bool key_pressed, bool key_held)
if (g_screen_to_display == DISPLAY_MENU) if (g_screen_to_display == DISPLAY_MENU)
{ {
if (g_menu_cursor == MENU_VOLTAGE || if (g_menu_cursor == MENU_VOLTAGE ||
#ifdef ENABLE_F_CAL_MENU #ifdef ENABLE_F_CAL_MENU
g_menu_cursor == MENU_F_CALI || g_menu_cursor == MENU_F_CALI ||
#endif #endif
g_menu_cursor == MENU_BAT_CAL) g_menu_cursor == MENU_BAT_CAL)
{ {
g_menu_count_down = menu_timeout_long_500ms; g_menu_count_down = menu_timeout_long_500ms;

View File

@ -111,15 +111,17 @@ const uint8_t BITMAP_USB_C[8] =
__extension__ 0b00011100 __extension__ 0b00011100
}; };
const uint8_t BITMAP_KEYLOCK[6] = #ifdef ENABLE_KEYLOCK
{ // teeny weeny padlock symbol const uint8_t BITMAP_KEYLOCK[6] =
__extension__ 0b00000000, { // teeny weeny padlock symbol
__extension__ 0b01111100, __extension__ 0b00000000,
__extension__ 0b01000110, __extension__ 0b01111100,
__extension__ 0b01000101, __extension__ 0b01000110,
__extension__ 0b01000110, __extension__ 0b01000101,
__extension__ 0b01111100 __extension__ 0b01000110,
}; __extension__ 0b01111100
};
#endif
const uint8_t BITMAP_F_KEY[6] = const uint8_t BITMAP_F_KEY[6] =
{ // F-Key symbol { // F-Key symbol

View File

@ -12,7 +12,9 @@ extern const uint8_t BITMAP_BATTERY_LEVEL[17];
extern const uint8_t BITMAP_USB_C[8]; extern const uint8_t BITMAP_USB_C[8];
extern const uint8_t BITMAP_KEYLOCK[6]; #ifdef ENABLE_KEYLOCK
extern const uint8_t BITMAP_KEYLOCK[6];
#endif
extern const uint8_t BITMAP_F_KEY[6]; extern const uint8_t BITMAP_F_KEY[6];

View File

@ -531,7 +531,9 @@ void BOARD_EEPROM_load(void)
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
g_eeprom.noaa_auto_scan = (Data[3] < 2) ? Data[3] : false; g_eeprom.noaa_auto_scan = (Data[3] < 2) ? Data[3] : false;
#endif #endif
g_eeprom.key_lock = (Data[4] < 2) ? Data[4] : false; #ifdef ENABLE_KEYLOCK
g_eeprom.key_lock = (Data[4] < 2) ? Data[4] : false;
#endif
#ifdef ENABLE_VOX #ifdef ENABLE_VOX
g_eeprom.vox_switch = (Data[5] < 2) ? Data[5] : false; g_eeprom.vox_switch = (Data[5] < 2) ? Data[5] : false;
g_eeprom.vox_level = (Data[6] < 10) ? Data[6] : 1; g_eeprom.vox_level = (Data[6] < 10) ? Data[6] : 1;

BIN
firmware.bin Normal file → Executable file

Binary file not shown.

Binary file not shown.

2
main.c
View File

@ -65,7 +65,9 @@ void Main(void)
| SYSCON_DEV_CLK_GATE_AES_BITS_ENABLE; | SYSCON_DEV_CLK_GATE_AES_BITS_ENABLE;
SYSTICK_Init(); SYSTICK_Init();
#ifdef ENABLE_UART
UART_Init(); UART_Init();
#endif
BOARD_Init(); BOARD_Init();
#if defined(ENABLE_UART) #if defined(ENABLE_UART)

12
misc.c
View File

@ -43,8 +43,10 @@ const uint8_t dtmf_txstop_countdown_500ms = 3000 / 500; // 6 sec
const uint8_t serial_config_count_down_500ms = 3000 / 500; // 3 seconds const uint8_t serial_config_count_down_500ms = 3000 / 500; // 3 seconds
const uint8_t key_input_timeout_500ms = 6000 / 500; // 6 seconds const uint8_t key_input_timeout_500ms = 6000 / 500; // 6 seconds
const uint8_t key_lock_timeout_500ms = 30000 / 500; // 30 seconds #ifdef ENABLE_KEYLOCK
const uint8_t key_lock_timeout_500ms = 30000 / 500; // 30 seconds
#endif
const uint8_t key_debounce_10ms = 30 / 10; // 30ms const uint8_t key_debounce_10ms = 30 / 10; // 30ms
const uint8_t key_long_press_10ms = 300 / 10; // 300ms const uint8_t key_long_press_10ms = 300 / 10; // 300ms
@ -159,8 +161,10 @@ volatile uint16_t g_tail_tone_elimination_count_down_10ms;
#endif #endif
bool g_enable_speaker; bool g_enable_speaker;
uint8_t g_key_input_count_down; uint8_t g_key_input_count_down;
uint8_t g_key_lock_count_down_500ms; #ifdef ENABLE_KEYLOCK
uint8_t g_key_lock_count_down_500ms;
#endif
uint8_t g_rtte_count_down; uint8_t g_rtte_count_down;
bool g_password_locked; bool g_password_locked;
uint8_t g_update_status; uint8_t g_update_status;

11
misc.h
View File

@ -129,7 +129,10 @@ extern const uint8_t dtmf_txstop_countdown_500ms;
extern const uint8_t serial_config_count_down_500ms; extern const uint8_t serial_config_count_down_500ms;
extern const uint8_t key_input_timeout_500ms; extern const uint8_t key_input_timeout_500ms;
extern const uint8_t key_lock_timeout_500ms;
#ifdef ENABLE_KEYLOCK
extern const uint8_t key_lock_timeout_500ms;
#endif
extern const uint8_t key_debounce_10ms; extern const uint8_t key_debounce_10ms;
extern const uint8_t key_long_press_10ms; extern const uint8_t key_long_press_10ms;
@ -245,7 +248,11 @@ extern volatile uint16_t g_tail_tone_elimination_count_down_10ms;
#endif #endif
extern bool g_enable_speaker; extern bool g_enable_speaker;
extern uint8_t g_key_input_count_down; extern uint8_t g_key_input_count_down;
extern uint8_t g_key_lock_count_down_500ms;
#ifdef ENABLE_KEYLOCK
extern uint8_t g_key_lock_count_down_500ms;
#endif
extern uint8_t g_rtte_count_down; extern uint8_t g_rtte_count_down;
extern bool g_password_locked; extern bool g_password_locked;
extern uint8_t g_update_status; extern uint8_t g_update_status;

View File

@ -741,7 +741,6 @@ void RADIO_setup_registers(bool switch_to_function_foreground)
!g_fm_radio_mode && !g_fm_radio_mode &&
#endif #endif
g_eeprom.vox_switch && g_eeprom.vox_switch &&
!g_fm_radio_mode &&
IS_NOT_NOAA_CHANNEL(g_current_vfo->channel_save) && IS_NOT_NOAA_CHANNEL(g_current_vfo->channel_save) &&
g_current_vfo->am_mode == 0) g_current_vfo->am_mode == 0)
{ {

View File

@ -200,7 +200,12 @@ void SETTINGS_save(void)
#else #else
State[3] = false; State[3] = false;
#endif #endif
State[4] = g_eeprom.key_lock;
#ifdef ENABLE_KEYLOCK
State[4] = g_eeprom.key_lock;
#else
State[4] = false;
#endif
#ifdef ENABLE_VOX #ifdef ENABLE_VOX
State[5] = g_eeprom.vox_switch; State[5] = g_eeprom.vox_switch;
State[6] = g_eeprom.vox_level; State[6] = g_eeprom.vox_level;

View File

@ -478,7 +478,9 @@ typedef struct {
uint8_t squelch_level; uint8_t squelch_level;
uint8_t tx_timeout_timer; uint8_t tx_timeout_timer;
bool key_lock; #ifdef ENABLE_KEYLOCK
bool key_lock;
#endif
bool vox_switch; bool vox_switch;
uint8_t vox_level; uint8_t vox_level;
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE

View File

@ -34,6 +34,7 @@ void UI_DisplayFM(void)
memset(g_frame_buffer, 0, sizeof(g_frame_buffer)); memset(g_frame_buffer, 0, sizeof(g_frame_buffer));
#ifdef ENABLE_KEYLOCK
if (g_eeprom.key_lock && g_keypad_locked > 0) if (g_eeprom.key_lock && g_keypad_locked > 0)
{ // tell user how to unlock the keyboard { // tell user how to unlock the keyboard
backlight_turn_on(0); backlight_turn_on(0);
@ -42,6 +43,7 @@ void UI_DisplayFM(void)
ST7565_BlitFullScreen(); ST7565_BlitFullScreen();
return; return;
} }
#endif
// ************************************* // *************************************
// upper text line // upper text line

View File

@ -263,8 +263,10 @@ void UI_drawBars(uint8_t *p, const unsigned int level)
char s[16]; char s[16];
#ifdef ENABLE_KEYLOCK
if (g_eeprom.key_lock && g_keypad_locked > 0) if (g_eeprom.key_lock && g_keypad_locked > 0)
return false; // display is in use return false; // display is in use
#endif
if (g_current_function == FUNCTION_TRANSMIT || if (g_current_function == FUNCTION_TRANSMIT ||
g_screen_to_display != DISPLAY_MAIN || g_screen_to_display != DISPLAY_MAIN ||
@ -371,8 +373,10 @@ void UI_update_rssi(const int16_t rssi, const int vfo)
// ********************************************************** // **********************************************************
#ifdef ENABLE_KEYLOCK
if (g_eeprom.key_lock && g_keypad_locked > 0) if (g_eeprom.key_lock && g_keypad_locked > 0)
return; // display is in use return; // display is in use
#endif
if (g_current_function == FUNCTION_TRANSMIT || g_screen_to_display != DISPLAY_MAIN) if (g_current_function == FUNCTION_TRANSMIT || g_screen_to_display != DISPLAY_MAIN)
return; // display is in use return; // display is in use
@ -422,6 +426,7 @@ void UI_DisplayMain(void)
return; return;
} }
#ifdef ENABLE_KEYLOCK
if (g_eeprom.key_lock && g_keypad_locked > 0) if (g_eeprom.key_lock && g_keypad_locked > 0)
{ // tell user how to unlock the keyboard { // tell user how to unlock the keyboard
backlight_turn_on(10); // 5 seconds backlight_turn_on(10); // 5 seconds
@ -430,6 +435,7 @@ void UI_DisplayMain(void)
ST7565_BlitFullScreen(); ST7565_BlitFullScreen();
return; return;
} }
#endif
for (vfo_num = 0; vfo_num < 2; vfo_num++) for (vfo_num = 0; vfo_num < 2; vfo_num++)
{ {

View File

@ -82,7 +82,9 @@ const t_menu_item g_menu_list[] =
{"VOICE", VOICE_ID_VOICE_PROMPT, MENU_VOICE }, {"VOICE", VOICE_ID_VOICE_PROMPT, MENU_VOICE },
#endif #endif
{"SC REV", VOICE_ID_INVALID, MENU_SCAN_CAR_RESUME }, // was "SC_REV" {"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" {"KeyLOC", VOICE_ID_INVALID, MENU_AUTO_KEY_LOCK }, // was "AUTOLk"
#endif
{"S ADD1", VOICE_ID_INVALID, MENU_S_ADD1 }, {"S ADD1", VOICE_ID_INVALID, MENU_S_ADD1 },
{"S ADD2", VOICE_ID_INVALID, MENU_S_ADD2 }, {"S ADD2", VOICE_ID_INVALID, MENU_S_ADD2 },
{"STE", VOICE_ID_INVALID, MENU_STE }, {"STE", VOICE_ID_INVALID, MENU_STE },
@ -127,10 +129,12 @@ const t_menu_item g_menu_list[] =
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
{"NOAA-S", VOICE_ID_INVALID, MENU_NOAA_SCAN }, {"NOAA-S", VOICE_ID_INVALID, MENU_NOAA_SCAN },
#endif #endif
#ifdef ENABLE_SIDE_BUTT_MENU
{"Side1S", VOICE_ID_INVALID, MENU_SIDE1_SHORT }, {"Side1S", VOICE_ID_INVALID, MENU_SIDE1_SHORT },
{"Side1L", VOICE_ID_INVALID, MENU_SIDE1_LONG }, {"Side1L", VOICE_ID_INVALID, MENU_SIDE1_LONG },
{"Side2S", VOICE_ID_INVALID, MENU_SIDE2_SHORT }, {"Side2S", VOICE_ID_INVALID, MENU_SIDE2_SHORT },
{"Side2L", VOICE_ID_INVALID, MENU_SIDE2_LONG }, {"Side2L", VOICE_ID_INVALID, MENU_SIDE2_LONG },
#endif
{"VER", VOICE_ID_INVALID, MENU_VERSION }, {"VER", VOICE_ID_INVALID, MENU_VERSION },
{"RESET", VOICE_ID_INITIALISATION, MENU_RESET }, // might be better to move this to the hidden menu items ? {"RESET", VOICE_ID_INITIALISATION, MENU_RESET }, // might be better to move this to the hidden menu items ?
@ -356,6 +360,7 @@ const char g_sub_MENU_SCRAMBLERAMBLER[11][7] =
"3500Hz" "3500Hz"
}; };
#ifdef ENABLE_SIDE_BUTT_MENU
const char g_sub_menu_SIDE_BUTT[9][16] = const char g_sub_menu_SIDE_BUTT[9][16] =
//const char g_sub_menu_SIDE_BUTT[10][16] = //const char g_sub_menu_SIDE_BUTT[10][16] =
{ {
@ -370,6 +375,7 @@ const char g_sub_menu_SIDE_BUTT[9][16] =
"TX\n1750Hz", "TX\n1750Hz",
// "2nd PTT", // "2nd PTT",
}; };
#endif
// *************************************************************************************** // ***************************************************************************************
@ -712,12 +718,14 @@ void UI_DisplayMenu(void)
break; break;
#endif #endif
#ifdef ENABLE_KEYLOCK
case MENU_AUTO_KEY_LOCK: case MENU_AUTO_KEY_LOCK:
if (g_sub_menu_selection == 0) if (g_sub_menu_selection == 0)
strcpy(String, "OFF"); strcpy(String, "OFF");
else else
sprintf(String, "%u secs", key_lock_timeout_500ms / 2); sprintf(String, "%u secs", key_lock_timeout_500ms / 2);
break; break;
#endif
case MENU_COMPAND: case MENU_COMPAND:
strcpy(String, g_sub_menu_rx_tx[g_sub_menu_selection]); strcpy(String, g_sub_menu_rx_tx[g_sub_menu_selection]);
@ -1025,12 +1033,14 @@ void UI_DisplayMenu(void)
g_usb_current); g_usb_current);
break; break;
#ifdef ENABLE_SIDE_BUTT_MENU
case MENU_SIDE1_SHORT: case MENU_SIDE1_SHORT:
case MENU_SIDE1_LONG: case MENU_SIDE1_LONG:
case MENU_SIDE2_SHORT: case MENU_SIDE2_SHORT:
case MENU_SIDE2_LONG: case MENU_SIDE2_LONG:
strcpy(String, g_sub_menu_SIDE_BUTT[g_sub_menu_selection]); strcpy(String, g_sub_menu_SIDE_BUTT[g_sub_menu_selection]);
break; break;
#endif
case MENU_VERSION: case MENU_VERSION:
{ // show the version string on multiple lines - if need be { // show the version string on multiple lines - if need be
@ -1098,15 +1108,15 @@ void UI_DisplayMenu(void)
case FREQ_LOCK_446: case FREQ_LOCK_446:
strcpy(String, "446.00625\n~\n446.19375"); strcpy(String, "446.00625\n~\n446.19375");
break; break;
#ifdef ENABLE_TX_UNLOCK #ifdef ENABLE_TX_UNLOCK
case FREQ_LOCK_TX_UNLOCK: case FREQ_LOCK_TX_UNLOCK:
sprintf(String, "UNLOCKED\n%u~%u", BX4819_BAND1.lower / 100000, BX4819_BAND2.upper / 100000); sprintf(String, "UNLOCKED\n%u~%u", BX4819_BAND1.lower / 100000, BX4819_BAND2.upper / 100000);
break; break;
#endif #endif
} }
break; break;
#ifdef ENABLE_F_CAL_MENU #ifdef ENABLE_F_CAL_MENU
case MENU_F_CALI: case MENU_F_CALI:
{ {
const uint32_t value = 22656 + g_sub_menu_selection; const uint32_t value = 22656 + g_sub_menu_selection;
@ -1119,7 +1129,7 @@ void UI_DisplayMenu(void)
xtal_Hz / 1000000, xtal_Hz % 1000000); xtal_Hz / 1000000, xtal_Hz % 1000000);
} }
break; break;
#endif #endif
case MENU_BAT_CAL: case MENU_BAT_CAL:
{ {

View File

@ -119,11 +119,15 @@ enum
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
MENU_VOICE, MENU_VOICE,
#endif #endif
#ifdef ENABLE_KEYLOCK
MENU_AUTO_KEY_LOCK, MENU_AUTO_KEY_LOCK,
#endif
#ifdef ENABLE_SIDE_BUTT_MENU
MENU_SIDE1_SHORT, MENU_SIDE1_SHORT,
MENU_SIDE1_LONG, MENU_SIDE1_LONG,
MENU_SIDE2_SHORT, MENU_SIDE2_SHORT,
MENU_SIDE2_LONG, MENU_SIDE2_LONG,
#endif
MENU_VERSION, MENU_VERSION,
MENU_RESET, MENU_RESET,
@ -183,7 +187,9 @@ extern const char g_sub_menu_rx_tx[4][6];
extern const char g_sub_menu_BAT_TXT[3][8]; extern const char g_sub_menu_BAT_TXT[3][8];
extern const char g_sub_menu_DIS_EN[2][9]; extern const char g_sub_menu_DIS_EN[2][9];
extern const char g_sub_MENU_SCRAMBLERAMBLER[11][7]; extern const char g_sub_MENU_SCRAMBLERAMBLER[11][7];
extern const char g_sub_menu_SIDE_BUTT[9][16]; #ifdef ENABLE_SIDE_BUTT_MENU
extern const char g_sub_menu_SIDE_BUTT[9][16];
#endif
extern bool g_is_in_sub_menu; extern bool g_is_in_sub_menu;

View File

@ -178,6 +178,7 @@ void UI_DisplayStatus(const bool test_display)
x += sizeof(BITMAP_VOX); x += sizeof(BITMAP_VOX);
#endif #endif
#ifdef ENABLE_KEYLOCK
// KEY-LOCK indicator // KEY-LOCK indicator
if (g_eeprom.key_lock || test_display) if (g_eeprom.key_lock || test_display)
{ {
@ -186,6 +187,7 @@ void UI_DisplayStatus(const bool test_display)
x1 = x; x1 = x;
} }
else else
#endif
if (g_fkey_pressed) if (g_fkey_pressed)
{ {
memmove(line + x, BITMAP_F_KEY, sizeof(BITMAP_F_KEY)); memmove(line + x, BITMAP_F_KEY, sizeof(BITMAP_F_KEY));