mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-06-20 15:08:37 +03:00
Stop signal bar graph showing when keylock msg + fix bat symbol bug
This commit is contained in:
40
ui/main.c
40
ui/main.c
@ -35,16 +35,15 @@
|
||||
|
||||
void UI_DisplayMain(void)
|
||||
{
|
||||
const unsigned int display_width = 128;
|
||||
char String[16];
|
||||
unsigned int vfo_num;
|
||||
|
||||
memset(gFrameBuffer, 0, sizeof(gFrameBuffer));
|
||||
|
||||
if (gEeprom.KEY_LOCK && gKeypadLocked > 0)
|
||||
{
|
||||
UI_PrintString("Long press #", 0, display_width - 1, 1, 8);
|
||||
UI_PrintString("to unlock", 0, display_width - 1, 3, 8);
|
||||
{ // tell user how to unlock the keyboard
|
||||
UI_PrintString("Long press #", 0, LCD_WIDTH - 1, 1, 8);
|
||||
UI_PrintString("to unlock", 0, LCD_WIDTH - 1, 3, 8);
|
||||
ST7565_BlitFullScreen();
|
||||
return;
|
||||
}
|
||||
@ -285,8 +284,7 @@ void UI_DisplayMain(void)
|
||||
break;
|
||||
|
||||
case MDF_NAME: // show the channel name
|
||||
if (gEeprom.VfoInfo[vfo_num].Name[0] <= 32 ||
|
||||
gEeprom.VfoInfo[vfo_num].Name[0] >= 127)
|
||||
if (gEeprom.VfoInfo[vfo_num].Name[0] <= 32 || gEeprom.VfoInfo[vfo_num].Name[0] >= 127)
|
||||
{ // no channel name, show the channel number instead
|
||||
sprintf(String, "CH-%03u", gEeprom.ScreenChannel[vfo_num] + 1);
|
||||
}
|
||||
@ -300,8 +298,7 @@ void UI_DisplayMain(void)
|
||||
|
||||
#ifdef ENABLE_CHAN_NAME_FREQ
|
||||
case MDF_NAME_FREQ: // show the channel name and frequency
|
||||
if (gEeprom.VfoInfo[vfo_num].Name[0] <= 32 ||
|
||||
gEeprom.VfoInfo[vfo_num].Name[0] >= 127)
|
||||
if (gEeprom.VfoInfo[vfo_num].Name[0] <= 32 || gEeprom.VfoInfo[vfo_num].Name[0] >= 127)
|
||||
{ // no channel name, show channel number instead
|
||||
sprintf(String, "CH-%03u", gEeprom.ScreenChannel[vfo_num] + 1);
|
||||
}
|
||||
@ -373,7 +370,7 @@ void UI_DisplayMain(void)
|
||||
|
||||
if (Level >= 1)
|
||||
{
|
||||
uint8_t *pLine = pLine1 + display_width;
|
||||
uint8_t *pLine = pLine1 + LCD_WIDTH;
|
||||
memmove(pLine + 0, BITMAP_Antenna, sizeof(BITMAP_Antenna));
|
||||
if (Level >= 2)
|
||||
memmove(pLine + 5, BITMAP_AntennaLevel1, sizeof(BITMAP_AntennaLevel1));
|
||||
@ -398,21 +395,21 @@ void UI_DisplayMain(void)
|
||||
strcpy(String, "AM");
|
||||
}
|
||||
else
|
||||
{ // show the CTCSS/DCS symbol
|
||||
{ // or show the CTCSS/DCS symbol
|
||||
const FREQ_Config_t *pConfig = (SomeValue == 1) ? gEeprom.VfoInfo[vfo_num].pTX : gEeprom.VfoInfo[vfo_num].pRX;
|
||||
const unsigned int code_type = pConfig->CodeType;
|
||||
const char *code_list[] = {"", "CT", "DCS", "DCR"};
|
||||
if (code_type >= 0 && code_type < ARRAY_SIZE(code_list))
|
||||
strcpy(String, code_list[code_type]);
|
||||
}
|
||||
UI_PrintStringSmall(String, display_width + 24, 0, Line + 1);
|
||||
UI_PrintStringSmall(String, LCD_WIDTH + 24, 0, Line + 1);
|
||||
|
||||
{ // show the TX power
|
||||
const char pwr_list[] = "LMH";
|
||||
const unsigned int i = gEeprom.VfoInfo[vfo_num].OUTPUT_POWER;
|
||||
String[0] = (i >= 0 && i < ARRAY_SIZE(pwr_list)) ? pwr_list[i] : '\0';
|
||||
String[1] = '\0';
|
||||
UI_PrintStringSmall(String, display_width + 46, 0, Line + 1);
|
||||
UI_PrintStringSmall(String, LCD_WIDTH + 46, 0, Line + 1);
|
||||
}
|
||||
|
||||
if (gEeprom.VfoInfo[vfo_num].ConfigRX.Frequency != gEeprom.VfoInfo[vfo_num].ConfigTX.Frequency)
|
||||
@ -424,31 +421,30 @@ void UI_DisplayMain(void)
|
||||
case TX_OFFSET_FREQUENCY_DIRECTION_SUB: String[0] = '-'; break;
|
||||
}
|
||||
String[1] = '\0';
|
||||
UI_PrintStringSmall(String, display_width + 54, 0, Line + 1);
|
||||
UI_PrintStringSmall(String, LCD_WIDTH + 54, 0, Line + 1);
|
||||
}
|
||||
|
||||
// show the TX/RX reverse symbol
|
||||
if (gEeprom.VfoInfo[vfo_num].FrequencyReverse)
|
||||
UI_PrintStringSmall("R", display_width + 62, 0, Line + 1);
|
||||
UI_PrintStringSmall("R", LCD_WIDTH + 62, 0, Line + 1);
|
||||
|
||||
{ // show the narrow band symbol
|
||||
String[0] = '?';
|
||||
switch (gEeprom.VfoInfo[vfo_num].CHANNEL_BANDWIDTH)
|
||||
String[0] = '\0';
|
||||
if (gEeprom.VfoInfo[vfo_num].CHANNEL_BANDWIDTH == BANDWIDTH_NARROW)
|
||||
{
|
||||
case BANDWIDTH_WIDE: String[0] = '\0'; break;
|
||||
case BANDWIDTH_NARROW: String[0] = 'N'; break;
|
||||
String[0] = 'N';
|
||||
String[1] = '\0';
|
||||
}
|
||||
String[1] = '\0';
|
||||
UI_PrintStringSmall(String, display_width + 70, 0, Line + 1);
|
||||
UI_PrintStringSmall(String, LCD_WIDTH + 70, 0, Line + 1);
|
||||
}
|
||||
|
||||
// show the DTMF decoding symbol
|
||||
if (gEeprom.VfoInfo[vfo_num].DTMF_DECODING_ENABLE || gSetting_KILLED)
|
||||
UI_PrintStringSmall("DTMF", display_width + 78, 0, Line + 1);
|
||||
UI_PrintStringSmall("DTMF", LCD_WIDTH + 78, 0, Line + 1);
|
||||
|
||||
// show the audio scramble symbol
|
||||
if (gEeprom.VfoInfo[vfo_num].SCRAMBLING_TYPE > 0 && gSetting_ScrambleEnable)
|
||||
UI_PrintStringSmall("SCR", display_width + 106, 0, Line + 1);
|
||||
UI_PrintStringSmall("SCR", LCD_WIDTH + 106, 0, Line + 1);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_DTMF_DECODER
|
||||
|
Reference in New Issue
Block a user