New variable names.

This commit is contained in:
Dual Tachyon 2023-08-29 16:02:35 +01:00
parent 3cd189aa6b
commit dcf849b315
8 changed files with 33 additions and 19 deletions

View File

@ -1100,7 +1100,7 @@ void APP_TimeSlice10ms(void)
APP_CheckKeys();
return;
}
if (g_20000461 != 0) {
if (gScannerEditState != 0) {
APP_CheckKeys();
return;
}
@ -1323,7 +1323,7 @@ LAB_00004b08:
}
}
if (gScreenToDisplay == DISPLAY_SCANNER && g_20000461 == 0 && gScanState < 2) {
if (gScreenToDisplay == DISPLAY_SCANNER && gScannerEditState == 0 && gScanState < 2) {
g_20000464++;
if (0x20 < g_20000464) {
if (gScanState == 1 && g_20000458 == 0) {
@ -1420,7 +1420,7 @@ void FUN_000075b0(void)
if (g_20000458 == 1) {
gScanState = 1;
gScanFrequency = gInfoCHAN_A->pDCS_Current->Frequency;
gStepOffset = gInfoCHAN_A->STEP_SETTING;
gStepSetting = gInfoCHAN_A->STEP_SETTING;
BK4819_PickRXFilterPathBasedOnFrequency(gScanFrequency);
BK4819_SetScanFrequency(gScanFrequency);
} else {
@ -1441,7 +1441,7 @@ void FUN_000075b0(void)
g_CTCSS_Lost = false;
g_VOX_Lost = false;
g_SquelchLost = false;
g_20000461 = 0;
gScannerEditState = 0;
g_20000464 = 0;
}

View File

@ -154,7 +154,7 @@ void GENERIC_Key_PTT(bool bKeyPressed)
return;
}
gRequestDisplayScreen = DISPLAY_MAIN;
gEeprom.CROSS_BAND_RX_TX = g_20000459;
gEeprom.CROSS_BAND_RX_TX = gBackupCROSS_BAND_RX_TX;
g_2000036F = 1;
gFlagStopScan = true;
g_2000039A = 2;

View File

@ -214,7 +214,7 @@ void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
gFlagStartScan = true;
g_20000458 = 0;
g_20000459 = gEeprom.CROSS_BAND_RX_TX;
gBackupCROSS_BAND_RX_TX = gEeprom.CROSS_BAND_RX_TX;
gEeprom.CROSS_BAND_RX_TX = CROSS_BAND_OFF;
break;
@ -344,7 +344,7 @@ void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld)
if (IS_NOT_NOAA_CHANNEL(gTxRadioInfo->CHANNEL_SAVE)) {
gFlagStartScan = true;
g_20000458 = 1;
g_20000459 = gEeprom.CROSS_BAND_RX_TX;
gBackupCROSS_BAND_RX_TX = gEeprom.CROSS_BAND_RX_TX;
gEeprom.CROSS_BAND_RX_TX = CROSS_BAND_OFF;
} else {
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;

5
misc.c
View File

@ -139,14 +139,13 @@ bool g_20000439;
uint8_t gMenuListCount;
uint8_t g_20000442;
uint8_t g_20000458;
uint8_t g_20000459;
uint8_t gBackupCROSS_BAND_RX_TX;
uint8_t g_CxCSS_Type;
uint8_t g_CxCSS_Index;
uint8_t g_2000045C;
uint8_t g_2000045D;
uint8_t g_2000045F;
uint8_t gStepOffset;
uint8_t g_20000461;
uint8_t gScannerEditState;
uint8_t g_20000464;
uint8_t gAircopySendCountdown;
uint8_t gFSKWriteIndex;

5
misc.h
View File

@ -163,14 +163,13 @@ extern bool g_20000439;
extern uint8_t gMenuListCount;
extern uint8_t g_20000442;
extern uint8_t g_20000458;
extern uint8_t g_20000459;
extern uint8_t gBackupCROSS_BAND_RX_TX;
extern uint8_t g_CxCSS_Type;
extern uint8_t g_CxCSS_Index;
extern uint8_t g_2000045C;
extern uint8_t g_2000045D;
extern uint8_t g_2000045F;
extern uint8_t gStepOffset;
extern uint8_t g_20000461;
extern uint8_t gScannerEditState;
extern uint8_t g_20000464;
extern uint8_t gAircopySendCountdown;
extern uint8_t gFSKWriteIndex;

View File

@ -38,6 +38,8 @@ DCS_CodeType_t gCodeType;
DCS_CodeType_t gCopyOfCodeType;
uint8_t gCode;
STEP_Setting_t gStepSetting;
bool RADIO_CheckValidChannel(uint16_t Channel, bool bCheckScanList, uint8_t VFO)
{
uint8_t Attributes;
@ -109,7 +111,7 @@ void RADIO_InitInfo(VFO_Info_t *pInfo, uint8_t ChannelSave, uint8_t Band, uint32
pInfo->Band = Band;
pInfo->SCANLIST1_PARTICIPATION = true;
pInfo->SCANLIST2_PARTICIPATION = true;
pInfo->STEP_SETTING = 5;
pInfo->STEP_SETTING = STEP_25_0kHz;
pInfo->StepFrequency = 2500;
pInfo->CHANNEL_SAVE = ChannelSave;
pInfo->FrequencyReverse = false;
@ -218,8 +220,8 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
gEeprom.VfoInfo[VFO].AM_CHANNEL_MODE = !!(Data[3] & 0x10);
Tmp = Data[6];
if (Tmp > 6) {
Tmp = 5;
if (Tmp > STEP_8_33kHz) {
Tmp = STEP_25_0kHz;
}
gEeprom.VfoInfo[VFO].STEP_SETTING = Tmp;
gEeprom.VfoInfo[VFO].StepFrequency = StepFrequencyTable[Tmp];

16
radio.h
View File

@ -46,6 +46,18 @@ enum PTT_ID_t {
typedef enum PTT_ID_t PTT_ID_t;
enum STEP_Setting_t {
STEP_2_5kHz,
STEP_5_0kHz,
STEP_6_25kHz,
STEP_10_0kHz,
STEP_12_5kHz,
STEP_25_0kHz,
STEP_8_33kHz,
};
typedef enum STEP_Setting_t STEP_Setting_t;
typedef struct {
uint32_t Frequency;
DCS_CodeType_t CodeType;
@ -67,7 +79,7 @@ typedef struct VFO_Info_t {
uint8_t SquelchCloseRSSIThresh;
uint8_t SquelchCloseNoiseThresh;
uint8_t SquelchOpenGlitchThresh;
uint8_t STEP_SETTING;
STEP_Setting_t STEP_SETTING;
uint8_t OUTPUT_POWER;
uint8_t TXP_CalculatedSetting;
bool FrequencyReverse;
@ -92,6 +104,8 @@ extern DCS_CodeType_t gCodeType;
extern DCS_CodeType_t gCopyOfCodeType;
extern uint8_t gCode;
extern STEP_Setting_t gStepSetting;
bool RADIO_CheckValidChannel(uint16_t ChNum, bool bCheckScanList, uint8_t RadioNum);
uint8_t RADIO_FindNextChannel(uint8_t ChNum, int8_t Direction, bool bCheckScanList, uint8_t RadioNum);
void RADIO_InitInfo(VFO_Info_t *pInfo, uint8_t ChannelSave, uint8_t ChIndex, uint32_t Frequency);

View File

@ -50,12 +50,12 @@ void UI_DisplayScanner(void)
UI_PrintString(String, 2, 127, 3, 8, 0);
memset(String, 0, sizeof(String));
if (g_20000461 == 2) {
if (gScannerEditState == 2) {
strcpy(String, "SAVE?");
Start = 0;
bCentered = 1;
} else {
if (g_20000461 == 1) {
if (gScannerEditState == 1) {
strcpy(String, "SAVE:");
UI_GenerateChannelStringEx(String + 5, gShowChPrefix, gScanChannel);
} else if (gScanState < 2) {