Improved variable names and usage.

This commit is contained in:
Dual Tachyon 2023-08-15 11:14:43 +01:00
parent 2b510bdc1f
commit ca6f3f53be
4 changed files with 18 additions and 17 deletions

1
gui.c
View File

@ -130,6 +130,7 @@ void GUI_PasswordScreen(void)
while (1) {
while (!gNextTimeslice) {
}
// TODO: Original code doesn't do the below, but is needed for proper key debounce.
gNextTimeslice = false;
Key = KEYBOARD_Poll();
if (gKeyReading0 == Key) {

4
misc.c
View File

@ -100,7 +100,7 @@ uint8_t g_20000D0C[16];
bool gIs_A_Scan;
bool gIsNoaaMode;
volatile bool gMaybeVsync;
volatile bool gNextTimeslice;
bool gNoaaChannel;
bool gUpdateDisplay;
uint8_t gA_Scan_Channel;
@ -120,7 +120,7 @@ volatile uint16_t gSystickCountdown11;
volatile bool gSystickFlag0;
volatile bool gSystickFlag1;
volatile bool gSystickFlag5;
volatile bool gSystickFlag6;
volatile bool gBatterySaveCountdownExpired;
volatile bool gSystickFlag7;
volatile bool gSystickFlag8;
volatile bool gSystickFlag9;

4
misc.h
View File

@ -103,7 +103,7 @@ extern uint8_t g_20000D0C[16];
extern bool gIs_A_Scan;
extern bool gIsNoaaMode;
extern volatile bool gMaybeVsync;
extern volatile bool gNextTimeslice;
extern bool gNoaaChannel;
extern bool gUpdateDisplay;
extern uint8_t gA_Scan_Channel;
@ -123,7 +123,7 @@ extern volatile uint16_t gSystickCountdown11;
extern volatile bool gSystickFlag0;
extern volatile bool gSystickFlag1;
extern volatile bool gSystickFlag5;
extern volatile bool gSystickFlag6;
extern volatile bool gBatterySaveCountdownExpired;
extern volatile bool gSystickFlag7;
extern volatile bool gSystickFlag8;
extern volatile bool gSystickFlag9;

View File

@ -21,23 +21,23 @@
#include "misc.h"
#include "settings.h"
static uint32_t gGlobalSysTickCounter;
static volatile uint32_t gGlobalSysTickCounter;
void SystickHandler(void)
{
gGlobalSysTickCounter += 1;
gMaybeVsync = 1;
gGlobalSysTickCounter++;
gNextTimeslice = true;
if ((gGlobalSysTickCounter % 50) == 0) {
g_2000032E = 1;
g_2000032E = true;
if (g_2000033E != 0) {
g_2000033E--;
if (g_2000033E == 0) {
gSystickFlag0 = 1;
gSystickFlag0 = true;
}
}
}
if ((gGlobalSysTickCounter & 3) == 0) {
gSystickFlag1 = 1;
gSystickFlag1 = true;
}
if (gSystickCountdown2 != 0) {
gSystickCountdown2--;
@ -51,13 +51,13 @@ void SystickHandler(void)
if (gCurrentFunction == FUNCTION_0 && g_2000032E != 0) {
g_2000032E--;
if (g_2000032E == 0) {
gSystickFlag5 = 1;
gSystickFlag5 = true;
}
}
if (gCurrentFunction == FUNCTION_POWER_SAVE && gBatterySave != 0) {
gBatterySave--;
if (gBatterySave == 0) {
gSystickFlag6 = 1;
gBatterySaveCountdownExpired = true;
}
}
if (g_20000380 == 0 && g_20000381 == 0 && gEeprom.DUAL_WATCH != 0) {
@ -66,7 +66,7 @@ void SystickHandler(void)
if (g_2000033A != 0) {
g_2000033A--;
if (g_2000033A == 0) {
gSystickFlag7 = 1;
gSystickFlag7 = true;
}
}
}
@ -79,7 +79,7 @@ void SystickHandler(void)
if (g_20000356 != 0) {
g_20000356--;
if (g_20000356 == 0) {
gSystickFlag8 = 1;
gSystickFlag8 = true;
}
}
}
@ -91,7 +91,7 @@ void SystickHandler(void)
if (ScanPauseDelayIn10msec != 0) {
ScanPauseDelayIn10msec--;
if (ScanPauseDelayIn10msec == 0) {
gSystickFlag9 = 1;
gSystickFlag9 = true;
}
}
}
@ -100,7 +100,7 @@ void SystickHandler(void)
if (g_20000342 != 0) {
g_20000342--;
if (g_20000342 == 0) {
gSystickFlag10 = 1;
gSystickFlag10 = true;
}
}
@ -116,7 +116,7 @@ void SystickHandler(void)
if (g_2000034C != 0) {
g_2000034C--;
if (g_2000034C == 0) {
gSystickFlag11 = 1;
gSystickFlag11 = true;
}
}
}