Skip to content

Commit

Permalink
Menu wording updates
Browse files Browse the repository at this point in the history
  • Loading branch information
OneOfEleven committed Sep 12, 2023
1 parent b93aa24 commit 21d5d1e
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 76 deletions.
Binary file modified firmware
Binary file not shown.
Binary file modified firmware.bin
Binary file not shown.
Binary file modified firmware.packed.bin
Binary file not shown.
68 changes: 33 additions & 35 deletions radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,15 @@ uint8_t RADIO_FindNextChannel(uint8_t Channel, int8_t Direction, bool bCheckScan
void RADIO_InitInfo(VFO_Info_t *pInfo, uint8_t ChannelSave, uint8_t Band, uint32_t Frequency)
{
memset(pInfo, 0, sizeof(*pInfo));

pInfo->Band = Band;
pInfo->SCANLIST1_PARTICIPATION = true;
pInfo->SCANLIST2_PARTICIPATION = true;
pInfo->STEP_SETTING = STEP_12_5kHz; // STEP_25_0kHz;
pInfo->STEP_SETTING = STEP_12_5kHz;
pInfo->StepFrequency = 2500;
pInfo->CHANNEL_SAVE = ChannelSave;
pInfo->FrequencyReverse = false;
pInfo->OUTPUT_POWER = OUTPUT_POWER_HIGH;
pInfo->OUTPUT_POWER = OUTPUT_POWER_LOW;
pInfo->ConfigRX.Frequency = Frequency;
pInfo->ConfigTX.Frequency = Frequency;
pInfo->pRX = &pInfo->ConfigRX;
Expand Down Expand Up @@ -157,16 +158,16 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
if (Channel >= NOAA_CHANNEL_FIRST)
{
RADIO_InitInfo(pRadio, gEeprom.ScreenChannel[VFO], 2, NoaaFrequencyTable[Channel - NOAA_CHANNEL_FIRST]);

if (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF)
return;

gUpdateStatus = true;
gEeprom.CROSS_BAND_RX_TX = CROSS_BAND_OFF;
return;
}
#endif

if (IS_MR_CHANNEL(Channel))
{
Channel = RADIO_FindNextChannel(Channel, RADIO_CHANNEL_UP, false, VFO);
Expand All @@ -192,7 +193,7 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)

if (IS_MR_CHANNEL(Channel))
{
Channel = gEeprom.FreqChannel[VFO];
Channel = gEeprom.FreqChannel[VFO];
gEeprom.ScreenChannel[VFO] = gEeprom.FreqChannel[VFO];
}

Expand Down Expand Up @@ -280,6 +281,12 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
Tmp = Data[1];
switch (gEeprom.VfoInfo[VFO].ConfigTX.CodeType)
{
default:
case CODE_TYPE_OFF:
gEeprom.VfoInfo[VFO].ConfigTX.CodeType = CODE_TYPE_OFF;
Tmp = 0;
break;

case CODE_TYPE_CONTINUOUS_TONE:
if (Tmp >= 50)
Tmp = 0;
Expand All @@ -290,11 +297,6 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
if (Tmp >= 104)
Tmp = 0;
break;

default:
gEeprom.VfoInfo[VFO].ConfigTX.CodeType = CODE_TYPE_OFF;
Tmp = 0;
break;
}
gEeprom.VfoInfo[VFO].ConfigTX.Code = Tmp;

Expand Down Expand Up @@ -332,12 +334,9 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
} __attribute__((packed)) Info;

EEPROM_ReadBuffer(Base, &Info, sizeof(Info));

pRadio->ConfigRX.Frequency = Info.Frequency;

if (Info.Offset >= 100000000)
Info.Offset = 1000000;

gEeprom.VfoInfo[VFO].FREQUENCY_OF_DEVIATION = Info.Offset;
}

Expand All @@ -363,7 +362,6 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
RADIO_ApplyOffset(pRadio);

memset(gEeprom.VfoInfo[VFO].Name, 0, sizeof(gEeprom.VfoInfo[VFO].Name));

