0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 06:39:49 +03:00

Stop signal bar graph showing when keylock msg + fix bat symbol bug

This commit is contained in:
OneOfEleven
2023-09-19 07:16:15 +01:00
parent 28ed7e7842
commit 787b5add92
14 changed files with 77 additions and 67 deletions

View File

@ -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

View File

@ -36,6 +36,9 @@ void UI_UpdateRSSI(uint16_t RSSI)
char s[8];
const uint8_t line = (gEeprom.RX_CHANNEL == 0) ? 3 : 7;
if (gEeprom.KEY_LOCK && gKeypadLocked > 0)
return; // the screen is currently in use
gVFO_RSSI[gEeprom.RX_CHANNEL] = RSSI;
gVFO_RSSI_Level[gEeprom.RX_CHANNEL] = 0;
@ -58,8 +61,11 @@ void Render(const uint8_t rssi, const uint8_t RssiLevel, const uint8_t VFO)
uint8_t *pLine;
uint8_t Line;
if (gEeprom.KEY_LOCK && gKeypadLocked > 0)
return; // the screen is currently in use
if (gCurrentFunction == FUNCTION_TRANSMIT || gScreenToDisplay != DISPLAY_MAIN)
return;
return; // it's still in use
if (VFO == 0)
{

View File

@ -36,9 +36,9 @@ void UI_DisplayStatus(const bool test_display)
gUpdateStatus = false;
memset(line, 0, sizeof(gStatusLine));
memset(gStatusLine, 0, sizeof(gStatusLine));
line += 2;
// line += 2;
// POWER-SAVE indicator
if (gCurrentFunction == FUNCTION_POWER_SAVE || test_display)
@ -109,11 +109,10 @@ void UI_DisplayStatus(const bool test_display)
// USB-C charge indicator
if (gChargingWithTypeC || test_display)
memmove(line, BITMAP_USB_C, sizeof(BITMAP_USB_C));
line += sizeof(BITMAP_USB_C);
// line += sizeof(BITMAP_USB_C);
line += 4;
// BATTERY LEVEL indicator
line = gStatusLine + LCD_WIDTH - sizeof(BITMAP_BatteryLevel5); // point to the far right side of the screen
if (gBatteryDisplayLevel >= 5 || test_display)
memmove(line, BITMAP_BatteryLevel5, sizeof(BITMAP_BatteryLevel5));
else
@ -128,7 +127,6 @@ void UI_DisplayStatus(const bool test_display)
else
if (gLowBatteryBlink == 1)
memmove(line, BITMAP_BatteryLevel1, sizeof(BITMAP_BatteryLevel1));
// line += sizeof(BITMAP_BatteryLevel1);
ST7565_BlitStatusLine();
}