Merge pull request #249 from mrkusypl/feature_update_v5_2

Code refactoring (64 B)
This commit is contained in:
Armel FAUVEAU authored and GitHub committed 2026-03-31 18:13:42 +02:00
commit f8c48ceb8a
6 files changed
+17 -38

No files matched your search

+1 -1
View File
@@ -39,7 +39,7 @@ static const uint16_t Obfuscation[8] = { 0x6C16, 0xE614, 0x912E, 0x400D, 0x3521,
AIRCOPY_State_t gAircopyState;
uint16_t gAirCopyBlockNumber;
uint16_t gErrorsDuringAirCopy;
uint8_t gAirCopyIsSendMode;
bool gAirCopyIsSendMode;
uint16_t g_FSK_Buffer[36];
+1 -1
View File
@@ -92,7 +92,7 @@ typedef enum {
extern AIRCOPY_State_t gAircopyState;
extern uint16_t gAirCopyBlockNumber;
extern uint16_t gErrorsDuringAirCopy;
extern uint8_t gAirCopyIsSendMode;
extern bool gAirCopyIsSendMode;
extern uint16_t g_FSK_Buffer[36];
+9 -8
View File
@@ -36,6 +36,13 @@
BEEP_Type_t gBeepToPlay = BEEP_NONE;
static void AUDIO_PlayBeepPulse(void) {
BK4819_ExitTxMute();
SYSTEM_DelayMs(60);
BK4819_EnterTxMute();
SYSTEM_DelayMs(20);
}
void AUDIO_PlayBeep(BEEP_Type_t Beep)
{
@@ -128,17 +135,11 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep)
switch (Beep)
{
case BEEP_880HZ_60MS_DOUBLE_BEEP:
BK4819_ExitTxMute();
SYSTEM_DelayMs(60);
BK4819_EnterTxMute();
SYSTEM_DelayMs(20);
AUDIO_PlayBeepPulse();
[[fallthrough]];
case BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL:
case BEEP_500HZ_60MS_DOUBLE_BEEP:
BK4819_ExitTxMute();
SYSTEM_DelayMs(60);
BK4819_EnterTxMute();
SYSTEM_DelayMs(20);
AUDIO_PlayBeepPulse();
[[fallthrough]];
case BEEP_1KHZ_60MS_OPTIONAL:
BK4819_ExitTxMute();
+1 -4
View File
@@ -1361,11 +1361,8 @@ void UI_DisplayMain(void)
break;
case 2:
sprintf(String, "%03oN", DCS_Options[pConfig->Code]);
break;
case 3:
sprintf(String, "%03oI", DCS_Options[pConfig->Code]);
sprintf(String, (int)pConfig->CodeType == 2 ? "%03oN" : "%03oI", DCS_Options[pConfig->Code]);
break;
default:
+3 -15
View File
@@ -975,9 +975,10 @@ void UI_DisplayMenu(void)
break;
case MENU_LIST_CH:
case MENU_S_LIST:
if (gSubMenuSelection == MR_CHANNELS_LIST + 1)
strcpy(String, "ALL");
else if (gSubMenuSelection == 0)
else if (gSubMenuSelection == 0 && UI_MENU_GetCurrentMenuId() == MENU_LIST_CH)
strcpy(String, "OFF");
else {
const char *name = gListName[gSubMenuSelection - 1];
@@ -989,20 +990,7 @@ void UI_DisplayMenu(void)
sprintf(String, "%02u (%.3s)", gSubMenuSelection, name);
}
break;
case MENU_S_LIST:
if (gSubMenuSelection == MR_CHANNELS_LIST + 1)
strcpy(String, "ALL");
else {
const char *name = gListName[gSubMenuSelection - 1];
// If first character is empty/invalid, display "N/A"
if (IsEmptyName(name, sizeof(gListName[0])))
sprintf(String, "%02u", gSubMenuSelection);
else
sprintf(String, "%02u (%.3s)", gSubMenuSelection, name);
}
break;
#ifdef ENABLE_ALARM
case MENU_AL_MOD:
sprintf(String, gSubMenu_AL_MOD[gSubMenuSelection]);
+2 -9
View File
@@ -99,15 +99,8 @@ void UI_DisplayStatus()
if(gEeprom.SCAN_LIST_DEFAULT == MR_CHANNELS_LIST + 1)
{
if(gEeprom.SCAN_LIST_ENABLED==1) {
sprintf(str, "%s+", "ALL");
end = 18;
}
else
{
sprintf(str, "%s", "ALL");
end = 14;
}
sprintf(str, gEeprom.SCAN_LIST_ENABLED ? "%s+" : "%s", "ALL");
end = gEeprom.SCAN_LIST_ENABLED ? 18 : 14;
}
else
{