if (IS_MR_CHANNEL(Channel))
{ // 16 bytes allocated to the channel name but only 12 used
EEPROM_ReadBuffer(0x0F50 + (Channel * 16), gEeprom.VfoInfo[VFO].Name + 0, 8);
Expand All @@ -384,12 +382,12 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
if (!gSetting_350EN)
{
FREQ_Config_t *pConfig = gEeprom.VfoInfo[VFO].pRX;
if (pConfig->Frequency < (35000000 + 4999991))
pConfig->Frequency = 41001250;
if (pConfig->Frequency >= 35000000 && pConfig->Frequency < 40000000)
pConfig->Frequency = 43300000;
}

// if (gEeprom.VfoInfo[VFO].Band == BAND2_108MHz && gEeprom.VfoInfo[VFO].AM_CHANNEL_MODE)
if (gEeprom.VfoInfo[VFO].AM_CHANNEL_MODE) // allow AM on any frequency/band
if (gEeprom.VfoInfo[VFO].AM_CHANNEL_MODE) // allow AM on any frequency
{
gEeprom.VfoInfo[VFO].IsAM = true;
gEeprom.VfoInfo[VFO].SCRAMBLING_TYPE = 0;
Expand Down Expand Up @@ -428,11 +426,11 @@ void RADIO_ConfigureSquelchAndOutputPower(VFO_Info_t *pInfo)
EEPROM_ReadBuffer(Base + 0x40, &pInfo->SquelchCloseGlitchThresh, 1);
EEPROM_ReadBuffer(Base + 0x50, &pInfo->SquelchOpenGlitchThresh, 1);

if (pInfo->SquelchOpenNoiseThresh >= 0x80)
pInfo->SquelchOpenNoiseThresh = 0x7F;
if (pInfo->SquelchOpenNoiseThresh > 127)
pInfo->SquelchOpenNoiseThresh = 127;

if (pInfo->SquelchCloseNoiseThresh >= 0x80)
pInfo->SquelchCloseNoiseThresh = 0x7F;
if (pInfo->SquelchCloseNoiseThresh > 127)
pInfo->SquelchCloseNoiseThresh = 127;
}

Band = FREQUENCY_GetBand(pInfo->pTX->Frequency);
Expand Down Expand Up @@ -594,7 +592,7 @@ void RADIO_SetupRegisters(bool bSwitchToFunction0)
| BK4819_REG_3F_SQUELCH_FOUND
| BK4819_REG_3F_SQUELCH_LOST;
break;

case CODE_TYPE_DIGITAL:
case CODE_TYPE_REVERSE_DIGITAL:
BK4819_SetCDCSSCodeWord(DCS_GetGolayCodeWord(CodeType, Code));
Expand Down Expand Up @@ -635,7 +633,7 @@ void RADIO_SetupRegisters(bool bSwitchToFunction0)
| BK4819_REG_3F_SQUELCH_LOST;
}
#endif

#ifndef DISABLE_NOAA
if (gEeprom.VOX_SWITCH && !gFmRadioMode && IS_NOT_NOAA_CHANNEL(gCurrentVfo->CHANNEL_SAVE) && !gCurrentVfo->IsAM)
#else
Expand Down Expand Up @@ -671,9 +669,9 @@ void RADIO_SetupRegisters(bool bSwitchToFunction0)
void RADIO_ConfigureNOAA(void)
{
uint8_t ChanAB;

gUpdateStatus = true;

if (gEeprom.NOAA_AUTO_SCAN)
{
if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF)
Expand All @@ -689,14 +687,14 @@ void RADIO_SetupRegisters(bool bSwitchToFunction0)
}
else
ChanAB = 0;

if (!gIsNoaaMode)
gNoaaChannel = gEeprom.VfoInfo[ChanAB].CHANNEL_SAVE - NOAA_CHANNEL_FIRST;

gIsNoaaMode = true;
return;
}

if (gRxVfo->CHANNEL_SAVE >= NOAA_CHANNEL_FIRST)
{
gIsNoaaMode = true;
Expand Down Expand Up @@ -835,20 +833,20 @@ void RADIO_PrepareTX(void)
}
else
State = VFO_STATE_TX_DISABLE;

RADIO_SetVfoState(State);

#ifndef DISABLE_ALARM
gAlarmState = ALARM_STATE_OFF;
#endif

AUDIO_PlayBeep(BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL);

gDTMF_ReplyState = DTMF_REPLY_NONE;

return;
}

