This commit is contained in:
OneOfEleven 2023-09-11 13:21:00 +01:00
parent d65a39da56
commit a452646da9
6 changed files with 61 additions and 63 deletions

View File

@ -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,57 +1322,62 @@ 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 ((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
if (gScreenToDisplay != DISPLAY_SCANNER || gScanCssState >= SCAN_CSS_STATE_FOUND)
#endif
{
#ifndef DISABLE_AIRCOPY
if (gScreenToDisplay != DISPLAY_AIRCOPY && (gScreenToDisplay != DISPLAY_SCANNER || gScanCssState >= SCAN_CSS_STATE_FOUND))
#else
if (gScreenToDisplay != DISPLAY_SCANNER || gScanCssState >= SCAN_CSS_STATE_FOUND)
#endif
if (gEeprom.AUTO_KEYPAD_LOCK && gKeyLockCountdown > 0 && !gDTMF_InputMode)
{
if (gEeprom.AUTO_KEYPAD_LOCK && gKeyLockCountdown > 0 && !gDTMF_InputMode)
if (--gKeyLockCountdown == 0)
gEeprom.KEY_LOCK = true;
gUpdateStatus = true;
}
if (gVoltageMenuCountdown > 0)
{
if (--gVoltageMenuCountdown == 0)
{
if (--gKeyLockCountdown == 0)
gEeprom.KEY_LOCK = true;
gUpdateStatus = true;
}
if (gVoltageMenuCountdown > 0)
{
if (--gVoltageMenuCountdown == 0)
if (gInputBoxIndex || gDTMF_InputMode || gScreenToDisplay == DISPLAY_MENU)
AUDIO_PlayBeep(BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL);
if (gScreenToDisplay == DISPLAY_SCANNER)
{
if (gInputBoxIndex || gDTMF_InputMode || gScreenToDisplay == DISPLAY_MENU)
AUDIO_PlayBeep(BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL);
if (gScreenToDisplay == DISPLAY_SCANNER)
{
BK4819_StopScan();
RADIO_ConfigureChannel(0, 2);
RADIO_ConfigureChannel(1, 2);
RADIO_SetupRegisters(true);
}
gWasFKeyPressed = false;
gUpdateStatus = true;
gInputBoxIndex = 0;
gDTMF_InputMode = false;
gDTMF_InputIndex = 0;
gAskToSave = false;
gAskToDelete = false;
if (gFmRadioMode && gCurrentFunction != FUNCTION_RECEIVE && gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_TRANSMIT)
GUI_SelectNextDisplay(DISPLAY_FM);
else
GUI_SelectNextDisplay(DISPLAY_MAIN);
BK4819_StopScan();
RADIO_ConfigureChannel(0, 2);
RADIO_ConfigureChannel(1, 2);
RADIO_SetupRegisters(true);
}
gWasFKeyPressed = false;
gUpdateStatus = true;
gInputBoxIndex = 0;
gDTMF_InputMode = false;
gDTMF_InputIndex = 0;
gAskToSave = false;
gAskToDelete = false;
if (gFmRadioMode && gCurrentFunction != FUNCTION_RECEIVE && gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_TRANSMIT)
GUI_SelectNextDisplay(DISPLAY_FM);
else
GUI_SelectNextDisplay(DISPLAY_MAIN);
}
}
}
}
}
if (!gPttIsPressed && gFM_ResumeCountdown)

BIN
firmware

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -121,7 +121,7 @@ void UI_DisplayMain(void)
if (!single_vfo)
{ // highlight the selected/used VFO with a marker
if (bIsSameVfo)
memcpy(pLine0 + 2, BITMAP_VFO_Default, sizeof(BITMAP_VFO_Default));
memcpy(pLine0 + 2, BITMAP_VFO_Default, sizeof(BITMAP_VFO_Default));
//else
//memcpy(pLine0 + 2, BITMAP_VFO_NotDefault, sizeof(BITMAP_VFO_NotDefault));
}
@ -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

View File

@ -36,6 +36,7 @@ static void Render(uint8_t RssiLevel, uint8_t VFO)
{
pLine = gFrameBuffer[2];
Line = 3;
// Line = 4;
}
else
{