Refactoring on PWRON PASSWORD

This commit is contained in:
Armel FAUVEAU
2024-11-24 04:14:14 +01:00
parent 2ca5f363ac
commit d87e6965a5
2 changed files with 12 additions and 2 deletions

10
main.c
View File

@@ -245,6 +245,16 @@ void Main(void)
bIsInLockScreen = true; bIsInLockScreen = true;
UI_DisplayLock(); UI_DisplayLock();
bIsInLockScreen = false; bIsInLockScreen = false;
// 500ms
for (int i = 0; i < 50;)
{
i = (GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT) && KEYBOARD_Poll() == KEY_INVALID) ? i + 1 : 0;
SYSTEM_DelayMs(10);
}
gKeyReading0 = KEY_INVALID;
gKeyReading1 = KEY_INVALID;
gDebounceCounter = 0;
} }
#endif #endif

View File

@@ -37,9 +37,9 @@ static void Render(void)
memset(gStatusLine, 0, sizeof(gStatusLine)); memset(gStatusLine, 0, sizeof(gStatusLine));
UI_DisplayClear(); UI_DisplayClear();
UI_PrintString("LOCK", 0, 127, 1, 10); UI_PrintString("PASSWORD", 0, 127, 1, 10);
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
String[i] = (gInputBox[i] == 10) ? '-' : '*'; String[i] = (gInputBox[i] == 10) ? '-' : 'x';
String[6] = 0; String[6] = 0;
UI_PrintString(String, 0, 127, 3, 12); UI_PrintString(String, 0, 127, 3, 12);