Renamed various variables.

This commit is contained in:
Dual Tachyon 2023-08-29 13:26:13 +01:00
parent dab5bcffd9
commit aa8001d877
7 changed files with 51 additions and 51 deletions

View File

@ -664,7 +664,7 @@ void APP_PlayFM(void)
{
if (!FM_ChecksChannelValid_and_FrequencyDeviation(gEeprom.FM_FrequencyToPlay, gEeprom.FM_LowerLimit)) {
if (gIs_A_Scan != 1) {
g_2000034C = 0;
gFmPlayCountdown = 0;
g_20000427 = 1;
if (gEeprom.FM_IsChannelSelected == false) {
gEeprom.FM_CurrentFrequency = gEeprom.FM_FrequencyToPlay;
@ -847,8 +847,8 @@ void APP_Update(void)
gFlagPlayQueuedVoice = false;
}
if (gCurrentFunction == FUNCTION_TRANSMIT && gSystickFlag0) {
gSystickFlag0 = false;
if (gCurrentFunction == FUNCTION_TRANSMIT && gTxTimeoutReached) {
gTxTimeoutReached = false;
g_200003FD = 1;
TalkRelatedCode();
AUDIO_PlayBeep(BEEP_500HZ_60MS_DOUBLE_BEEP);
@ -913,26 +913,26 @@ void APP_Update(void)
}
}
if (gFM_Step && gSystickFlag11 && gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_4 && gCurrentFunction != FUNCTION_TRANSMIT) {
if (gFM_Step && gScheduleFM && gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_4 && gCurrentFunction != FUNCTION_TRANSMIT) {
APP_PlayFM();
gSystickFlag11 = false;
gScheduleFM = false;
}
if (gEeprom.VOX_SWITCH) {
FUN_00008334();
}
if (gSystickFlag5) {
if (gSchedulePowerSave) {
if (gEeprom.BATTERY_SAVE == 0 || gStepDirection || g_20000381 || gFmRadioMode || gPttIsPressed || gScreenToDisplay != DISPLAY_MAIN || gKeyBeingHeld || g_200003BC) {
g_2000032E = 1000;
gBatterySaveCountdown = 1000;
} else {
if ((IS_NOT_NOAA_CHANNEL(gEeprom.ScreenChannel[0]) && IS_NOT_NOAA_CHANNEL(gEeprom.ScreenChannel[1])) || !gIsNoaaMode) {
FUNCTION_Select(FUNCTION_POWER_SAVE);
} else {
g_2000032E = 1000;
gBatterySaveCountdown = 1000;
}
}
gSystickFlag5 = false;
gSchedulePowerSave = false;
}
if (gBatterySaveCountdownExpired && gCurrentFunction == FUNCTION_POWER_SAVE && gVoiceWriteIndex == 0) {
@ -1859,7 +1859,7 @@ static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
if (gCurrentFunction == FUNCTION_POWER_SAVE) {
FUNCTION_Select(FUNCTION_0);
}
g_2000032E = 1000;
gBatterySaveCountdown = 1000;
if (gEeprom.AUTO_KEYPAD_LOCK) {
gKeyLockCountdown = 30;
}

View File

@ -107,11 +107,11 @@ void FM_Tune(uint16_t Frequency, int8_t Step, bool bFlag)
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH);
g_2000036B = 0;
if (gFM_Step == 0) {
g_2000034C = 120;
gFmPlayCountdown = 120;
} else {
g_2000034C = 10;
gFmPlayCountdown = 10;
}
gSystickFlag11 = false;
gScheduleFM = false;
g_20000427 = 0;
gAskToSave = false;
gAskToDelete = false;
@ -140,8 +140,8 @@ void FM_Play(void)
FM_ConfigureChannelState();
BK1080_SetFrequency(gEeprom.FM_FrequencyToPlay);
SETTINGS_SaveFM();
g_2000034C = 0;
gSystickFlag11 = false;
gFmPlayCountdown = 0;
gScheduleFM = false;
gAskToSave = false;
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH);
g_2000036B = 1;

View File

@ -94,27 +94,27 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
gVFO_RSSI_Level[0] = 0;
gVFO_RSSI_Level[1] = 0;
} else if (PreviousFunction != FUNCTION_TRANSMIT) {
g_2000032E = 1000;
gSystickFlag5 = false;
gBatterySaveCountdown = 1000;
gSchedulePowerSave = false;
return;
}
if (gFmRadioMode) {
g_2000038E = 500;
}
if (g_200003BC != 1 && g_200003BC != 2) {
g_2000032E = 1000;
gSystickFlag5 = false;
gBatterySaveCountdown = 1000;
gSchedulePowerSave = false;
return;
}
g_2000032E = 1000;
gSystickFlag5 = false;
gBatterySaveCountdown = 1000;
gSchedulePowerSave = false;
gDTMF_AUTO_RESET_TIME = 1 + (gEeprom.DTMF_AUTO_RESET_TIME * 2);
return;
}
if (Function == FUNCTION_MONITOR || Function == FUNCTION_3 || Function == FUNCTION_4) {
g_2000032E = 1000;
gSystickFlag5 = false;
gBatterySaveCountdown = 1000;
gSchedulePowerSave = false;
g_2000038E = 0;
return;
}
@ -150,8 +150,8 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
g_2000036B = 1;
SYSTEM_DelayMs(60);
BK4819_ExitTxMute();
g_2000032E = 1000;
gSystickFlag5 = false;
gBatterySaveCountdown = 1000;
gSchedulePowerSave = false;
g_2000038E = 0;
g_20000420 = 0;
return;
@ -220,20 +220,20 @@ Skip:
g_20000420 = 0;
g_2000038E = 0;
g_2000036B = 1;
gSystickFlag5 = false;
g_2000032E = 1000;
gSchedulePowerSave = false;
gBatterySaveCountdown = 1000;
return;
}
if (gCrossTxRadioInfo->SCRAMBLING_TYPE && gSetting_ScrambleEnable != false) {
BK4819_EnableScramble(gCrossTxRadioInfo->SCRAMBLING_TYPE - 1U);
g_2000032E = 1000;
gSystickFlag5 = false;
gBatterySaveCountdown = 1000;
gSchedulePowerSave = false;
g_2000038E = 0;
return;
}
BK4819_DisableScramble();
g_2000032E = 1000;
gSystickFlag5 = false;
gBatterySaveCountdown = 1000;
gSchedulePowerSave = false;
g_2000038E = 0;
}

