A few more renames.

This commit is contained in:
Dual Tachyon 2023-09-04 22:26:57 +01:00
parent 774f293254
commit e8a8cf7466
9 changed files with 37 additions and 37 deletions

View File

@ -54,7 +54,7 @@
static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld); static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld);
static void FUN_00005144(void) static void APP_CheckForIncoming(void)
{ {
if (!g_SquelchLost) { if (!g_SquelchLost) {
return; return;
@ -70,33 +70,33 @@ static void FUN_00005144(void)
gNOAA_Countdown = 20; gNOAA_Countdown = 20;
gScheduleNOAA = false; gScheduleNOAA = false;
} }
FUNCTION_Select(FUNCTION_3); FUNCTION_Select(FUNCTION_INCOMING);
return; return;
} }
if (gRxReceptionMode != RX_MODE_NONE) { if (gRxReceptionMode != RX_MODE_NONE) {
FUNCTION_Select(FUNCTION_3); FUNCTION_Select(FUNCTION_INCOMING);
return; return;
} }
gDualWatchCountdown = 100; gDualWatchCountdown = 100;
gScheduleDualWatch = false; gScheduleDualWatch = false;
} else { } else {
if (gRxReceptionMode != RX_MODE_NONE) { if (gRxReceptionMode != RX_MODE_NONE) {
FUNCTION_Select(FUNCTION_3); FUNCTION_Select(FUNCTION_INCOMING);
return; return;
} }
ScanPauseDelayIn10msec = 20; ScanPauseDelayIn10msec = 20;
gScheduleScanListen = false; gScheduleScanListen = false;
} }
gRxReceptionMode = RX_MODE_DETECTED; gRxReceptionMode = RX_MODE_DETECTED;
FUNCTION_Select(FUNCTION_3); FUNCTION_Select(FUNCTION_INCOMING);
} }
void FUN_000051e8(void) static void APP_HandleIncoming(void)
{ {
bool bFlag; bool bFlag;
if (!g_SquelchLost) { if (!g_SquelchLost) {
FUNCTION_Select(FUNCTION_0); FUNCTION_Select(FUNCTION_FOREGROUND);
gUpdateDisplay = true; gUpdateDisplay = true;
return; return;
} }
@ -294,16 +294,16 @@ Skip:
void FUN_0000510c(void) void FUN_0000510c(void)
{ {
switch (gCurrentFunction) { switch (gCurrentFunction) {
case FUNCTION_0: case FUNCTION_FOREGROUND:
FUN_00005144(); APP_CheckForIncoming();
break; break;
case FUNCTION_POWER_SAVE: case FUNCTION_POWER_SAVE:
if (!gRxIdleMode) { if (!gRxIdleMode) {
FUN_00005144(); APP_CheckForIncoming();
} }
break; break;
case FUNCTION_3: case FUNCTION_INCOMING:
FUN_000051e8(); APP_HandleIncoming();
break; break;
case FUNCTION_RECEIVE: case FUNCTION_RECEIVE:
FUN_000052f0(); FUN_000052f0();
@ -463,7 +463,7 @@ Skip:
} }
} }
void NOAA_IncreaseChannel(void) static void NOAA_IncreaseChannel(void)
{ {
gNoaaChannel++; gNoaaChannel++;
if (gNoaaChannel > 9) { if (gNoaaChannel > 9) {
@ -581,7 +581,7 @@ void APP_EndTransmission(void)
RADIO_SetupRegisters(false); RADIO_SetupRegisters(false);
} }
static void FUN_00008334(void) static void APP_HandleVox(void)
{ {
if (!gSetting_KILLED) { if (!gSetting_KILLED) {
if (g_200003B6 == 0) { if (g_200003B6 == 0) {
@ -601,11 +601,11 @@ static void FUN_00008334(void)
} }
if (gCurrentFunction == FUNCTION_TRANSMIT && !gPttIsPressed && !gVOX_NoiseDetected) { if (gCurrentFunction == FUNCTION_TRANSMIT && !gPttIsPressed && !gVOX_NoiseDetected) {
if (gFlagEndTransmission) { if (gFlagEndTransmission) {
FUNCTION_Select(FUNCTION_0); FUNCTION_Select(FUNCTION_FOREGROUND);
} else { } else {
APP_EndTransmission(); APP_EndTransmission();
if (gEeprom.REPEATER_TAIL_TONE_ELIMINATION == 0) { if (gEeprom.REPEATER_TAIL_TONE_ELIMINATION == 0) {
FUNCTION_Select(FUNCTION_0); FUNCTION_Select(FUNCTION_FOREGROUND);
} else { } else {
gRTTECountdown = gEeprom.REPEATER_TAIL_TONE_ELIMINATION * 10; gRTTECountdown = gEeprom.REPEATER_TAIL_TONE_ELIMINATION * 10;
} }
@ -617,7 +617,7 @@ static void FUN_00008334(void)
} else if (g_VOX_Lost) { } else if (g_VOX_Lost) {
gVOX_NoiseDetected = true; gVOX_NoiseDetected = true;
if (gCurrentFunction == FUNCTION_POWER_SAVE) { if (gCurrentFunction == FUNCTION_POWER_SAVE) {
FUNCTION_Select(FUNCTION_0); FUNCTION_Select(FUNCTION_FOREGROUND);
} }
if (gCurrentFunction != FUNCTION_TRANSMIT) { if (gCurrentFunction != FUNCTION_TRANSMIT) {
gDTMF_ReplyState = DTMF_REPLY_NONE; gDTMF_ReplyState = DTMF_REPLY_NONE;
@ -657,13 +657,13 @@ void APP_Update(void)
if (gScreenToDisplay != DISPLAY_SCANNER && gScanState != SCAN_OFF && gScheduleScanListen && !gPttIsPressed && gVoiceWriteIndex == 0) { if (gScreenToDisplay != DISPLAY_SCANNER && gScanState != SCAN_OFF && gScheduleScanListen && !gPttIsPressed && gVoiceWriteIndex == 0) {
if (IS_FREQ_CHANNEL(gNextMrChannel)) { if (IS_FREQ_CHANNEL(gNextMrChannel)) {
if (gCurrentFunction == FUNCTION_3) { if (gCurrentFunction == FUNCTION_INCOMING) {
APP_StartListening(FUNCTION_RECEIVE); APP_StartListening(FUNCTION_RECEIVE);
} else { } else {
FREQ_NextChannel(); FREQ_NextChannel();
} }
} else { } else {
if (gCopyOfCodeType == CODE_TYPE_OFF && gCurrentFunction == FUNCTION_3) { if (gCopyOfCodeType == CODE_TYPE_OFF && gCurrentFunction == FUNCTION_INCOMING) {
APP_StartListening(FUNCTION_RECEIVE); APP_StartListening(FUNCTION_RECEIVE);
} else { } else {
MR_NextChannel(); MR_NextChannel();
@ -709,7 +709,7 @@ void APP_Update(void)
} }
if (gEeprom.VOX_SWITCH) { if (gEeprom.VOX_SWITCH) {
FUN_00008334(); APP_HandleVox();
} }
if (gSchedulePowerSave) { if (gSchedulePowerSave) {
@ -909,7 +909,7 @@ void APP_TimeSlice10ms(void)
if (gRTTECountdown) { if (gRTTECountdown) {
gRTTECountdown--; gRTTECountdown--;
if (gRTTECountdown == 0) { if (gRTTECountdown == 0) {
FUNCTION_Select(FUNCTION_0); FUNCTION_Select(FUNCTION_FOREGROUND);
gUpdateDisplay = true; gUpdateDisplay = true;
} }
} }
@ -1296,7 +1296,7 @@ static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
bool bFlag; bool bFlag;
if (gCurrentFunction == FUNCTION_POWER_SAVE) { if (gCurrentFunction == FUNCTION_POWER_SAVE) {
FUNCTION_Select(FUNCTION_0); FUNCTION_Select(FUNCTION_FOREGROUND);
} }
gBatterySaveCountdown = 1000; gBatterySaveCountdown = 1000;
if (gEeprom.AUTO_KEYPAD_LOCK) { if (gEeprom.AUTO_KEYPAD_LOCK) {
@ -1462,7 +1462,7 @@ static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
} else if (!bKeyHeld && bKeyPressed) { } else if (!bKeyHeld && bKeyPressed) {
FUN_00001150(); FUN_00001150();
if (gEeprom.REPEATER_TAIL_TONE_ELIMINATION == 0) { if (gEeprom.REPEATER_TAIL_TONE_ELIMINATION == 0) {
FUNCTION_Select(FUNCTION_0); FUNCTION_Select(FUNCTION_FOREGROUND);
} else { } else {
gRTTECountdown = gEeprom.REPEATER_TAIL_TONE_ELIMINATION * 10; gRTTECountdown = gEeprom.REPEATER_TAIL_TONE_ELIMINATION * 10;
} }

View File

@ -19,11 +19,13 @@
#include <stdbool.h> #include <stdbool.h>
#include "functions.h" #include "functions.h"
#include "radio.h"
void FUN_0000773c(void); void FUN_0000773c(void);
void APP_EndTransmission(void); void APP_EndTransmission(void);
void CHANNEL_Next(bool bFlag, int8_t Direction); void CHANNEL_Next(bool bFlag, int8_t Direction);
void APP_StartListening(FUNCTION_Type_t Function); void APP_StartListening(FUNCTION_Type_t Function);
void APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t Step);
void APP_Update(void); void APP_Update(void);
void APP_TimeSlice10ms(void); void APP_TimeSlice10ms(void);

View File

@ -82,11 +82,11 @@ void GENERIC_Key_PTT(bool bKeyPressed)
if (gScreenToDisplay == DISPLAY_MAIN) { if (gScreenToDisplay == DISPLAY_MAIN) {
if (gCurrentFunction == FUNCTION_TRANSMIT) { if (gCurrentFunction == FUNCTION_TRANSMIT) {
if (gFlagEndTransmission) { if (gFlagEndTransmission) {
FUNCTION_Select(FUNCTION_0); FUNCTION_Select(FUNCTION_FOREGROUND);
} else { } else {
APP_EndTransmission(); APP_EndTransmission();
if (gEeprom.REPEATER_TAIL_TONE_ELIMINATION == 0) { if (gEeprom.REPEATER_TAIL_TONE_ELIMINATION == 0) {
FUNCTION_Select(FUNCTION_0); FUNCTION_Select(FUNCTION_FOREGROUND);
} else { } else {
gRTTECountdown = gEeprom.REPEATER_TAIL_TONE_ELIMINATION * 10; gRTTECountdown = gEeprom.REPEATER_TAIL_TONE_ELIMINATION * 10;
} }

View File

@ -30,8 +30,6 @@
#include "ui/inputbox.h" #include "ui/inputbox.h"
#include "ui/ui.h" #include "ui/ui.h"
extern void APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t Step);
static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
{ {
uint8_t Vfo; uint8_t Vfo;

View File

@ -369,7 +369,7 @@ static void CMD_052F(const uint8_t *pBuffer)
gEeprom.VfoInfo[0].DTMF_DECODING_ENABLE = false; gEeprom.VfoInfo[0].DTMF_DECODING_ENABLE = false;
gIsNoaaMode = false; gIsNoaaMode = false;
if (gCurrentFunction == FUNCTION_POWER_SAVE) { if (gCurrentFunction == FUNCTION_POWER_SAVE) {
FUNCTION_Select(FUNCTION_0); FUNCTION_Select(FUNCTION_FOREGROUND);
} }
Timestamp = pCmd->Timestamp; Timestamp = pCmd->Timestamp;
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT);

View File

@ -83,7 +83,7 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
} }
switch (Function) { switch (Function) {
case FUNCTION_0: case FUNCTION_FOREGROUND:
if (gDTMF_ReplyState != DTMF_REPLY_NONE) { if (gDTMF_ReplyState != DTMF_REPLY_NONE) {
RADIO_PrepareCssTX(); RADIO_PrepareCssTX();
} }
@ -103,7 +103,7 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
break; break;
case FUNCTION_MONITOR: case FUNCTION_MONITOR:
case FUNCTION_3: case FUNCTION_INCOMING:
case FUNCTION_RECEIVE: case FUNCTION_RECEIVE:
gBatterySaveCountdown = 1000; gBatterySaveCountdown = 1000;
gSchedulePowerSave = false; gSchedulePowerSave = false;

View File

@ -20,11 +20,11 @@
#include <stdint.h> #include <stdint.h>
enum FUNCTION_Type_t { enum FUNCTION_Type_t {
FUNCTION_0 = 0U, FUNCTION_FOREGROUND = 0U,
FUNCTION_TRANSMIT = 1U, FUNCTION_TRANSMIT = 1U,
FUNCTION_MONITOR = 2U, FUNCTION_MONITOR = 2U,
FUNCTION_3 = 3U, FUNCTION_INCOMING = 3U,
FUNCTION_RECEIVE = 4U, FUNCTION_RECEIVE = 4U,
FUNCTION_POWER_SAVE = 5U, FUNCTION_POWER_SAVE = 5U,
}; };

View File

@ -602,7 +602,7 @@ void RADIO_SetupRegisters(bool bSwitchToFunction0)
FUNCTION_Init(); FUNCTION_Init();
if (bSwitchToFunction0) { if (bSwitchToFunction0) {
FUNCTION_Select(FUNCTION_0); FUNCTION_Select(FUNCTION_FOREGROUND);
} }
} }

View File

@ -55,7 +55,7 @@ void SystickHandler(void)
if (gFoundCTCSSCountdown) { if (gFoundCTCSSCountdown) {
gFoundCTCSSCountdown--; gFoundCTCSSCountdown--;
} }
if (gCurrentFunction == FUNCTION_0) { if (gCurrentFunction == FUNCTION_FOREGROUND) {
DECREMENT_AND_TRIGGER(gBatterySaveCountdown, gSchedulePowerSave); DECREMENT_AND_TRIGGER(gBatterySaveCountdown, gSchedulePowerSave);
} }
if (gCurrentFunction == FUNCTION_POWER_SAVE) { if (gCurrentFunction == FUNCTION_POWER_SAVE) {