mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-06-19 22:58:04 +03:00
Renamed lots more
This commit is contained in:
38
ui/lock.c
38
ui/lock.c
@ -34,13 +34,13 @@ static void Render(void)
|
||||
unsigned int i;
|
||||
char String[7];
|
||||
|
||||
memset(gStatusLine, 0, sizeof(gStatusLine));
|
||||
memset(gFrameBuffer, 0, sizeof(gFrameBuffer));
|
||||
memset(g_status_line, 0, sizeof(g_status_line));
|
||||
memset(g_frame_buffer, 0, sizeof(g_frame_buffer));
|
||||
|
||||
strcpy(String, "LOCK");
|
||||
UI_PrintString(String, 0, 127, 1, 10);
|
||||
for (i = 0; i < 6; i++)
|
||||
String[i] = (gInputBox[i] == 10) ? '-' : '*';
|
||||
String[i] = (g_input_box[i] == 10) ? '-' : '*';
|
||||
String[6] = 0;
|
||||
UI_PrintString(String, 0, 127, 3, 12);
|
||||
|
||||
@ -51,19 +51,19 @@ static void Render(void)
|
||||
void UI_DisplayLock(void)
|
||||
{
|
||||
key_code_t Key;
|
||||
BEEP_Type_t Beep;
|
||||
beep_type_t Beep;
|
||||
|
||||
gUpdateDisplay = true;
|
||||
g_update_display = true;
|
||||
|
||||
memset(gInputBox, 10, sizeof(gInputBox));
|
||||
memset(g_input_box, 10, sizeof(g_input_box));
|
||||
|
||||
while (1)
|
||||
{
|
||||
while (!gNextTimeslice) {}
|
||||
while (!g_next_time_slice) {}
|
||||
|
||||
// TODO: Original code doesn't do the below, but is needed for proper key debounce
|
||||
|
||||
gNextTimeslice = false;
|
||||
g_next_time_slice = false;
|
||||
|
||||
Key = KEYBOARD_Poll();
|
||||
|
||||
@ -93,7 +93,7 @@ void UI_DisplayLock(void)
|
||||
case KEY_9:
|
||||
INPUTBOX_Append(Key - KEY_0);
|
||||
|
||||
if (gInputBoxIndex < 6) // 6 frequency digits
|
||||
if (g_input_box_index < 6) // 6 frequency digits
|
||||
{
|
||||
Beep = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
}
|
||||
@ -101,9 +101,9 @@ void UI_DisplayLock(void)
|
||||
{
|
||||
uint32_t Password;
|
||||
|
||||
gInputBoxIndex = 0;
|
||||
g_input_box_index = 0;
|
||||
|
||||
NUMBER_Get(gInputBox, &Password);
|
||||
NUMBER_Get(g_input_box, &Password);
|
||||
|
||||
if ((g_eeprom.power_on_password * 100) == Password)
|
||||
{
|
||||
@ -111,21 +111,21 @@ void UI_DisplayLock(void)
|
||||
return;
|
||||
}
|
||||
|
||||
memset(gInputBox, 10, sizeof(gInputBox));
|
||||
memset(g_input_box, 10, sizeof(g_input_box));
|
||||
|
||||
Beep = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
}
|
||||
|
||||
AUDIO_PlayBeep(Beep);
|
||||
|
||||
gUpdateDisplay = true;
|
||||
g_update_display = true;
|
||||
break;
|
||||
|
||||
case KEY_EXIT:
|
||||
if (gInputBoxIndex > 0)
|
||||
if (g_input_box_index > 0)
|
||||
{
|
||||
gInputBox[--gInputBoxIndex] = 10;
|
||||
gUpdateDisplay = true;
|
||||
g_input_box[--g_input_box_index] = 10;
|
||||
g_update_display = true;
|
||||
}
|
||||
|
||||
AUDIO_PlayBeep(BEEP_1KHZ_60MS_OPTIONAL);
|
||||
@ -135,7 +135,7 @@ void UI_DisplayLock(void)
|
||||
}
|
||||
}
|
||||
|
||||
gKeyBeingHeld = false;
|
||||
g_key_being_held = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -151,10 +151,10 @@ void UI_DisplayLock(void)
|
||||
__enable_irq();
|
||||
}
|
||||
|
||||
if (gUpdateDisplay)
|
||||
if (g_update_display)
|
||||
{
|
||||
Render();
|
||||
gUpdateDisplay = false;
|
||||
g_update_display = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user