mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-06-19 14:48:03 +03:00
Updated DTMF to full char range
This commit is contained in:
44
ui/fmradio.c
44
ui/fmradio.c
@ -34,8 +34,6 @@ void UI_DisplayFM(void)
|
||||
|
||||
memset(g_frame_buffer, 0, sizeof(g_frame_buffer));
|
||||
|
||||
// *************************************
|
||||
|
||||
if (g_eeprom.key_lock && g_keypad_locked > 0)
|
||||
{ // tell user how to unlock the keyboard
|
||||
backlight_turn_on();
|
||||
@ -46,19 +44,22 @@ void UI_DisplayFM(void)
|
||||
}
|
||||
|
||||
// *************************************
|
||||
|
||||
// upper text line
|
||||
|
||||
UI_PrintString("FM", 0, 127, 0, 12);
|
||||
|
||||
// *************************************
|
||||
|
||||
// middle text line
|
||||
|
||||
if (g_ask_to_save)
|
||||
{
|
||||
strcpy(String, "SAVE ?");
|
||||
const unsigned int freq = g_eeprom.fm_frequency_playing;
|
||||
sprintf(String, "SAVE %u.%u ?", freq / 10, freq % 10);
|
||||
}
|
||||
else
|
||||
if (g_ask_to_delete)
|
||||
{
|
||||
strcpy(String, "DEL ?");
|
||||
strcpy(String, "DELETE ?");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -72,7 +73,7 @@ void UI_DisplayFM(void)
|
||||
{
|
||||
if (g_eeprom.fm_frequency_playing == g_fm_channels[i])
|
||||
{
|
||||
sprintf(String, "VFO (CH %u)", i + 1);
|
||||
sprintf(String, "VFO (CH %u)", 1 + i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -81,22 +82,32 @@ void UI_DisplayFM(void)
|
||||
strcpy(String, "VFO");
|
||||
}
|
||||
else
|
||||
sprintf(String, "CH %u", g_eeprom.fm_selected_channel + 1);
|
||||
sprintf(String, "CH %u", 1 + g_eeprom.fm_selected_channel);
|
||||
}
|
||||
else
|
||||
if (!g_fm_auto_scan)
|
||||
strcpy(String, "M-SCAN");
|
||||
else
|
||||
sprintf(String, "A-SCAN %u", g_fm_channel_position + 1);
|
||||
sprintf(String, "A-SCAN %u", 1 + g_fm_channel_position);
|
||||
}
|
||||
|
||||
UI_PrintString(String, 0, 127, 2, 10);
|
||||
|
||||
// *************************************
|
||||
// lower text line
|
||||
|
||||
memset(String, 0, sizeof(String));
|
||||
|
||||
if (g_ask_to_save || (g_eeprom.fm_is_channel_mode && g_input_box_index > 0))
|
||||
if (g_ask_to_save)
|
||||
{ // channel mode
|
||||
const unsigned int chan = g_fm_channel_position;
|
||||
const uint32_t freq = g_fm_channels[chan];
|
||||
UI_GenerateChannelString(String, chan, ' ');
|
||||
if (FM_CheckValidChannel(chan))
|
||||
sprintf(String + strlen(String), " (%u.%u)", freq / 10, freq % 10);
|
||||
}
|
||||
else
|
||||
if (g_eeprom.fm_is_channel_mode && g_input_box_index > 0)
|
||||
{ // user is entering a channel number
|
||||
UI_GenerateChannelString(String, g_fm_channel_position, ' ');
|
||||
}
|
||||
@ -104,8 +115,9 @@ void UI_DisplayFM(void)
|
||||
if (!g_ask_to_delete)
|
||||
{
|
||||
if (g_input_box_index == 0)
|
||||
{
|
||||
NUMBER_ToDigits(g_eeprom.fm_frequency_playing * 10000, String);
|
||||
{ // frequency mode
|
||||
const uint32_t freq = g_eeprom.fm_frequency_playing;
|
||||
NUMBER_ToDigits(freq * 10000, String);
|
||||
UI_DisplayFrequency(String, 23, 4, false, true);
|
||||
}
|
||||
else
|
||||
@ -114,11 +126,13 @@ void UI_DisplayFM(void)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(String, "CH %u", g_eeprom.fm_selected_channel + 1);
|
||||
{ // delete channel
|
||||
const uint32_t chan = g_eeprom.fm_selected_channel;
|
||||
const uint32_t freq = g_fm_channels[chan];
|
||||
sprintf(String, "CH %u (%u.%u)", 1 + chan, freq / 10, freq % 10);
|
||||
}
|
||||
|
||||
UI_PrintString(String, 0, 127, 4, 10);
|
||||
UI_PrintString(String, 0, 127, 4, (strlen(String) >= 8) ? 8 : 10);
|
||||
|
||||
// *************************************
|
||||
|
||||
|
Reference in New Issue
Block a user