Remove blink keylock and improve MAIN ONLY

This commit is contained in:
Armel FAUVEAU
2024-03-01 04:14:06 +01:00
parent 26123d245a
commit 3e72d855a6
2 changed files with 63 additions and 36 deletions

View File

@@ -570,10 +570,29 @@ void UI_DisplayMain(void)
#else #else
if (gEeprom.KEY_LOCK && gKeypadLocked > 0) if (gEeprom.KEY_LOCK && gKeypadLocked > 0)
{ // tell user how to unlock the keyboard { // tell user how to unlock the keyboard
uint8_t shift = 3;
/*
BK4819_ToggleGpioOut(BK4819_GPIO5_PIN1_RED, true); BK4819_ToggleGpioOut(BK4819_GPIO5_PIN1_RED, true);
SYSTEM_DelayMs(50); SYSTEM_DelayMs(50);
BK4819_ToggleGpioOut(BK4819_GPIO5_PIN1_RED, false); BK4819_ToggleGpioOut(BK4819_GPIO5_PIN1_RED, false);
SYSTEM_DelayMs(50); SYSTEM_DelayMs(50);
*/
if(isMainOnly(false))
{
shift = 5;
}
//memcpy(gFrameBuffer[shift] + 2, gFontKeyLock, sizeof(gFontKeyLock));
UI_PrintStringSmallBold("UNLOCK KEYBOARD", 12, 0, shift);
//memcpy(gFrameBuffer[shift] + 120, gFontKeyLock, sizeof(gFontKeyLock));
/*
for (uint8_t i = 12; i < 116; i++)
{
gFrameBuffer[shift][i] ^= 0xFF;
}
*/
} }
#endif #endif
@@ -1050,13 +1069,6 @@ void UI_DisplayMain(void)
} }
#if ENABLE_FEAT_F4HWN #if ENABLE_FEAT_F4HWN
if (isMainOnly(true))
{
UI_PrintStringSmallNormal(s, LCD_WIDTH + 24, 0, line + 1);
UI_PrintStringSmallNormal(t, LCD_WIDTH + 2, 0, line + 1);
}
else
{
const FREQ_Config_t *pConfig = (mode == VFO_MODE_TX) ? vfoInfo->pTX : vfoInfo->pRX; const FREQ_Config_t *pConfig = (mode == VFO_MODE_TX) ? vfoInfo->pTX : vfoInfo->pRX;
int8_t shift = 0; int8_t shift = 0;
@@ -1079,6 +1091,27 @@ void UI_DisplayMain(void)
shift = -10; shift = -10;
} }
if (isMainOnly(true))
{
UI_PrintStringSmallNormal(s, 24, 0, 2);
UI_PrintStringSmallNormal(t, 2, 0, 2);
if(shift == 0)
{
UI_PrintStringSmallNormal(String, 2, 0, 6);
}
if((vfoInfo->StepFrequency / 100) < 100)
{
sprintf(String, "%d.%02uK", vfoInfo->StepFrequency / 100, vfoInfo->StepFrequency % 100);
}
else
{
sprintf(String, "%dK", vfoInfo->StepFrequency / 100);
}
UI_PrintStringSmallNormal(String, 46, 0, 6);
}
else
{
if ((s != NULL) && (s[0] != '\0')) { if ((s != NULL) && (s[0] != '\0')) {
GUI_DisplaySmallest(s, 58, line == 0 ? 17 : 49, false, true); GUI_DisplaySmallest(s, 58, line == 0 ? 17 : 49, false, true);
} }
@@ -1339,7 +1372,11 @@ void UI_DisplayMain(void)
if (isMainOnly(false) && !gDTMF_InputMode) if (isMainOnly(false) && !gDTMF_InputMode)
{ {
sprintf(String, "VFO %s", activeTxVFO ? "B" : "A"); sprintf(String, "VFO %s", activeTxVFO ? "B" : "A");
UI_PrintStringSmallBold(String, 49, 0, 6); UI_PrintStringSmallBold(String, 92, 0, 6);
for (uint8_t i = 92; i < 128; i++)
{
gFrameBuffer[6][i] ^= 0xFF;
}
} }
#endif #endif

View File

@@ -151,17 +151,7 @@ void UI_DisplayStatus()
// KEY-LOCK indicator // KEY-LOCK indicator
if (gEeprom.KEY_LOCK) { if (gEeprom.KEY_LOCK) {
static uint8_t blink = 0;
if(FUNCTION_IsRx() || gCurrentFunction == FUNCTION_TRANSMIT) blink = 0;
if(blink < 5)
{
memcpy(line + x + 1, gFontKeyLock, sizeof(gFontKeyLock)); memcpy(line + x + 1, gFontKeyLock, sizeof(gFontKeyLock));
}
blink = (blink++ < 10) ? blink : 0;
x += sizeof(gFontKeyLock); x += sizeof(gFontKeyLock);
x1 = x; x1 = x;
} }