0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 22:58:04 +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

@ -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);
}
}