0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-08-03 09:36:32 +03:00

Slight menu style change

This commit is contained in:
OneOfEleven
2023-09-09 11:17:45 +01:00
parent 9131d75cb5
commit a5ed0671c8
8 changed files with 116 additions and 80 deletions

View File

@@ -28,8 +28,8 @@
static void Render(void)
{
char String[7];
unsigned int i;
char String[7];
memset(gStatusLine, 0, sizeof(gStatusLine));
memset(gFrameBuffer, 0, sizeof(gFrameBuffer));
@@ -39,7 +39,6 @@ static void Render(void)
for (i = 0; i < 6; i++)
String[i] = (gInputBox[i] == 10) ? '-' : '*';
String[6] = 0;
UI_PrintString(String, 0, 127, 3, 12, true);
ST7565_BlitStatusLine();

View File

@@ -49,7 +49,7 @@ static const char MenuList[][7] =
"MEM-CH",
"SAVE",
"VOX",
"ABR",
"BAK-LT",
// 16
"TDR",
"WX",
@@ -275,14 +275,21 @@ void UI_DisplayMenu(void)
gFrameBuffer[3][i] ^= 0xFF;
}
for (i = 0; i < 7; i++)
{
gFrameBuffer[i][48] = 0xFF;
gFrameBuffer[i][49] = 0xFF;
}
// draw vertical separating line
#if 0
// original thick line
for (i = 0; i < 7; i++)
{
gFrameBuffer[i][48] = 0xFF;
gFrameBuffer[i][49] = 0xFF;
}
#else
// a nicer less intense thinner dotted line
for (i = 0; i < 6; i++)
gFrameBuffer[i][49] = 0xAA;
#endif
NUMBER_ToDigits(gMenuCursor + 1, String);
UI_DisplaySmallDigits(2, String + 6, 33, 6);
if (gIsInSubMenu)
@@ -515,7 +522,7 @@ void UI_DisplayMenu(void)
UI_PrintString(String, 50, 127, 2, 8, true);
if (gMenuCursor == MENU_VOL)
{ // 2nd text line
{ // 2nd text line .. percentage
const uint16_t volts = (gBatteryVoltageAverage < gMin_bat_v) ? gMin_bat_v :
(gBatteryVoltageAverage > gMax_bat_v) ? gMax_bat_v :
gBatteryVoltageAverage;
@@ -596,4 +603,3 @@ void UI_DisplayMenu(void)
ST7565_BlitFullScreen();
}

View File

@@ -26,43 +26,45 @@
static void Render(uint8_t RssiLevel, uint8_t VFO)
{
uint8_t *pLine;
uint8_t Line;
bool bIsClearMode;
uint8_t Line;
bool bIsClearMode;
if (gCurrentFunction == FUNCTION_TRANSMIT || gScreenToDisplay != DISPLAY_MAIN) {
if (gCurrentFunction == FUNCTION_TRANSMIT || gScreenToDisplay != DISPLAY_MAIN)
return;
}
if (VFO == 0) {
if (VFO == 0)
{
pLine = gFrameBuffer[2];
Line = 3;
} else {
}
else
{
pLine = gFrameBuffer[6];
Line = 7;
}
memset(pLine, 0, 23);
if (RssiLevel == 0) {
pLine = NULL;
if (RssiLevel == 0)
{
pLine = NULL;
bIsClearMode = true;
} else {
memcpy(pLine, BITMAP_Antenna, 5);
memcpy(pLine + 5, BITMAP_AntennaLevel1, sizeof(BITMAP_AntennaLevel1));
if (RssiLevel >= 2) {
memcpy(pLine + 8, BITMAP_AntennaLevel2, sizeof(BITMAP_AntennaLevel2));
}
if (RssiLevel >= 3) {
}
else
{
memcpy(pLine, BITMAP_Antenna, 5);
memcpy(pLine + 5, BITMAP_AntennaLevel1, sizeof(BITMAP_AntennaLevel1));
if (RssiLevel >= 2)
memcpy(pLine + 8, BITMAP_AntennaLevel2, sizeof(BITMAP_AntennaLevel2));
if (RssiLevel >= 3)
memcpy(pLine + 11, BITMAP_AntennaLevel3, sizeof(BITMAP_AntennaLevel3));
}
if (RssiLevel >= 4) {
if (RssiLevel >= 4)
memcpy(pLine + 14, BITMAP_AntennaLevel4, sizeof(BITMAP_AntennaLevel4));
}
if (RssiLevel >= 5) {
if (RssiLevel >= 5)
memcpy(pLine + 17, BITMAP_AntennaLevel5, sizeof(BITMAP_AntennaLevel5));
}
if (RssiLevel >= 6) {
if (RssiLevel >= 6)
memcpy(pLine + 20, BITMAP_AntennaLevel6, sizeof(BITMAP_AntennaLevel6));
}
bIsClearMode = false;
}
@@ -71,23 +73,23 @@ static void Render(uint8_t RssiLevel, uint8_t VFO)
void UI_UpdateRSSI(uint16_t RSSI)
{
uint8_t Level;
uint8_t Level = 0;
if (RSSI >= gEEPROM_RSSI_CALIB[gRxVfo->Band][3]) {
if (RSSI >= gEEPROM_RSSI_CALIB[gRxVfo->Band][3])
Level = 6;
} else if (RSSI >= gEEPROM_RSSI_CALIB[gRxVfo->Band][2]) {
else
if (RSSI >= gEEPROM_RSSI_CALIB[gRxVfo->Band][2])
Level = 4;
} else if (RSSI >= gEEPROM_RSSI_CALIB[gRxVfo->Band][1]) {
else
if (RSSI >= gEEPROM_RSSI_CALIB[gRxVfo->Band][1])
Level = 2;
} else if (RSSI >= gEEPROM_RSSI_CALIB[gRxVfo->Band][0]) {
else
if (RSSI >= gEEPROM_RSSI_CALIB[gRxVfo->Band][0])
Level = 1;
} else {
Level = 0;
}
if (gVFO_RSSI_Level[gEeprom.RX_CHANNEL] != Level) {
if (gVFO_RSSI_Level[gEeprom.RX_CHANNEL] != Level)
{
gVFO_RSSI_Level[gEeprom.RX_CHANNEL] = Level;
Render(Level, gEeprom.RX_CHANNEL);
}
}