Major code refactoring (412 B)

This commit is contained in:
mrkusypl committed 2026-04-29 17:06:18 +02:00
1 parent 0501422c64
commit a46604d8f3
14 files changed
+131 -235

No files matched your search

+5
View File
@@ -406,3 +406,8 @@ void UI_DisplayClear()
{
memset(gFrameBuffer, 0, sizeof(gFrameBuffer));
}
void UI_StatusClear()
{
memset(gStatusLine, 0, sizeof(gStatusLine));
}
+1
View File
@@ -45,5 +45,6 @@ void UI_DrawLineBuffer(uint8_t (*buffer)[128], int16_t x1, int16_t y1, int16_t x
void UI_DrawRectangleBuffer(uint8_t (*buffer)[128], int16_t x1, int16_t y1, int16_t x2, int16_t y2, bool black);
void UI_DisplayClear();
void UI_StatusClear();
#endif
+2 -11
View File
@@ -34,7 +34,7 @@ static void Render(void)
unsigned int i;
char String[7];
memset(gStatusLine, 0, sizeof(gStatusLine));
UI_StatusClear();
UI_DisplayClear();
UI_PrintString("PASSWORD", 0, 127, 1, 10);
@@ -80,16 +80,7 @@ void UI_DisplayLock(void)
switch (Key)
{
case KEY_0:
case KEY_1:
case KEY_2:
case KEY_3:
case KEY_4:
case KEY_5:
case KEY_6:
case KEY_7:
case KEY_8:
case KEY_9:
case KEY_0...KEY_9:
INPUTBOX_Append(Key - KEY_0);
if (gInputBoxIndex < 6) // 6 frequency digits
+1 -1
View File
@@ -59,7 +59,7 @@ void UI_DisplayStatus()
char str[8] = "";
gUpdateStatus = false;
memset(gStatusLine, 0, sizeof(gStatusLine));
UI_StatusClear();
uint8_t *line = gStatusLine;
unsigned int x = 0;
+5 -3
View File
@@ -189,7 +189,7 @@ void UI_DrawQRCode(bool wiki, uint8_t origin_x, uint8_t origin_y)
void UI_DisplayReleaseKeys(void)
{
memset(gStatusLine, 0, sizeof(gStatusLine));
UI_StatusClear();
#if defined(ENABLE_FEAT_F4HWN_CTR) || defined(ENABLE_FEAT_F4HWN_INV)
ST7565_ContrastAndInv();
#endif
@@ -209,7 +209,7 @@ void UI_DisplayWelcome(void)
char WelcomeString2[16];
char WelcomeString3[32];
memset(gStatusLine, 0, sizeof(gStatusLine));
UI_StatusClear();
#if defined(ENABLE_FEAT_F4HWN_CTR) || defined(ENABLE_FEAT_F4HWN_INV)
ST7565_ContrastAndInv();
@@ -222,11 +222,13 @@ void UI_DisplayWelcome(void)
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_NONE || gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_SOUND) {
ST7565_FillScreen(0x00);
}
#else
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_NONE || gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_FULL_SCREEN) {
ST7565_FillScreen(0xFF);
}
#endif
} else {
else {
memset(WelcomeString0, 0, sizeof(WelcomeString0));
memset(WelcomeString1, 0, sizeof(WelcomeString1));