10
misc.c
View File

@ -46,11 +46,11 @@ uint16_t gEEPROM_1F8C;
uint8_t gMR_ChannelAttributes[207];
volatile bool gNextTimeslice500ms;
volatile uint16_t g_2000032E;
volatile uint16_t gBatterySaveCountdown;
volatile uint16_t g_2000033A;
volatile uint16_t gTxTimerCountdown = 1000;
volatile uint16_t g_20000342;
volatile uint16_t g_2000034C;
volatile uint16_t gFmPlayCountdown = 1;
volatile uint16_t g_20000356;
uint16_t g_20000362;
uint8_t g_2000036B;
@ -177,15 +177,15 @@ volatile uint16_t gSystickCountdown2;
volatile uint8_t gSystickCountdown3;
volatile uint8_t gSystickCountdown4;
volatile uint16_t gSystickCountdown11;
volatile bool gSystickFlag0;
volatile bool gTxTimeoutReached;
volatile bool gNextTimeslice40ms;
volatile bool gSystickFlag5;
volatile bool gSchedulePowerSave;
volatile bool gBatterySaveCountdownExpired;
volatile bool gSystickFlag7;
volatile bool gSystickFlag8;
volatile bool gSystickFlag9;
volatile bool gSystickFlag10;
volatile bool gSystickFlag11;
volatile bool gScheduleFM;
volatile uint16_t ScanPauseDelayIn10msec;

10
misc.h
View File

@ -70,11 +70,11 @@ extern uint16_t gEEPROM_1F8C;
extern uint8_t gMR_ChannelAttributes[207];
extern volatile bool gNextTimeslice500ms;
extern volatile uint16_t g_2000032E;
extern volatile uint16_t gBatterySaveCountdown;
extern volatile uint16_t g_2000033A;
extern volatile uint16_t gTxTimerCountdown;
extern volatile uint16_t g_20000342;
extern volatile uint16_t g_2000034C;
extern volatile uint16_t gFmPlayCountdown;
extern volatile uint16_t g_20000356;
extern uint16_t g_20000362;
extern uint8_t g_2000036B;
@ -201,15 +201,15 @@ extern volatile uint16_t gSystickCountdown2;
extern volatile uint8_t gSystickCountdown3;
extern volatile uint8_t gSystickCountdown4;
extern volatile uint16_t gSystickCountdown11;
extern volatile bool gSystickFlag0;
extern volatile bool gTxTimeoutReached;
extern volatile bool gNextTimeslice40ms;
extern volatile bool gSystickFlag5;
extern volatile bool gSchedulePowerSave;
extern volatile bool gBatterySaveCountdownExpired;
extern volatile bool gSystickFlag7;
extern volatile bool gSystickFlag8;
extern volatile bool gSystickFlag9;
extern volatile bool gSystickFlag10;
extern volatile bool gSystickFlag11;
extern volatile bool gScheduleFM;
extern volatile uint16_t ScanPauseDelayIn10msec;

View File

@ -747,7 +747,7 @@ LAB_00007c20:
} else {
gTxTimerCountdown = 0;
}
gSystickFlag0 = 0;
gTxTimeoutReached = false;
g_200003FD = 0;
gRTTECountdown = 0;
}

View File

@ -33,7 +33,7 @@ void SystickHandler(void)
if (gTxTimerCountdown != 0) {
gTxTimerCountdown--;
if (gTxTimerCountdown == 0) {
gSystickFlag0 = true;
gTxTimeoutReached = true;
}
}
}
@ -49,10 +49,10 @@ void SystickHandler(void)
if (gSystickCountdown4 != 0) {
gSystickCountdown4--;
}
if (gCurrentFunction == FUNCTION_0 && g_2000032E != 0) {
g_2000032E--;
if (g_2000032E == 0) {
gSystickFlag5 = true;
if (gCurrentFunction == FUNCTION_0 && gBatterySaveCountdown != 0) {
gBatterySaveCountdown--;
if (gBatterySaveCountdown == 0) {
gSchedulePowerSave = true;
}
}
if (gCurrentFunction == FUNCTION_POWER_SAVE && gBatterySave != 0) {
@ -114,10 +114,10 @@ void SystickHandler(void)
if (gFM_Step != 0 && gCurrentFunction != FUNCTION_MONITOR) {
if (gCurrentFunction != FUNCTION_TRANSMIT && gCurrentFunction != FUNCTION_4) {
if (g_2000034C != 0) {
g_2000034C--;
if (g_2000034C == 0) {
gSystickFlag11 = true;
if (gFmPlayCountdown != 0) {
gFmPlayCountdown--;
if (gFmPlayCountdown == 0) {
gScheduleFM = true;
}
}
}