Skip:
if (gDTMF_ReplyState == DTMF_REPLY_ANI)
{
Expand All @@ -872,7 +870,7 @@ void RADIO_PrepareTX(void)
#else
gTxTimerCountdown = gEeprom.TX_TIMEOUT_TIMER * 120;
#endif

gTxTimeoutReached = false;
gFlagEndTransmission = false;
gRTTECountdown = 0;
Expand All @@ -885,12 +883,12 @@ void RADIO_EnableCxCSS(void)
{
case CODE_TYPE_OFF:
break;

case CODE_TYPE_CONTINUOUS_TONE:
BK4819_EnableCTCSS();
SYSTEM_DelayMs(200);
break;

case CODE_TYPE_DIGITAL:
case CODE_TYPE_REVERSE_DIGITAL:
BK4819_EnableCDCSS();
Expand Down
85 changes: 44 additions & 41 deletions ui/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,68 +33,68 @@
static const char MenuList[][7] =
{
"SQL",
"STEP",
"TX-PWR", // was "TXP"
"R-DCS", // was "R_DCS"
"R-CTCS", // was "R_CTCS"
"T-DCS", // was "T_DCS"
"T-CTCS", // was "T_CTCS"
"SFT-D",
"OFFSET",
"Step",
"Tx-Pwr", // was "TXP"
"RxDCS", // was "R_DCS"
"RxCTCS", // was "R_CTCS"
"TxDCS", // was "T_DCS"
"TxCTCS", // was "T_CTCS"
"SFTDir",
"Offset",
"W/N",
"SCRAM", // was "SCR"
"BCL",
"MEM-CH",
"B-SAVE", // was "SAVE"
"Scram", // was "SCR"
"BusyCL", // was "BCL"
"MemSav", // was "MEM-CH"
"BatSav", // was "SAVE"
"VOX",
"BAK-LT", // was "ABR"
"DUAL-W", // was "TDR"
"CROS-B", // was "WX"
"BEEP",
"TOT",
"BackLt", // was "ABR"
"Dual-W", // was "TDR"
"CrossB", // was "WX"
"Beep",
"TxTOut", // was "TOT"
#ifndef DISABLE_VOICE
"VOICE",
"Voice",
#endif
"SC-REV",
"SC-Rev",
"MDF",
"AUTOLK",
"S-ADD1",
"S-ADD2",
"KeyLoc", // was "AUTOLk"
"S-Add1",
"S-Add2",
"STE",
"RP-STE",
"MIC",
"1-CALL",
"S-LIST",
"SLIST1",
"SLIST2",
"Mic",
"1-Call",
"S-List",
"SList1",
"SList2",
#ifndef DISABLE_ALARM
"AL-MOD",
"AL-Mod",
#endif
"ANI-ID",
"UPCODE",
"DWCODE",
"UpCode",
"DwCode",
"D-ST",
"D-RSP",
"D-HOLD",
"D-PRE",
"D-Hold",
"D-Pre",
"PTT-ID",
"D-DCD",
"D-LIST",
"PONMSG",
"ROGER",
"BATVOL", // was "VOL"
"MODE", // was "AM"
"D-List",
"PonMsg",
"Roger",
"BatVol", // was "VOL"
"Mode", // was "AM"
#ifndef DISABLE_NOAA
"NOAA_S",
#endif
"DEL-CH",
"RESET",
"MemDel", // was "Del-CH"
"Reset",

// normally hidden menu items from here on.
// enabled if pressing PTT and side button below PTT at power-on.

"350-TX", // was "350TX"
"F-LOCK",
"F-Lock",
"200-TX", // was "200TX"
"500-TX", // was "500TX"
"350-EN", // was "350EN"
Expand Down Expand Up @@ -405,9 +405,12 @@ void UI_DisplayMenu(void)
strcpy(String, (gSubMenuSelection == 0) ? "FM" : "AM");
break;

case MENU_AUTOLK:
strcpy(String, (gSubMenuSelection == 0) ? "OFF" : "AUTO");
break;

case MENU_BCL:
case MENU_BEEP:
case MENU_AUTOLK:
case MENU_S_ADD1:
case MENU_S_ADD2:
case MENU_STE:
Expand Down

0 comments on commit 21d5d1e

Please sign in to comment.