Skip to content

Commit

Permalink
Removed unneeded function call param (band)
Browse files Browse the repository at this point in the history
  • Loading branch information
OneOfEleven committed Oct 1, 2023
1 parent c3c344d commit de174d0
Show file tree
Hide file tree
Showing 19 changed files with 104 additions and 106 deletions.
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
# 1 = enable
#
ENABLE_SWD := 0
ENABLE_OVERLAY := 1
ENABLE_OVERLAY := 0
ENABLE_LTO := 0
ENABLE_UART := 1
ENABLE_AIRCOPY := 0
ENABLE_FMRADIO := 1
ENABLE_NOAA := 0
ENABLE_VOICE := 0
ENABLE_ALARM := 0
#ENABLE_1750HZ := 0
ENABLE_BIG_FREQ := 0
ENABLE_SMALL_BOLD := 1
ENABLE_KEEP_MEM_NAME := 1
Expand All @@ -28,10 +29,10 @@ ENABLE_AM_FIX := 1
ENABLE_AM_FIX_SHOW_DATA := 1
ENABLE_SQUELCH_LOWER := 1
ENABLE_RSSI_BAR := 1
ENABLE_AUDIO_BAR := 1
#ENABLE_COPY_CHAN_TO_VFO := 1
#ENABLE_SINGLE_VFO_CHAN := 1
#ENABLE_BAND_SCOPE := 1
ENABLE_AUDIO_BAR := 0
#ENABLE_COPY_CHAN_TO_VFO := 1
#ENABLE_SINGLE_VFO_CHAN := 1
#ENABLE_BAND_SCOPE := 1

#############################################################

Expand Down Expand Up @@ -197,6 +198,9 @@ endif
ifeq ($(ENABLE_ALARM),1)
CFLAGS += -DENABLE_ALARM
endif
ifeq ($(ENABLE_1750HZ),1)
CFLAGS += -DENABLE_1750HZ
endif
ifeq ($(ENABLE_KEEP_MEM_NAME),1)
CFLAGS += -DKEEP_MEM_NAME
endif
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ENABLE_FMRADIO := 1 WBFM VHF band 2 RX
ENABLE_NOAA := 0 everything NOAA
ENABLE_VOICE := 0 want to hear voices ?
ENABLE_ALARM := 0 TX alarms
#ENABLE_1750HZ := 0 not not implemented .. side key 1750Hz TX tone
ENABLE_BIG_FREQ := 0 big font frequencies
ENABLE_SMALL_BOLD := 1 bold channel name/no. (when name + freq channel display mode)
ENABLE_KEEP_MEM_NAME := 1 maintain channel name when (re)saving memory channel
Expand Down
3 changes: 0 additions & 3 deletions app/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -2181,9 +2181,6 @@ static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
gUpdateStatus = true;
}

if (gF_LOCK && (Key == KEY_PTT || Key == KEY_SIDE2 || Key == KEY_SIDE1))
return;

