mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-06-18 22:29:50 +03:00
single VFO mode update
This commit is contained in:
175
ui/main.c
175
ui/main.c
@ -649,6 +649,11 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
|
||||
uint8_t *p_line1 = g_frame_buffer[1];
|
||||
char str[22];
|
||||
|
||||
#ifdef ENABLE_SHOW_FREQ_IN_CHAN
|
||||
const uint8_t freq_in_channel = g_vfo_info[vfo_num].freq_in_channel;
|
||||
//const uint8_t freq_in_channel = SETTINGS_find_channel(frequency); // was way to slow
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_ALARM
|
||||
if (g_current_function == FUNCTION_TRANSMIT && g_alarm_state == ALARM_STATE_ALARM)
|
||||
state = VFO_STATE_ALARM;
|
||||
@ -812,41 +817,28 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
|
||||
big_freq(frequency, x, y);
|
||||
#else
|
||||
|
||||
#ifdef ENABLE_SHOW_FREQS_CHAN
|
||||
// const unsigned int chan = g_vfo_info[vfo_num].freq_in_channel;
|
||||
#endif
|
||||
|
||||
//sprintf(str, "%03u.%05u", frequency / 100000, frequency % 100000);
|
||||
sprintf(str, "%u.%05u", frequency / 100000, frequency % 100000);
|
||||
#ifdef ENABLE_TRIM_TRAILING_ZEROS
|
||||
NUMBER_trim_trailing_zeros(str);
|
||||
#endif
|
||||
/*
|
||||
#ifdef ENABLE_SHOW_FREQS_CHAN
|
||||
//g_vfo_info[vfo_num].freq_in_channel = SETTINGS_find_channel(frequency);
|
||||
if (chan <= USER_CHANNEL_LAST)
|
||||
{ // the frequency has a channel - show the channel name below the frequency
|
||||
|
||||
// frequency
|
||||
#ifdef ENABLE_SMALL_BOLD
|
||||
UI_PrintStringSmallBold(str, x + 4, 0, line + 0);
|
||||
#else
|
||||
UI_PrintStringSmall(str, x + 4, 0, y);
|
||||
#endif
|
||||
#ifdef ENABLE_SHOW_FREQ_IN_CHAN
|
||||
UI_PrintString(str, x, 0, y, 8);
|
||||
|
||||
// channel name, if not then channel number
|
||||
SETTINGS_fetch_channel_name(str, chan);
|
||||
if (IS_FREQ_CHANNEL(scrn_chan) && freq_in_channel <= USER_CHANNEL_LAST)
|
||||
{
|
||||
SETTINGS_fetch_channel_name(str, freq_in_channel);
|
||||
if (str[0] == 0)
|
||||
//sprintf(str, "CH-%03u", 1 + chan);
|
||||
sprintf(str, "CH-%u", 1 + chan);
|
||||
UI_PrintStringSmall(str, x + 4, 0, y + 1);
|
||||
//sprintf(str, "CH-%03u", 1 + freq_in_channel);
|
||||
sprintf(str, "CH-%u", 1 + freq_in_channel);
|
||||
//UI_PrintString(str, x, 0, y + 2, 8);
|
||||
UI_PrintStringSmall(str, x, 0, y + 2);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
*/ { // show the frequency in the main font
|
||||
// UI_PrintString(str, x, 0, y, 8);
|
||||
#else
|
||||
UI_PrintString(str, x, 0, y + 1, 8);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -868,41 +860,22 @@ const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALA
|
||||
}
|
||||
|
||||
{
|
||||
const bool is_freq_chan = IS_FREQ_CHANNEL(scrn_chan);
|
||||
const uint8_t freq_in_channel = g_vfo_info[vfo_num].freq_in_channel;
|
||||
// const uint8_t freq_in_channel = SETTINGS_find_channel(frequency); // was way to slow
|
||||
|
||||
#ifdef ENABLE_SHOW_FREQS_CHAN
|
||||
strcpy(str, " ");
|
||||
|
||||
if (is_freq_chan && freq_in_channel <= USER_CHANNEL_LAST)
|
||||
sprintf(str, "%3u", 1 + freq_in_channel);
|
||||
|
||||
#ifdef ENABLE_SCAN_IGNORE_LIST
|
||||
if (FI_freq_ignored(frequency) >= 0)
|
||||
str[4] = 'I'; // frequency is in the ignore list
|
||||
#endif
|
||||
|
||||
if (g_vfo_info[vfo_num].channel.compand != COMPAND_OFF)
|
||||
str[5] = 'C'; // compander is enabled
|
||||
|
||||
UI_PrintStringSmall(str, LCD_WIDTH - (7 * 6), 0, y + 1);
|
||||
#else
|
||||
strcpy(str, " ");
|
||||
|
||||
if (is_freq_chan && freq_in_channel <= USER_CHANNEL_LAST)
|
||||
strcpy(str, " ");
|
||||
/*
|
||||
#ifdef ENABLE_SHOW_FREQ_IN_CHAN
|
||||
if (IS_FREQ_CHANNEL(scrn_chan) && freq_in_channel <= USER_CHANNEL_LAST)
|
||||
str[0] = 'F'; // this VFO frequency is also found in a channel
|
||||
|
||||
#ifdef ENABLE_SCAN_IGNORE_LIST
|
||||
if (FI_freq_ignored(frequency) >= 0)
|
||||
str[1] = 'I'; // frequency is in the ignore list
|
||||
#endif
|
||||
|
||||
if (g_vfo_info[vfo_num].channel.compand != COMPAND_OFF)
|
||||
str[2] = 'C'; // compander is enabled
|
||||
|
||||
UI_PrintStringSmall(str, LCD_WIDTH - (7 * 3), 0, y + 1);
|
||||
#endif
|
||||
*/
|
||||
#ifdef ENABLE_SCAN_IGNORE_LIST
|
||||
if (FI_freq_ignored(frequency) >= 0)
|
||||
str[1] = 'I'; // frequency is in the ignore list
|
||||
#endif
|
||||
|
||||
if (g_vfo_info[vfo_num].channel.compand != COMPAND_OFF)
|
||||
str[2] = 'C'; // compander is enabled
|
||||
|
||||
UI_PrintStringSmall(str, LCD_WIDTH - (7 * 3), 0, y + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1326,9 +1299,9 @@ void UI_DisplayMain(void)
|
||||
|
||||
// name
|
||||
#ifdef ENABLE_SMALL_BOLD
|
||||
UI_PrintStringSmallBold(str, x + 4, 0, line + 0);
|
||||
UI_PrintStringSmallBold(str, x + 4, 0, line);
|
||||
#else
|
||||
UI_PrintStringSmall(str, x + 4, 0, line + 0);
|
||||
UI_PrintStringSmall(str, x + 4, 0, line);
|
||||
#endif
|
||||
|
||||
// frequency
|
||||
@ -1350,40 +1323,39 @@ void UI_DisplayMain(void)
|
||||
big_freq(frequency, x, line);
|
||||
#else
|
||||
|
||||
#ifdef ENABLE_SHOW_FREQS_CHAN
|
||||
const unsigned int chan = g_vfo_info[vfo_num].freq_in_channel;
|
||||
#endif
|
||||
|
||||
// sprintf(str, "%03u.%05u", frequency / 100000, frequency % 100000);
|
||||
sprintf(str, "%u.%05u", frequency / 100000, frequency % 100000);
|
||||
#ifdef ENABLE_TRIM_TRAILING_ZEROS
|
||||
NUMBER_trim_trailing_zeros(str);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_SHOW_FREQS_CHAN
|
||||
#ifdef ENABLE_SHOW_FREQ_IN_CHAN
|
||||
{
|
||||
//g_vfo_info[vfo_num].freq_in_channel = SETTINGS_find_channel(frequency);
|
||||
if (chan <= USER_CHANNEL_LAST)
|
||||
const unsigned int freq_in_channel = g_vfo_info[vfo_num].freq_in_channel;
|
||||
|
||||
if (freq_in_channel <= USER_CHANNEL_LAST)
|
||||
{ // the frequency has a channel - show the channel name below the frequency
|
||||
|
||||
// frequency
|
||||
#ifdef ENABLE_SMALL_BOLD
|
||||
UI_PrintStringSmallBold(str, x + 4, 0, line + 0);
|
||||
UI_PrintStringSmallBold(str, x, 0, line);
|
||||
#else
|
||||
UI_PrintStringSmall(str, x + 4, 0, line + 0);
|
||||
UI_PrintStringSmall(str, x, 0, line);
|
||||
#endif
|
||||
|
||||
// channel name, if not then channel number
|
||||
SETTINGS_fetch_channel_name(str, chan);
|
||||
SETTINGS_fetch_channel_name(str, freq_in_channel);
|
||||
if (str[0] == 0)
|
||||
// sprintf(str, "CH-%03u", 1 + chan);
|
||||
sprintf(str, "CH-%u", 1 + chan);
|
||||
UI_PrintStringSmall(str, x + 4, 0, line + 1);
|
||||
//sprintf(str, "CH-%03u", 1 + freq_in_channel);
|
||||
sprintf(str, "CH-%u", 1 + freq_in_channel);
|
||||
UI_PrintStringSmall(str, x, 0, line + 1);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{ // show the frequency in the main font
|
||||
UI_PrintString(str, x, 0, line, 8);
|
||||
UI_PrintString(str, x, 0, line, 8);
|
||||
}
|
||||
#else
|
||||
UI_PrintString(str, x, 0, line, 8);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
@ -1430,38 +1402,27 @@ void UI_DisplayMain(void)
|
||||
}
|
||||
#else
|
||||
{
|
||||
#ifdef ENABLE_SHOW_FREQS_CHAN
|
||||
strcpy(str, " ");
|
||||
|
||||
#ifdef ENABLE_SCAN_IGNORE_LIST
|
||||
if (FI_freq_ignored(frequency) >= 0)
|
||||
str[0] = 'I'; // frequency is in the ignore list
|
||||
#endif
|
||||
|
||||
if (g_vfo_info[vfo_num].channel.compand != COMPAND_OFF)
|
||||
str[1] = 'C'; // compander is enabled
|
||||
|
||||
UI_PrintStringSmall(str, LCD_WIDTH - (7 * 2), 0, line + 1);
|
||||
#else
|
||||
const bool is_freq_chan = IS_FREQ_CHANNEL(scrn_chan);
|
||||
const uint8_t freq_in_channel = g_vfo_info[vfo_num].freq_in_channel;
|
||||
// const uint8_t freq_in_channel = SETTINGS_find_channel(frequency); // was way to slow
|
||||
|
||||
strcpy(str, " ");
|
||||
|
||||
#ifdef ENABLE_SCAN_IGNORE_LIST
|
||||
if (FI_freq_ignored(frequency) >= 0)
|
||||
str[0] = 'I'; // frequency is in the ignore list
|
||||
#endif
|
||||
|
||||
if (is_freq_chan && freq_in_channel <= USER_CHANNEL_LAST)
|
||||
str[1] = 'F'; // this VFO frequency is also found in a channel
|
||||
|
||||
if (g_vfo_info[vfo_num].channel.compand != COMPAND_OFF)
|
||||
str[2] = 'C'; // compander is enabled
|
||||
|
||||
UI_PrintStringSmall(str, LCD_WIDTH - (7 * 3), 0, line + 1);
|
||||
strcpy(str, " ");
|
||||
/*
|
||||
#ifdef ENABLE_SHOW_FREQ_IN_CHAN
|
||||
if (IS_FREQ_CHANNEL(scrn_chan))
|
||||
{
|
||||
const uint8_t freq_in_channel = g_vfo_info[vfo_num].freq_in_channel;
|
||||
//const uint8_t freq_in_channel = SETTINGS_find_channel(frequency); // was way to slow
|
||||
if (freq_in_channel <= USER_CHANNEL_LAST)
|
||||
str[0] = 'F'; // this VFO frequency is also found in a channel
|
||||
}
|
||||
#endif
|
||||
*/
|
||||
#ifdef ENABLE_SCAN_IGNORE_LIST
|
||||
if (FI_freq_ignored(frequency) >= 0)
|
||||
str[1] = 'I'; // frequency is in the ignore list
|
||||
#endif
|
||||
|
||||
if (g_vfo_info[vfo_num].channel.compand != COMPAND_OFF)
|
||||
str[2] = 'C'; // compander is enabled
|
||||
|
||||
UI_PrintStringSmall(str, LCD_WIDTH - (7 * 3), 0, line + 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
32
ui/menu.c
32
ui/menu.c
@ -120,11 +120,21 @@ const t_menu_item g_menu_list[] =
|
||||
{"D ST", VOICE_ID_INVALID, MENU_DTMF_ST },
|
||||
{"D RSP", VOICE_ID_INVALID, MENU_DTMF_RSP },
|
||||
{"D HOLD", VOICE_ID_INVALID, MENU_DTMF_HOLD },
|
||||
{"D PRE", VOICE_ID_INVALID, MENU_DTMF_PRE },
|
||||
{"D DCD", VOICE_ID_INVALID, MENU_DTMF_DCD },
|
||||
{"D LIST", VOICE_ID_INVALID, MENU_DTMF_LIST },
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
{"D LIVE", VOICE_ID_INVALID, MENU_DTMF_LIVE_DEC }, // live DTMF decoder
|
||||
#endif
|
||||
#ifdef ENABLE_DTMF_TIMING_SETTINGS
|
||||
{"D PRE", VOICE_ID_INVALID, MENU_DTMF_PRE },
|
||||
// MENU_DTMF_1ST_PERSIST,
|
||||
// MENU_DTMF_HASH_PERSIST,
|
||||
// MENU_DTMF_PERSIST,
|
||||
// MENU_DTMF_INTERVAL,
|
||||
// g_eeprom.config.setting.dtmf.first_code_persist_time
|
||||
// g_eeprom.config.setting.dtmf.hash_code_persist_time
|
||||
// g_eeprom.config.setting.dtmf.code_persist_time
|
||||
// g_eeprom.config.setting.dtmf.code_interval_time
|
||||
#endif
|
||||
{"PonMSG", VOICE_ID_INVALID, MENU_PON_MSG },
|
||||
{"ROGER", VOICE_ID_INVALID, MENU_ROGER_MODE },
|
||||
@ -1073,10 +1083,22 @@ void UI_DisplayMenu(void)
|
||||
|
||||
break;
|
||||
|
||||
case MENU_DTMF_PRE:
|
||||
strcpy(str, "DTMF BOT\nDELAY\n");
|
||||
sprintf(str + strlen(str), "%dms", 10 * g_sub_menu_selection);
|
||||
break;
|
||||
#ifdef ENABLE_DTMF_TIMING_SETTINGS
|
||||
case MENU_DTMF_PRE:
|
||||
strcpy(str, "DTMF BOT\nDELAY\n");
|
||||
sprintf(str + strlen(str), "%dms", 10 * g_sub_menu_selection);
|
||||
break;
|
||||
|
||||
// MENU_DTMF_1ST_PERSIST,
|
||||
// MENU_DTMF_HASH_PERSIST,
|
||||
// MENU_DTMF_PERSIST,
|
||||
// MENU_DTMF_INTERVAL,
|
||||
|
||||
// g_eeprom.config.setting.dtmf.first_code_persist_time
|
||||
// g_eeprom.config.setting.dtmf.hash_code_persist_time
|
||||
// g_eeprom.config.setting.dtmf.code_persist_time
|
||||
// g_eeprom.config.setting.dtmf.code_interval_time
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_MDC1200
|
||||
case MENU_MDC1200_MODE:
|
||||
|
12
ui/menu.h
12
ui/menu.h
@ -100,13 +100,23 @@ enum
|
||||
MENU_DN_CODE,
|
||||
MENU_DTMF_ST,
|
||||
MENU_DTMF_HOLD,
|
||||
MENU_DTMF_PRE,
|
||||
MENU_DTMF_LIST,
|
||||
MENU_DTMF_RSP,
|
||||
MENU_DTMF_DCD,
|
||||
#ifdef ENABLE_DTMF_LIVE_DECODER
|
||||
MENU_DTMF_LIVE_DEC,
|
||||
#endif
|
||||
#ifdef ENABLE_DTMF_TIMING_SETTINGS
|
||||
MENU_DTMF_PRE,
|
||||
// MENU_DTMF_1ST_PERSIST,
|
||||
// MENU_DTMF_HASH_PERSIST,
|
||||
// MENU_DTMF_PERSIST,
|
||||
// MENU_DTMF_INTERVAL,
|
||||
// g_eeprom.config.setting.dtmf.first_code_persist_time
|
||||
// g_eeprom.config.setting.dtmf.hash_code_persist_time
|
||||
// g_eeprom.config.setting.dtmf.code_persist_time
|
||||
// g_eeprom.config.setting.dtmf.code_interval_time
|
||||
#endif
|
||||
#ifdef ENABLE_MDC1200
|
||||
MENU_MDC1200_MODE,
|
||||
MENU_MDC1200_ID,
|
||||
|
Reference in New Issue
Block a user