0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-27 13:51:25 +03:00

added more TX timeout options

This commit is contained in:
OneOfEleven 2023-12-19 10:52:24 +00:00
parent a902e9561f
commit 8ee1e5f2b7
9 changed files with 42 additions and 26 deletions

View File

@ -283,7 +283,7 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
case MENU_TX_TO:
*pMin = 0;
*pMax = ARRAY_SIZE(g_sub_menu_tx_timeout) - 1;
*pMax = ARRAY_SIZE(tx_timeout_secs) - 1;
break;
#ifdef ENABLE_VOX

Binary file not shown.

Binary file not shown.

View File

@ -189,13 +189,7 @@ void FUNCTION_Select(function_type_t Function)
if (g_alarm_state == ALARM_STATE_OFF)
#endif
{
if (g_eeprom.config.setting.tx_timeout == 0)
g_tx_timer_tick_500ms = 60; // 30 sec
else
if (g_eeprom.config.setting.tx_timeout < (ARRAY_SIZE(g_sub_menu_tx_timeout) - 1))
g_tx_timer_tick_500ms = 120 * g_eeprom.config.setting.tx_timeout; // minutes
else
g_tx_timer_tick_500ms = 120 * 15; // 15 minutes
g_tx_timer_tick_500ms = tx_timeout_secs[g_eeprom.config.setting.tx_timeout] * 2;
}
if (g_eeprom.config.setting.backlight_on_tx_rx == 1 || g_eeprom.config.setting.backlight_on_tx_rx == 3)

20
misc.c
View File

@ -21,6 +21,26 @@ const uint8_t obfuscate_array[16] = {
0x16, 0x6C, 0x14, 0xE6, 0x2E, 0x91, 0x0D, 0x40, 0x21, 0x35, 0xD5, 0x40, 0x13, 0x03, 0xE9, 0x80
};
const uint16_t tx_timeout_secs[16] =
{
(60 * 0) + 0,
(60 * 0) + 30,
(60 * 1) + 0,
(60 * 1) + 30,
(60 * 2) + 0,
(60 * 2) + 30,
(60 * 3) + 0,
(60 * 3) + 30,
(60 * 4) + 0,
(60 * 4) + 30,
(60 * 5) + 0,
(60 * 6) + 0,
(60 * 7) + 0,
(60 * 8) + 0,
(60 * 10) + 0,
(60 * 15) + 0
};
// ***********************************************
const uint8_t fm_resume_500ms = 2500 / 500; // 2.5 seconds

2
misc.h
View File

@ -123,6 +123,8 @@ typedef enum scan_state_dir_e scan_state_dir_t;
extern const uint8_t obfuscate_array[16];
extern const uint16_t tx_timeout_secs[16];
extern const uint8_t fm_resume_500ms;
extern const uint8_t fm_radio_500ms;
extern const uint16_t fm_play_scan_10ms;

View File

@ -144,7 +144,7 @@ void SETTINGS_read_eeprom(void)
g_eeprom.config.setting.call1 = IS_USER_CHANNEL(g_eeprom.config.setting.call1) ? g_eeprom.config.setting.call1 : USER_CHANNEL_FIRST;
g_eeprom.config.setting.squelch_level = (g_eeprom.config.setting.squelch_level < 10) ? g_eeprom.config.setting.squelch_level : 1;
g_eeprom.config.setting.tx_timeout = (g_eeprom.config.setting.tx_timeout < 11) ? g_eeprom.config.setting.tx_timeout : 1;
g_eeprom.config.setting.tx_timeout = (g_eeprom.config.setting.tx_timeout < ARRAY_SIZE(tx_timeout_secs)) ? ARRAY_SIZE(tx_timeout_secs) : 1;
g_eeprom.config.setting.noaa_auto_scan = (g_eeprom.config.setting.noaa_auto_scan < 2) ? g_eeprom.config.setting.noaa_auto_scan : 0;
#ifdef ENABLE_KEYLOCK
g_eeprom.config.setting.key_lock = (g_eeprom.config.setting.key_lock < 2) ? g_eeprom.config.setting.key_lock : 0;

View File

@ -240,21 +240,6 @@ const char g_sub_menu_bat_save[5][9] =
"1:4 80%"
};
const char g_sub_menu_tx_timeout[11][7] =
{
"30 sec",
"1 min",
"2 min",
"3 min",
"4 min",
"5 min",
"6 min",
"7 min",
"8 min",
"9 min",
"15 min"
};
const char g_sub_menu_dual_watch[3][10] =
{
"OFF",
@ -995,7 +980,23 @@ void UI_DisplayMenu(void)
break;
case MENU_TX_TO:
strcpy(str, g_sub_menu_tx_timeout[g_sub_menu_selection]);
{
const uint16_t ticks_500ms = tx_timeout_secs[g_sub_menu_selection];
const unsigned int min = ticks_500ms / 60;
const unsigned int sec = ticks_500ms % 60;
if (sec > 0)
{
if (min > 0)
sprintf(str, "%um %us", min, sec);
else
sprintf(str, "%u sec", sec);
}
else
if (min > 0)
sprintf(str, "%u min", min);
else
strcat(str, "off");
}
break;
#ifdef ENABLE_VOICE

View File

@ -193,7 +193,6 @@ extern const char g_sub_menu_shift_dir[3][4];
extern const char g_sub_menu_bandwidth[2][7];
extern const char g_sub_menu_off_on[2][4];
extern const char g_sub_menu_bat_save[5][9];
extern const char g_sub_menu_tx_timeout[11][7];
extern const char g_sub_menu_dual_watch[3][10];
extern const char g_sub_menu_cross_vfo[3][10];
#ifdef ENABLE_VOICE