if (!bFlag)
{
if (gCurrentFunction == FUNCTION_TRANSMIT)
Expand Down
4 changes: 2 additions & 2 deletions app/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ static void SCANNER_Key_MENU(bool bKeyPressed, bool bKeyHeld)
case 2:
if (!gScanSingleFrequency)
{
RADIO_InitInfo(gTxVfo, gTxVfo->CHANNEL_SAVE, FREQUENCY_GetBand(gScanFrequency), gScanFrequency);
RADIO_InitInfo(gTxVfo, gTxVfo->CHANNEL_SAVE, gScanFrequency);

if (gScanUseCssResult)
{
Expand Down Expand Up @@ -367,7 +367,7 @@ void SCANNER_Start(void)
BackupStep = gRxVfo->STEP_SETTING;
BackupFrequency = gRxVfo->StepFrequency;

RADIO_InitInfo(gRxVfo, gRxVfo->CHANNEL_SAVE, gRxVfo->Band, gRxVfo->pRX->Frequency);
RADIO_InitInfo(gRxVfo, gRxVfo->CHANNEL_SAVE, gRxVfo->pRX->Frequency);

gRxVfo->STEP_SETTING = BackupStep;
gRxVfo->StepFrequency = BackupFrequency;
Expand Down
2 changes: 1 addition & 1 deletion bitmaps.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ const uint8_t BITMAP_AntennaLevel6[3] =
0b00000000
};

const uint8_t BITMAP_CurrentIndicator[8] =
const uint8_t BITMAP_MARKER[8] =
{
0b11111111,
0b11111111,
Expand Down
2 changes: 1 addition & 1 deletion bitmaps.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ extern const uint8_t BITMAP_AntennaLevel4[3];
extern const uint8_t BITMAP_AntennaLevel5[3];
extern const uint8_t BITMAP_AntennaLevel6[3];

extern const uint8_t BITMAP_CurrentIndicator[8];
extern const uint8_t BITMAP_MARKER[8];

extern const uint8_t BITMAP_VFO_Default[8];
extern const uint8_t BITMAP_VFO_NotDefault[8];
Expand Down
2 changes: 1 addition & 1 deletion board.c
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ void BOARD_FactoryReset(bool bIsAll)

if (bIsAll)
{
RADIO_InitInfo(gRxVfo, FREQ_CHANNEL_FIRST + BAND6_400MHz, BAND6_400MHz, 43350000);
RADIO_InitInfo(gRxVfo, FREQ_CHANNEL_FIRST + BAND6_400MHz, 43350000);

// set the first few memory channels
for (i = 0; i < ARRAY_SIZE(gDefaultFrequencyTable); i++)
Expand Down
26 changes: 8 additions & 18 deletions driver/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ KEY_Code_t KEYBOARD_Poll(void)
{
KEY_Code_t Key = KEY_INVALID;

// if (!GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT))
// return KEY_PTT;

GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_4);
GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_5);
GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_6);
GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_7);

SYSTICK_DelayUs(1);
SYSTICK_DelayUs(2);

// *****************
// Keys connected to gnd
Expand All @@ -51,13 +53,11 @@ KEY_Code_t KEYBOARD_Poll(void)
goto Bye;
}

// Original doesn't do PTT

// *****************
// First row

GPIO_ClearBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_4);
SYSTICK_DelayUs(1);
SYSTICK_DelayUs(2);

if (!GPIO_CheckBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_0))
{
Expand Down Expand Up @@ -87,10 +87,8 @@ KEY_Code_t KEYBOARD_Poll(void)
// Second row

GPIO_ClearBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_5);
SYSTICK_DelayUs(1);

GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_4);
SYSTICK_DelayUs(1);
SYSTICK_DelayUs(2);

if (!GPIO_CheckBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_0))
{
Expand Down Expand Up @@ -120,16 +118,10 @@ KEY_Code_t KEYBOARD_Poll(void)
// Third row

GPIO_ClearBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_4);
SYSTICK_DelayUs(1);

GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_5);
SYSTICK_DelayUs(1);

GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_4);
SYSTICK_DelayUs(1);

GPIO_ClearBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_6);
SYSTICK_DelayUs(1);
SYSTICK_DelayUs(2);

if (!GPIO_CheckBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_0))
{
Expand Down Expand Up @@ -159,10 +151,8 @@ KEY_Code_t KEYBOARD_Poll(void)
// Fourth row

GPIO_ClearBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_7);
SYSTICK_DelayUs(1);

GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_6);
SYSTICK_DelayUs(1);
SYSTICK_DelayUs(2);

