Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
egzumer committed Dec 2, 2023
1 parent b505f81 commit cfa745f
Show file tree
Hide file tree
Showing 9 changed files with 422 additions and 424 deletions.
19 changes: 8 additions & 11 deletions app/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,13 +496,10 @@ void MENU_AcceptSetting(void)
return;

case MENU_MEM_NAME:
{ // trailing trim
for (int i = 9; i >= 0; i--)
{
if (edit[i] != ' ' && edit[i] != '_' && edit[i] != 0x00 && edit[i] != 0xff)
break;
edit[i] = ' ';
}
for (int i = 9; i >= 0; i--) {
if (edit[i] != ' ' && edit[i] != '_' && edit[i] != 0x00 && edit[i] != 0xff)
break;
edit[i] = ' ';
}

// save the channel name
Expand All @@ -521,7 +518,7 @@ void MENU_AcceptSetting(void)
gEeprom.VOX_SWITCH = gSubMenuSelection != 0;
if (gEeprom.VOX_SWITCH)
gEeprom.VOX_LEVEL = gSubMenuSelection - 1;
BOARD_EEPROM_LoadCalibration();
SETTINGS_LoadCalibration();
gFlagReconfigureVfos = true;
gUpdateStatus = true;
break;
Expand Down Expand Up @@ -605,7 +602,7 @@ void MENU_AcceptSetting(void)

case MENU_MIC:
gEeprom.MIC_SENSITIVITY = gSubMenuSelection;
BOARD_EEPROM_LoadCalibration();
SETTINGS_LoadCalibration();
gFlagReconfigureVfos = true;
break;

Expand Down Expand Up @@ -729,7 +726,7 @@ void MENU_AcceptSetting(void)
return;

case MENU_RESET:
BOARD_FactoryReset(gSubMenuSelection);
SETTINGS_FactoryReset(gSubMenuSelection);
return;

case MENU_350TX:
Expand Down Expand Up @@ -1434,7 +1431,7 @@ static void MENU_Key_MENU(const bool bKeyPressed, const bool bKeyHeld)
if (!RADIO_CheckValidChannel(gSubMenuSelection, false, 0))
return;

BOARD_fetchChannelName(edit, gSubMenuSelection);
SETTINGS_FetchChannelName(edit, gSubMenuSelection);

// pad the channel name out with '_'
edit_index = strlen(edit);
Expand Down
2 changes: 1 addition & 1 deletion app/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ static void CMD_051D(const uint8_t *pBuffer)
}

if (bReloadEeprom)
BOARD_EEPROM_Init();
SETTINGS_InitEEPROM();
}

SendReply(&Reply, sizeof(Reply));
Expand Down
Loading

0 comments on commit cfa745f

Please sign in to comment.