mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-29 14:51:26 +03:00
Tidy up
This commit is contained in:
parent
d65a39da56
commit
a452646da9
19
app/app.c
19
app/app.c
@ -1281,14 +1281,6 @@ void APP_TimeSlice500ms(void)
|
||||
{
|
||||
// Skipped authentic device check
|
||||
|
||||
if (gCurrentFunction != FUNCTION_TRANSMIT)
|
||||
{
|
||||
if (gBacklightCountdown > 0)
|
||||
if (--gBacklightCountdown == 0)
|
||||
if (gEeprom.BACKLIGHT < 5)
|
||||
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn backlight off
|
||||
}
|
||||
|
||||
if (gKeypadLocked > 0)
|
||||
if (--gKeypadLocked == 0)
|
||||
gUpdateDisplay = true;
|
||||
@ -1330,10 +1322,15 @@ void APP_TimeSlice500ms(void)
|
||||
gCurrentRSSI = BK4819_GetRSSI();
|
||||
UI_UpdateRSSI(gCurrentRSSI);
|
||||
}
|
||||
// else
|
||||
{
|
||||
|
||||
if ((gFM_ScanState == FM_SCAN_OFF || gAskToSave) && gScanState == SCAN_OFF && gCssScanMode == CSS_SCAN_MODE_OFF)
|
||||
{
|
||||
|
||||
if (gBacklightCountdown > 0)
|
||||
if (--gBacklightCountdown == 0)
|
||||
if (gEeprom.BACKLIGHT < 5)
|
||||
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn backlight off
|
||||
|
||||
#ifndef DISABLE_AIRCOPY
|
||||
if (gScreenToDisplay != DISPLAY_AIRCOPY && (gScreenToDisplay != DISPLAY_SCANNER || gScanCssState >= SCAN_CSS_STATE_FOUND))
|
||||
#else
|
||||
@ -1380,7 +1377,7 @@ void APP_TimeSlice500ms(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!gPttIsPressed && gFM_ResumeCountdown)
|
||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
26
ui/main.c
26
ui/main.c
@ -234,14 +234,14 @@ void UI_DisplayMain(void)
|
||||
break;
|
||||
}
|
||||
|
||||
UI_PrintString(String, 31, 111, vfo_num * 4, Width, true);
|
||||
UI_PrintString(String, 31, 111, Line, Width, true);
|
||||
}
|
||||
else
|
||||
{ // normal state
|
||||
|
||||
if (gInputBoxIndex && IS_FREQ_CHANNEL(gEeprom.ScreenChannel[vfo_num]) && gEeprom.TX_CHANNEL == vfo_num)
|
||||
{ // user is entering a new frequency
|
||||
UI_DisplayFrequency(gInputBox, 31, vfo_num * 4, true, false);
|
||||
UI_DisplayFrequency(gInputBox, 31, Line, true, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -270,13 +270,13 @@ void UI_DisplayMain(void)
|
||||
#ifndef DISABLE_BIG_FREQ
|
||||
NUMBER_ToDigits(frequency_Hz, String);
|
||||
// show the main large frequency digits
|
||||
UI_DisplayFrequency(String, 31, vfo_num * 4, false, false);
|
||||
UI_DisplayFrequency(String, 31, Line, false, false);
|
||||
// show the remaining 2 small frequency digits
|
||||
UI_DisplaySmallDigits(2, String + 6, 112, Line + 1);
|
||||
#else
|
||||
// show the frequency in the main font
|
||||
sprintf(String, "%9.5f", frequency_Hz * 0.00001);
|
||||
UI_PrintString(String, 31, 112, vfo_num * 4, 8, true);
|
||||
UI_PrintString(String, 31, 112, Line, 8, true);
|
||||
#endif
|
||||
|
||||
frequency_Hz = 0;
|
||||
@ -284,7 +284,7 @@ void UI_DisplayMain(void)
|
||||
|
||||
case MDF_CHANNEL: // show the channel number
|
||||
sprintf(String, "CH-%03d", gEeprom.ScreenChannel[vfo_num] + 1);
|
||||
UI_PrintString(String, 31, 112, vfo_num * 4, 8, true);
|
||||
UI_PrintString(String, 31, 112, Line, 8, true);
|
||||
frequency_Hz = 0;
|
||||
break;
|
||||
|
||||
@ -292,11 +292,11 @@ void UI_DisplayMain(void)
|
||||
if (gEeprom.VfoInfo[vfo_num].Name[0] == 0 || gEeprom.VfoInfo[vfo_num].Name[0] == 0xFF)
|
||||
{ // no channel name, show the channel number instead
|
||||
sprintf(String, "CH-%03d", gEeprom.ScreenChannel[vfo_num] + 1);
|
||||
UI_PrintString(String, 31, 112, vfo_num * 4, 8, true);
|
||||
UI_PrintString(String, 31, 112, Line, 8, true);
|
||||
}
|
||||
else
|
||||
{ // channel name
|
||||
UI_PrintString(gEeprom.VfoInfo[vfo_num].Name, 31, 112, vfo_num * 4, 8, true);
|
||||
UI_PrintString(gEeprom.VfoInfo[vfo_num].Name, 31, 112, Line, 8, true);
|
||||
}
|
||||
frequency_Hz = 0;
|
||||
break;
|
||||
@ -306,13 +306,13 @@ void UI_DisplayMain(void)
|
||||
if (gEeprom.VfoInfo[vfo_num].Name[0] == 0 || gEeprom.VfoInfo[vfo_num].Name[0] == 0xFF)
|
||||
{ // no channel name, show channel number instead
|
||||
sprintf(String, "CH-%03d", gEeprom.ScreenChannel[vfo_num] + 1);
|
||||
UI_PrintStringSmall(gEeprom.VfoInfo[vfo_num].Name, 31 + 8, 0, (vfo_num * 4) + 0, false);
|
||||
UI_PrintStringSmall(gEeprom.VfoInfo[vfo_num].Name, 31 + 8, 0, Line, false);
|
||||
}
|
||||
else
|
||||
{ // channel name
|
||||
memset(String, 0, sizeof(String));
|
||||
memcpy(String, gEeprom.VfoInfo[vfo_num].Name, 8);
|
||||
UI_PrintStringSmall(gEeprom.VfoInfo[vfo_num].Name, 31 + 8, 0, (vfo_num * 4) + 0, false);
|
||||
UI_PrintStringSmall(gEeprom.VfoInfo[vfo_num].Name, 31 + 8, 0, Line, false);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
@ -332,13 +332,13 @@ void UI_DisplayMain(void)
|
||||
#ifndef DISABLE_BIG_FREQ
|
||||
NUMBER_ToDigits(frequency_Hz, String); // 8 digits
|
||||
// show the main large frequency digits
|
||||
UI_DisplayFrequency(String, 31, vfo_num * 4, false, false);
|
||||
UI_DisplayFrequency(String, 31, Line, false, false);
|
||||
// show the remaining 2 small frequency digits
|
||||
UI_DisplaySmallDigits(2, String + 6, 112, Line + 1);
|
||||
#else
|
||||
// show the frequency in the main font
|
||||
sprintf(String, "%9.5f", frequency_Hz * 0.00001);
|
||||
UI_PrintString(String, 31, 112, vfo_num * 4, 8, true);
|
||||
UI_PrintString(String, 31, 112, Line, 8, true);
|
||||
#endif
|
||||
|
||||
frequency_Hz = 0;
|
||||
@ -452,10 +452,10 @@ void UI_DisplayMain(void)
|
||||
{ // show the channel frequency below the channel number/name
|
||||
#if 1
|
||||
NUMBER_ToDigits(frequency_Hz, String); // 8 digits
|
||||
UI_DisplayFrequencySmall(String, 31 + 8, (vfo_num * 4) + 1, false);
|
||||
UI_DisplayFrequencySmall(String, 31 + 8, Line + 1, false);
|
||||
#else
|
||||
sprintf(String, "%9.5f", frequency_Hz * 0.00001);
|
||||
UI_PrintStringSmall(String, 31 + 8, 0, (vfo_num * 4) + 1, false);
|
||||
UI_PrintStringSmall(String, 31 + 8, 0, Line + 1, false);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user