if (!GPIO_CheckBit(&GPIOA->DATA, GPIOA_PIN_KEYBOARD_0))
{
Expand Down
Binary file modified firmware.bin
Binary file not shown.
Binary file modified firmware.packed.bin
Binary file not shown.
30 changes: 10 additions & 20 deletions helper/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ BOOT_Mode_t BOOT_GetMode(void)

if (Keys[0] == Keys[1])
{
gKeyReading0 = Keys[0];
gKeyReading1 = Keys[0];
gKeyReading0 = Keys[0];
gKeyReading1 = Keys[0];

gDebounceCounter = 2;

Expand All @@ -69,18 +69,7 @@ void BOOT_ProcessMode(BOOT_Mode_t Mode)
{
if (Mode == BOOT_MODE_F_LOCK)
{
/* // enable all the menu items
gMenuListCount = 0;
// while (MenuList[gMenuListCount].name != NULL)
while (MenuList[gMenuListCount].name[0] != '\0')
gMenuListCount++;
gMenuCursor = MENU_350TX;
gSubMenuSelection = gSetting_350TX;
*/
GUI_SelectNextDisplay(DISPLAY_MENU);

gF_LOCK = true;
}
#ifdef ENABLE_AIRCOPY
else
Expand All @@ -91,15 +80,15 @@ void BOOT_ProcessMode(BOOT_Mode_t Mode)
gEeprom.VOX_SWITCH = false;
gEeprom.CROSS_BAND_RX_TX = CROSS_BAND_OFF;
gEeprom.AUTO_KEYPAD_LOCK = false;
gEeprom.KEY_1_SHORT_PRESS_ACTION = 0;
gEeprom.KEY_1_LONG_PRESS_ACTION = 0;
gEeprom.KEY_2_SHORT_PRESS_ACTION = 0;
gEeprom.KEY_2_LONG_PRESS_ACTION = 0;
gEeprom.KEY_1_SHORT_PRESS_ACTION = ACTION_OPT_NONE;
gEeprom.KEY_1_LONG_PRESS_ACTION = ACTION_OPT_NONE;
gEeprom.KEY_2_SHORT_PRESS_ACTION = ACTION_OPT_NONE;
gEeprom.KEY_2_LONG_PRESS_ACTION = ACTION_OPT_NONE;

RADIO_InitInfo(gRxVfo, FREQ_CHANNEL_LAST - 1, 5, 41002500);
RADIO_InitInfo(gRxVfo, FREQ_CHANNEL_LAST - 1, 41002500);

gRxVfo->CHANNEL_BANDWIDTH = BANDWIDTH_NARROW;
gRxVfo->OUTPUT_POWER = 0;
gRxVfo->CHANNEL_BANDWIDTH = BANDWIDTH_WIDE;
gRxVfo->OUTPUT_POWER = OUTPUT_POWER_LOW;

RADIO_ConfigureSquelchAndOutputPower(gRxVfo);

Expand All @@ -110,6 +99,7 @@ void BOOT_ProcessMode(BOOT_Mode_t Mode)
BK4819_ResetFSK();

gAircopyState = AIRCOPY_READY;

GUI_SelectNextDisplay(DISPLAY_AIRCOPY);
}
#endif
Expand Down
3 changes: 1 addition & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,8 @@ void Main(void)
while (MenuList[gMenuListCount].name[0] != '\0')
gMenuListCount++;

gMenuCursor = MENU_350TX;
gSubMenuSelection = gSetting_350TX;
gF_LOCK = true;
gMenuCursor = MENU_350TX;
}
else
{ // hide the hidden menu items
Expand Down
2 changes: 1 addition & 1 deletion misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ uint8_t gNeverUsed;
#endif

bool gUpdateDisplay;
bool gF_LOCK;

uint8_t gShowChPrefix;

volatile bool gNextTimeslice;
Expand Down
1 change: 0 additions & 1 deletion misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ extern bool gUpdateDisplay;
#ifdef ENABLE_FMRADIO
extern uint8_t gFM_ChannelPosition;
#endif
extern bool gF_LOCK;
extern uint8_t gShowChPrefix;
extern volatile uint8_t gFoundCDCSSCountdown_10ms;
extern volatile uint8_t gFoundCTCSSCountdown_10ms;
Expand Down
33 changes: 16 additions & 17 deletions radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,25 +114,24 @@ uint8_t RADIO_FindNextChannel(uint8_t Channel, int8_t Direction, bool bCheckScan
return 0xFF;
}

void RADIO_InitInfo(VFO_Info_t *pInfo, uint8_t ChannelSave, uint8_t Band, uint32_t Frequency)
void RADIO_InitInfo(VFO_Info_t *pInfo, const uint8_t ChannelSave, const 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;
pInfo->StepFrequency = 2500;
pInfo->CHANNEL_SAVE = ChannelSave;
pInfo->FrequencyReverse = false;
pInfo->OUTPUT_POWER = OUTPUT_POWER_LOW;
pInfo->freq_config_RX.Frequency = Frequency;
pInfo->freq_config_TX.Frequency = Frequency;
pInfo->pRX = &pInfo->freq_config_RX;
pInfo->pTX = &pInfo->freq_config_TX;
pInfo->TX_OFFSET_FREQUENCY = 1000000;
pInfo->Band = FREQUENCY_GetBand(Frequency);
pInfo->SCANLIST1_PARTICIPATION = true;
pInfo->SCANLIST2_PARTICIPATION = true;
pInfo->STEP_SETTING = STEP_12_5kHz;
pInfo->StepFrequency = 2500;
pInfo->CHANNEL_SAVE = ChannelSave;
pInfo->FrequencyReverse = false;
pInfo->OUTPUT_POWER = OUTPUT_POWER_LOW;
pInfo->freq_config_RX.Frequency = Frequency;
pInfo->freq_config_TX.Frequency = Frequency;
pInfo->pRX = &pInfo->freq_config_RX;
pInfo->pTX = &pInfo->freq_config_TX;
#ifdef ENABLE_COMPANDER
pInfo->Compander = 0; // off
pInfo->Compander = 0; // off
#endif

if (ChannelSave == (FREQ_CHANNEL_FIRST + BAND2_108MHz))
Expand Down Expand Up @@ -167,7 +166,7 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure
#ifdef ENABLE_NOAA
if (Channel >= NOAA_CHANNEL_FIRST)
{
RADIO_InitInfo(pRadio, gEeprom.ScreenChannel[VFO], 2, NoaaFrequencyTable[Channel - NOAA_CHANNEL_FIRST]);
RADIO_InitInfo(pRadio, gEeprom.ScreenChannel[VFO], NoaaFrequencyTable[Channel - NOAA_CHANNEL_FIRST]);

if (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF)
return;
Expand Down Expand Up @@ -211,7 +210,7 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure

Index = Channel - FREQ_CHANNEL_FIRST;

RADIO_InitInfo(pRadio, Channel, Index, LowerLimitFrequencyBandTable[Index]);
RADIO_InitInfo(pRadio, Channel, LowerLimitFrequencyBandTable[Index]);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion radio.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ extern VfoState_t VfoState[2];

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);
void RADIO_InitInfo(VFO_Info_t *pInfo, const uint8_t ChannelSave, const uint32_t Frequency);
void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure);
void RADIO_ConfigureSquelchAndOutputPower(VFO_Info_t *pInfo);
void RADIO_ApplyOffset(VFO_Info_t *pInfo);
Expand Down
4 changes: 2 additions & 2 deletions ui/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ void UI_DisplayMain(void)
for (vfo_num = 0; vfo_num < 2; vfo_num++)
{
const unsigned int rx_line = (gEeprom.RX_CHANNEL == 0) ? line0 : line1;
const unsigned int tx_line = (gEeprom.TX_CHANNEL == 0) ? line0 : line1;
// const unsigned int tx_line = (gEeprom.TX_CHANNEL == 0) ? line0 : line1;
const unsigned int line = (vfo_num == 0) ? line0 : line1;
uint8_t channel = gEeprom.TX_CHANNEL;
const bool same_vfo = (channel == vfo_num) ? true : false;
Expand Down Expand Up @@ -483,7 +483,7 @@ void UI_DisplayMain(void)
{
const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALARM", "VOLT HIGH"};
if (state >= 0 && state < ARRAY_SIZE(state_list))
UI_PrintString(state_list[state], 31, 0, tx_line, 8);
UI_PrintString(state_list[state], 31, 0, line, 8);
}
else
if (gInputBoxIndex > 0 && IS_FREQ_CHANNEL(gEeprom.ScreenChannel[vfo_num]) && gEeprom.TX_CHANNEL == vfo_num)
Expand Down
Loading

0 comments on commit de174d0

Please sign in to comment.