Cosmetic changes.

This commit is contained in:
Dual Tachyon 2023-08-30 17:59:16 +01:00
parent 2685074625
commit 5a0e332cf7
10 changed files with 31 additions and 31 deletions

View File

@ -797,10 +797,10 @@ void APP_Update(void)
APP_MoreRadioStuff();
}
} else {
if (gCopyOfCodeType != CODE_TYPE_OFF || gCurrentFunction != FUNCTION_3) {
FUN_00007dd4();
} else {
if (gCopyOfCodeType == CODE_TYPE_OFF && gCurrentFunction == FUNCTION_3) {
APP_StartListening(FUNCTION_RECEIVE);
} else {
FUN_00007dd4();
}
}
gScanPauseMode = 0;
@ -1261,15 +1261,15 @@ LAB_00004b08:
}
if (gLowBattery) {
gLowBatteryBlink = ++g_20000400 & 1;
UI_DisplayBattery(g_20000400);
gLowBatteryBlink = ++gLowBatteryCountdown & 1;
UI_DisplayBattery(gLowBatteryCountdown);
if (gCurrentFunction != FUNCTION_TRANSMIT) {
if (g_20000400 < 30) {
if (g_20000400 == 29 && !gChargingWithTypeC) {
if (gLowBatteryCountdown < 30) {
if (gLowBatteryCountdown == 29 && !gChargingWithTypeC) {
AUDIO_PlayBeep(BEEP_500HZ_60MS_DOUBLE_BEEP);
}
} else {
g_20000400 = 0;
gLowBatteryCountdown = 0;
if (!gChargingWithTypeC) {
AUDIO_PlayBeep(BEEP_500HZ_60MS_DOUBLE_BEEP);
AUDIO_SetVoiceID(0, VOICE_ID_LOW_VOLTAGE);

View File

@ -241,7 +241,7 @@ void MENU_AcceptSetting(void)
pConfig->CodeType = CODE_TYPE_REVERSE_DIGITAL;
Code = gSubMenuSelection - 105;
}
pConfig->RX_TX_Code = Code;
pConfig->Code = Code;
gRequestSaveChannel = 1;
return;
@ -260,7 +260,7 @@ void MENU_AcceptSetting(void)
pConfig->CodeType = CODE_TYPE_CONTINUOUS_TONE;
Code = gSubMenuSelection - 1;
}
pConfig->RX_TX_Code = Code;
pConfig->Code = Code;
gRequestSaveChannel = 1;
return;
@ -581,10 +581,10 @@ void MENU_ShowCurrentSetting(void)
case MENU_R_DCS:
switch (gTxInfo->ConfigRX.CodeType) {
case CODE_TYPE_DIGITAL:
gSubMenuSelection = gTxInfo->ConfigRX.RX_TX_Code + 1;
gSubMenuSelection = gTxInfo->ConfigRX.Code + 1;
break;
case CODE_TYPE_REVERSE_DIGITAL:
gSubMenuSelection = gTxInfo->ConfigRX.RX_TX_Code + 105;
gSubMenuSelection = gTxInfo->ConfigRX.Code + 105;
break;
default:
gSubMenuSelection = 0;
@ -598,7 +598,7 @@ void MENU_ShowCurrentSetting(void)
case MENU_R_CTCS:
if (gTxInfo->ConfigRX.CodeType == CODE_TYPE_CONTINUOUS_TONE) {
gSubMenuSelection = gTxInfo->ConfigRX.RX_TX_Code + 1;
gSubMenuSelection = gTxInfo->ConfigRX.Code + 1;
} else {
gSubMenuSelection = 0;
}
@ -607,10 +607,10 @@ void MENU_ShowCurrentSetting(void)
case MENU_T_DCS:
switch (gTxInfo->ConfigTX.CodeType) {
case CODE_TYPE_DIGITAL:
gSubMenuSelection = gTxInfo->ConfigTX.RX_TX_Code + 1;
gSubMenuSelection = gTxInfo->ConfigTX.Code + 1;
break;
case CODE_TYPE_REVERSE_DIGITAL:
gSubMenuSelection = gTxInfo->ConfigTX.RX_TX_Code + 105;
gSubMenuSelection = gTxInfo->ConfigTX.Code + 105;
break;
default:
gSubMenuSelection = 0;
@ -620,7 +620,7 @@ void MENU_ShowCurrentSetting(void)
case MENU_T_CTCS:
if (gTxInfo->ConfigTX.CodeType == CODE_TYPE_CONTINUOUS_TONE) {
gSubMenuSelection = gTxInfo->ConfigTX.RX_TX_Code + 1;
gSubMenuSelection = gTxInfo->ConfigTX.Code + 1;
} else {
gSubMenuSelection = 0;
}

View File

@ -165,7 +165,7 @@ void SCANNER_Key_MENU(bool bKeyPressed, bool bKeyHeld)
RADIO_InitInfo(gTxInfo, gTxInfo->CHANNEL_SAVE, FREQUENCY_GetBand(gScanFrequency), gScanFrequency);
if (g_2000045C == 1) {
gTxInfo->ConfigRX.CodeType = g_CxCSS_Type;
gTxInfo->ConfigRX.RX_TX_Code = g_CxCSS_Index;
gTxInfo->ConfigRX.Code = g_CxCSS_Index;
}
gTxInfo->ConfigTX = gTxInfo->ConfigRX;
gTxInfo->STEP_SETTING = gStepSetting;
@ -173,9 +173,9 @@ void SCANNER_Key_MENU(bool bKeyPressed, bool bKeyHeld)
RADIO_ConfigureChannel(0, 2);
RADIO_ConfigureChannel(1, 2);
gTxInfo->ConfigRX.CodeType = g_CxCSS_Type;
gTxInfo->ConfigRX.RX_TX_Code = g_CxCSS_Index;
gTxInfo->ConfigRX.Code = g_CxCSS_Index;
gTxInfo->ConfigTX.CodeType = g_CxCSS_Type;
gTxInfo->ConfigTX.RX_TX_Code = g_CxCSS_Index;
gTxInfo->ConfigTX.Code = g_CxCSS_Index;
}
if (IS_MR_CHANNEL(gTxInfo->CHANNEL_SAVE)) {

View File

@ -317,7 +317,7 @@ void BK4819_SetupPowerAmplifier(uint16_t Bias, uint32_t Frequency)
void BK4819_SetFrequency(uint32_t Frequency)
{
BK4819_WriteRegister(BK4819_REG_38, (Frequency >> 0) & 0xFFFF);
BK4819_WriteRegister(BK4819_REG_38, (Frequency >> 0) & 0xFFFF);
BK4819_WriteRegister(BK4819_REG_39, (Frequency >> 16) & 0xFFFF);
}

View File

@ -87,7 +87,7 @@ void BATTERY_GetReadings(bool bDisplayBatteryLevel)
UI_DisplayBattery(gBatteryDisplayLevel);
}
}
g_20000400 = 0;
gLowBatteryCountdown = 0;
}
}

2
misc.c
View File

@ -118,7 +118,7 @@ uint8_t gDTMFChosenContact;
uint16_t g_200003E2;
volatile uint16_t gFlashLightBlinkCounter;
uint8_t g_200003FD;
uint8_t g_20000400;
uint8_t gLowBatteryCountdown;
uint8_t g_20000410;
uint8_t g_20000411;
uint8_t g_20000413;

2
misc.h
View File

@ -142,7 +142,7 @@ extern uint8_t gDTMFChosenContact;
extern uint16_t g_200003E2;
extern volatile uint16_t gFlashLightBlinkCounter;
extern uint8_t g_200003FD;
extern uint8_t g_20000400;
extern uint8_t gLowBatteryCountdown;
extern uint8_t g_20000410;
extern uint8_t g_20000411;
extern uint8_t g_20000413;

10
radio.c
View File

@ -252,7 +252,7 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
Tmp = 0;
break;
}
gEeprom.VfoInfo[VFO].ConfigRX.RX_TX_Code = Tmp;
gEeprom.VfoInfo[VFO].ConfigRX.Code = Tmp;
Tmp = Data[1];
switch (gEeprom.VfoInfo[VFO].ConfigTX.CodeType) {
@ -272,7 +272,7 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
Tmp = 0;
break;
}
gEeprom.VfoInfo[VFO].ConfigTX.RX_TX_Code = Tmp;
gEeprom.VfoInfo[VFO].ConfigTX.Code = Tmp;
if (Data[4] == 0xFF) {
gEeprom.VfoInfo[VFO].FrequencyReverse = false;
@ -527,7 +527,7 @@ void RADIO_SetupRegisters(bool bSwitchToFunction0)
Code = gCode;
if (g_20000381 == 0) {
CodeType = gRxInfo->pCurrent->CodeType;
Code = gRxInfo->pCurrent->RX_TX_Code;
Code = gRxInfo->pCurrent->Code;
}
switch (CodeType) {
case CODE_TYPE_DIGITAL:
@ -664,14 +664,14 @@ void RADIO_PrepareTransmit(void)
switch (gCrossTxRadioInfo->pReverse->CodeType) {
case CODE_TYPE_CONTINUOUS_TONE:
BK4819_SetCTCSSBaudRate(CTCSS_Options[gCrossTxRadioInfo->pReverse->RX_TX_Code]);
BK4819_SetCTCSSBaudRate(CTCSS_Options[gCrossTxRadioInfo->pReverse->Code]);
break;
case CODE_TYPE_DIGITAL:
case CODE_TYPE_REVERSE_DIGITAL:
BK4819_SetCDCSSCodeWord(
DCS_GetGolayCodeWord(
gCrossTxRadioInfo->pReverse->CodeType,
gCrossTxRadioInfo->pReverse->RX_TX_Code
gCrossTxRadioInfo->pReverse->Code
)
);
break;

View File

@ -61,7 +61,7 @@ typedef enum STEP_Setting_t STEP_Setting_t;
typedef struct {
uint32_t Frequency;
DCS_CodeType_t CodeType;
uint8_t RX_TX_Code;
uint8_t Code;
uint8_t Padding[2];
} FREQ_Config_t;

View File

@ -193,8 +193,8 @@ void SETTINGS_SaveChannel(uint8_t Channel, uint8_t VFO, const VFO_Info_t *pVFO,
EEPROM_WriteBuffer(OffsetVFO + 0, State32);
State8[0] = pVFO->ConfigRX.RX_TX_Code;
State8[1] = pVFO->ConfigTX.RX_TX_Code;
State8[0] = pVFO->ConfigRX.Code;
State8[1] = pVFO->ConfigTX.Code;
State8[2] = (pVFO->ConfigTX.CodeType << 4) | pVFO->ConfigRX.CodeType;
State8[3] = (pVFO->AM_CHANNEL_MODE << 4) | pVFO->FREQUENCY_DEVIATION_SETTING;
State8[4] = 0