Do some stuff
All checks were successful
Build Firmware / build (push) Successful in 2m19s

This commit is contained in:
2025-03-28 22:07:50 +01:00
parent 4fe99744e1
commit 85fb527020
23 changed files with 258 additions and 658 deletions

136
ui/menu.c
View File

@@ -48,7 +48,7 @@ const t_menu_item MenuList[] =
{"TCTCS", MENU_T_CTCS}, // was "T_CTCS"
{"TxODir", MENU_SFT_D}, // was "SFT_D"
{"TxOffs", MENU_OFFSET}, // was "OFFSET"
{"W/N", MENU_W_N},
{"WID", MENU_W_N},
{"SCR", MENU_SCR}, // was "SCR"
{"BusyL", MENU_BCL}, // was "BCL"
{"COMP", MENU_COMPAND},
@@ -79,7 +79,7 @@ const t_menu_item MenuList[] =
{"ML", MENU_MLONG},
{"KeyLck", MENU_AUTOLK}, // was "AUTOLk"
{"TxTOut", MENU_TOT}, // was "TOT"
{"TXTime", MENU_TOT},
{"BatSav", MENU_SAVE}, // was "SAVE"
{"BatTxt", MENU_BAT_TXT},
{"Mic", MENU_MIC},
@@ -131,22 +131,14 @@ const t_menu_item MenuList[] =
{"Sql", MENU_SQL},
#ifdef ENABLE_FEAT_F4HWN
{"SPTT", MENU_SET_PTT},
{"STOT", MENU_SET_TOT},
{"SEOT", MENU_SET_EOT},
{"SInv", MENU_SET_INV},
{"STmr", MENU_SET_TMR},
#ifdef ENABLE_FEAT_F4HWN_SLEEP
{"SOff", MENU_SET_OFF},
#endif
#ifdef ENABLE_FEAT_F4HWN_NARROWER
{"SNFM", MENU_SET_NFM},
#endif
#ifdef ENABLE_FEAT_F4HWN_VOL
{"SVol", MENU_SET_VOL},
#endif
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
{"SKey", MENU_SET_KEY },
#endif
#ifdef ENABLE_NOAA
{"SNWR", MENU_NOAA_S },
#endif
@@ -182,10 +174,11 @@ const char gSubMenu_SFT_D[][4] =
"-"
};
const char gSubMenu_W_N[][7] =
const char gSubMenu_W_N[][5] =
{
"WIDE",
"NARR"
"NARR",
"NAR+"
};
const char gSubMenu_OFF_ON[][4] =
@@ -203,8 +196,8 @@ const char *const gSubMenu_RXMode[] =
{
"MAIN", // TX and RX on main only
"RESP", // Watch both and respond
"XBAND ONLY", // TX on main, RX on secondary
"DUALMON" // always TX on main, but RX on both
"XBAND", // TX on main, RX on secondary
"DMON" // always TX on main, but RX on both
};
#ifdef ENABLE_VOICE
@@ -219,7 +212,7 @@ const char gSubMenu_VOICE[][4] =
const char *const gSubMenu_MDF[] =
{
"FREQ",
"CHNUMB",
"CHNUM",
"NAME",
"NAME\n+\nFREQ"
};
@@ -303,14 +296,14 @@ const char gSubMenu_RX_TX[][6] =
"TX/RX"
};
const char gSubMenu_BAT_TXT[][8] =
const char gSubMenu_BAT_TXT[][5] =
{
"NONE",
"VLT",
"PRC"
};
const char gSubMenu_BATTYP[][9] =
const char gSubMenu_BATTYP[][3] =
{
"16",
"22",
@@ -319,38 +312,11 @@ const char gSubMenu_BATTYP[][9] =
#ifdef ENABLE_FEAT_F4HWN
const char gSubMenu_SET_PTT[][8] =
const char gSubMenu_SET_PTT[][4] =
{
"HOLD",
"TAP"
"HOL",
"TOG",
};
const char gSubMenu_SET_TOT[][7] = // Use by SET_EOT too
{
"OFF",
"SND",
"VIS",
"ALL"
};
#ifdef ENABLE_FEAT_F4HWN_NARROWER
const char gSubMenu_SET_NFM[][9] =
{
"NRW",
"NRWER"
};
#endif
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
const char gSubMenu_SET_KEY[][9] =
{
"KEY_MENU",
"KEY_UP",
"KEY_DOWN",
"KEY_EXIT",
"KEY_STAR"
};
#endif
#endif
const t_sidefunction gSubMenu_SIDEFUNCTIONS[] =
@@ -393,10 +359,8 @@ const t_sidefunction gSubMenu_SIDEFUNCTIONS[] =
#if !defined(ENABLE_SPECTRUM) || !defined(ENABLE_FMRADIO)
{"MUTE", ACTION_OPT_MUTE},
#endif
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
{"POWER\nHIGH", ACTION_OPT_POWER_HIGH},
{"REMOVE\nOFFSET", ACTION_OPT_REMOVE_OFFSET},
#endif
#endif
{"SSTV", ACTION_REQ_SSTV},
};
@@ -543,12 +507,6 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
BACKLIGHT_TurnOn();
#if !defined(ENABLE_SPECTRUM) || !defined(ENABLE_FMRADIO)
uint8_t gaugeLine = 0;
uint8_t gaugeMin = 0;
uint8_t gaugeMax = 0;
#endif
switch (UI_MENU_GetCurrentMenuId()) {
case MENU_SQL:
sprintf(String, "%ld", gSubMenuSelection);
@@ -623,12 +581,11 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
case MENU_SCR:
if (gSubMenuSelection > 0) {
sprintf(String, "%ld00", gSubMenuSelection + 25);
BK4819_EnableScramble(gSubMenuSelection - 1);
sprintf(String, "%huHz\n%ld", inverse_scale_freq(gSubMenuSelection), gSubMenuSelection);
} else {
strcpy(String, "OFF");
BK4819_DisableScramble();
}
BK4819_SetScramble(gSubMenuSelection);
break;
case MENU_VOX:
@@ -644,12 +601,6 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
strcpy(String, gSubMenu_OFF_ON[0]);
} else if (gSubMenuSelection < 61) {
sprintf(String, "%02ldm:%02lds", (((gSubMenuSelection) * 5) / 60), (((gSubMenuSelection) * 5) % 60));
#if !defined(ENABLE_SPECTRUM) || !defined(ENABLE_FMRADIO)
//ST7565_Gauge(4, 1, 60, gSubMenuSelection);
gaugeLine = 4;
gaugeMin = 1;
gaugeMax = 60;
#endif
} else {
strcpy(String, "ON");
}
@@ -673,17 +624,19 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
strcpy(String, gModulationStr[gSubMenuSelection]);
break;
case MENU_TOT:
if (gSubMenuSelection == 0) {
strcpy(String, "OFF");
} else {
sprintf(String, "%02ldm:%02lds", (((gSubMenuSelection + 1) * 5) / 60), (((gSubMenuSelection + 1) * 5) % 60));
}
break;
case MENU_AUTOLK:
if (gSubMenuSelection == 0)
strcpy(String, gSubMenu_OFF_ON[0]);
else {
sprintf(String, "%02ldm:%02lds", ((gSubMenuSelection * 15) / 60), ((gSubMenuSelection * 15) % 60));
#if !defined(ENABLE_SPECTRUM) || !defined(ENABLE_FMRADIO)
//ST7565_Gauge(4, 1, 40, gSubMenuSelection);
gaugeLine = 4;
gaugeMin = 1;
gaugeMax = 40;
#endif
}
break;
@@ -783,16 +736,6 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
strcpy(String, gSubMenu_RXMode[gSubMenuSelection]);
break;
case MENU_TOT:
sprintf(String, "%02ldm:%02lds", (((gSubMenuSelection + 1) * 5) / 60), (((gSubMenuSelection + 1) * 5) % 60));
#if !defined(ENABLE_SPECTRUM) || !defined(ENABLE_FMRADIO)
//ST7565_Gauge(4, 5, 179, gSubMenuSelection);
gaugeLine = 4;
gaugeMin = 5;
gaugeMax = 179;
#endif
break;
#ifdef ENABLE_VOICE
case MENU_VOICE:
strcpy(String, gSubMenu_VOICE[gSubMenuSelection]);
@@ -807,18 +750,12 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
((gSubMenuSelection * 250) % 1000));
#if !defined(ENABLE_SPECTRUM) || !defined(ENABLE_FMRADIO)
//ST7565_Gauge(5, 1, 80, gSubMenuSelection);
gaugeLine = 5;
gaugeMin = 1;
gaugeMax = 80;
#endif
} else {
sprintf(String, "TIMEOUT\n%02ldm:%02lds", (((gSubMenuSelection - 80) * 5) / 60),
(((gSubMenuSelection - 80) * 5) % 60));
#if !defined(ENABLE_SPECTRUM) || !defined(ENABLE_FMRADIO)
//ST7565_Gauge(5, 80, 104, gSubMenuSelection);
gaugeLine = 5;
gaugeMin = 80;
gaugeMax = 104;
#endif
}
break;
@@ -946,12 +883,6 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
strcpy(String, gSubMenu_OFF_ON[0]);
} else if (gSubMenuSelection < 121) {
sprintf(String, "%ldh:%02ldm", (gSubMenuSelection / 60), (gSubMenuSelection % 60));
#if !defined(ENABLE_SPECTRUM) || !defined(ENABLE_FMRADIO)
//ST7565_Gauge(4, 1, 120, gSubMenuSelection);
gaugeLine = 4;
gaugeMin = 1;
gaugeMax = 120;
#endif
}
break;
#endif
@@ -961,11 +892,6 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
strcpy(String, gSubMenu_SET_PTT[gSubMenuSelection]);
break;
case MENU_SET_TOT:
case MENU_SET_EOT:
strcpy(String, gSubMenu_SET_TOT[gSubMenuSelection]); // Same as SET_TOT
break;
case MENU_SET_INV:
#ifdef ENABLE_FEAT_F4HWN_INV
strcpy(String, gSubMenu_OFF_ON[gSubMenuSelection]);
@@ -975,12 +901,6 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
#endif
break;
#ifdef ENABLE_FEAT_F4HWN_NARROWER
case MENU_SET_NFM:
strcpy(String, gSubMenu_SET_NFM[gSubMenuSelection]);
break;
#endif
#ifdef ENABLE_FEAT_F4HWN_VOL
case MENU_SET_VOL:
if (gSubMenuSelection == 0) {
@@ -988,10 +908,6 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
} else if (gSubMenuSelection < 64) {
sprintf(String, "%02lu", gSubMenuSelection);
#if !defined(ENABLE_SPECTRUM) || !defined(ENABLE_FMRADIO)
//ST7565_Gauge(4, 1, 63, gSubMenuSelection);
gaugeLine = 4;
gaugeMin = 1;
gaugeMax = 63;
#endif
}
gEeprom.VOLUME_GAIN = gSubMenuSelection;
@@ -1002,12 +918,6 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
(gEeprom.DAC_GAIN << 0)); // AF DAC Gain (after Gain-1 and Gain-2)
break;
#endif
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
case MENU_SET_KEY:
strcpy(String, gSubMenu_SET_KEY[gSubMenuSelection]);
break;
#endif
#endif
}