Test out some things
All checks were successful
Build Firmware / build (push) Successful in 22s

This commit is contained in:
2025-03-05 22:35:45 +01:00
parent 72558f93f3
commit 8dd68d74a6
18 changed files with 203 additions and 123 deletions

View File

@@ -133,9 +133,7 @@ const t_menu_item MenuList[] =
{"SPTT", MENU_SET_PTT},
{"STOT", MENU_SET_TOT},
{"SEOT", MENU_SET_EOT},
{"SCtr", MENU_SET_CTR},
{"SInv", MENU_SET_INV},
{"SLck", MENU_SET_LCK},
{"STmr", MENU_SET_TMR},
#ifdef ENABLE_FEAT_F4HWN_SLEEP
{"SOff", MENU_SET_OFF},
@@ -552,7 +550,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
switch (UI_MENU_GetCurrentMenuId()) {
case MENU_SQL:
sprintf(String, "%d", gSubMenuSelection);
sprintf(String, "%ld", gSubMenuSelection);
break;
case MENU_MIC: { // display the mic gain in actual dB rather than just an index number
@@ -605,7 +603,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
case MENU_OFFSET:
if (!gIsInSubMenu || gInputBoxIndex == 0) {
sprintf(String, "%3d.%05u", gSubMenuSelection / 100000, abs(gSubMenuSelection) % 100000);
sprintf(String, "%3ld.%05u", gSubMenuSelection / 100000, abs(gSubMenuSelection) % 100000);
UI_PrintString(String, menu_item_x1, menu_item_x2, 1 /*, 8 */);
} else {
const char *ascii = INPUTBOX_GetAscii();
@@ -624,7 +622,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
case MENU_SCR:
if (gSubMenuSelection > 0) {
sprintf(String, "%d00", gSubMenuSelection + 25);
sprintf(String, "%ld00", gSubMenuSelection + 25);
BK4819_EnableScramble(gSubMenuSelection - 1);
} else {
strcpy(String, "OFF");
@@ -634,7 +632,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
case MENU_VOX:
#ifdef ENABLE_VOX
sprintf(String, gSubMenuSelection == 0 ? gSubMenu_OFF_ON[0] : "%u", gSubMenuSelection);
sprintf(String, gSubMenuSelection == 0 ? gSubMenu_OFF_ON[0] : "%lu", gSubMenuSelection);
#else
strcpy(String, gSubMenu_NA);
#endif
@@ -644,7 +642,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
if (gSubMenuSelection == 0) {
strcpy(String, gSubMenu_OFF_ON[0]);
} else if (gSubMenuSelection < 61) {
sprintf(String, "%02dm:%02ds", (((gSubMenuSelection) * 5) / 60), (((gSubMenuSelection) * 5) % 60));
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;
@@ -662,7 +660,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
case MENU_ABR_MIN:
case MENU_ABR_MAX:
sprintf(String, "%d", gSubMenuSelection);
sprintf(String, "%ld", gSubMenuSelection);
if (gIsInSubMenu)
BACKLIGHT_SetBrightness(gSubMenuSelection);
// Obsolete ???
@@ -678,7 +676,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
if (gSubMenuSelection == 0)
strcpy(String, gSubMenu_OFF_ON[0]);
else {
sprintf(String, "%02dm:%02ds", ((gSubMenuSelection * 15) / 60), ((gSubMenuSelection * 15) % 60));
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;
@@ -689,7 +687,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
break;
case MENU_FSKSRC:
sprintf(String, "%d", gSubMenuSelection);
sprintf(String, "%ld", gSubMenuSelection);
break;
case MENU_COMPAND:
@@ -732,7 +730,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
if (valid && !gAskForConfirmation) { // show the frequency so that the user knows the channels frequency
const uint32_t frequency = SETTINGS_FetchChannelFrequency(gSubMenuSelection);
sprintf(String, "%u.%05u", frequency / 100000, frequency % 100000);
sprintf(String, "%lu.%05lu", frequency / 100000, frequency % 100000);
UI_PrintString(String, menu_item_x1, menu_item_x2, 4 /*, 8 */);
}
@@ -767,7 +765,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
}
if (!gAskForConfirmation) { // show the frequency so that the user knows the channels frequency
sprintf(String, "%u.%05u", frequency / 100000, frequency % 100000);
sprintf(String, "%lu.%05lu", frequency / 100000, frequency % 100000);
UI_PrintString(String, menu_item_x1, menu_item_x2, 4 + (gIsInSubMenu && edit_index >= 0) /*, 8 */);
}
}
@@ -777,7 +775,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
}
case MENU_SAVE:
sprintf(String, gSubMenuSelection == 0 ? gSubMenu_OFF_ON[0] : "1:%u", gSubMenuSelection);
sprintf(String, gSubMenuSelection == 0 ? gSubMenu_OFF_ON[0] : "1:%ld", gSubMenuSelection);
break;
case MENU_TDR:
@@ -785,7 +783,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
break;
case MENU_TOT:
sprintf(String, "%02dm:%02ds", (((gSubMenuSelection + 1) * 5) / 60), (((gSubMenuSelection + 1) * 5) % 60));
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;
@@ -804,7 +802,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
if (gSubMenuSelection == 0) {
strcpy(String, "STOP");
} else if (gSubMenuSelection < 81) {
sprintf(String, "CARRIER\n%02ds:%03dms", ((gSubMenuSelection * 250) / 1000),
sprintf(String, "CARRIER\n%02lds:%03ldms", ((gSubMenuSelection * 250) / 1000),
((gSubMenuSelection * 250) % 1000));
#if !defined(ENABLE_SPECTRUM) || !defined(ENABLE_FMRADIO)
//ST7565_Gauge(5, 1, 80, gSubMenuSelection);
@@ -813,7 +811,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
gaugeMax = 80;
#endif
} else {
sprintf(String, "TIMEOUT\n%02dm:%02ds", (((gSubMenuSelection - 80) * 5) / 60),
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);
@@ -829,14 +827,14 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
break;
case MENU_RP_STE:
sprintf(String, gSubMenuSelection == 0 ? gSubMenu_OFF_ON[0] : "%u*100ms", gSubMenuSelection);
sprintf(String, gSubMenuSelection == 0 ? gSubMenu_OFF_ON[0] : "%lu*100ms", gSubMenuSelection);
break;
case MENU_S_LIST:
if (gSubMenuSelection == 0)
strcpy(String, "LIST [0]\nNO LIST");
else if (gSubMenuSelection < 4)
sprintf(String, "LIST [%u]", gSubMenuSelection);
sprintf(String, "LIST [%lu]", gSubMenuSelection);
else if (gSubMenuSelection == 4)
strcpy(String, "LISTS\n[1, 2, 3]");
else if (gSubMenuSelection == 5)
@@ -868,11 +866,11 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
break;
case MENU_D_HOLD:
sprintf(String, "%ds", gSubMenuSelection);
sprintf(String, "%lds", gSubMenuSelection);
break;
#endif
case MENU_D_PRE:
sprintf(String, "%d*10ms", gSubMenuSelection);
sprintf(String, "%ld*10ms", gSubMenuSelection);
break;
case MENU_PTT_ID:
@@ -916,7 +914,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
writeXtalFreqCal(gSubMenuSelection, false);
sprintf(String, "%d\n%u.%06u\nMHz",
sprintf(String, "%ld\n%lu.%06lu\nMHz",
gSubMenuSelection,
xtal_Hz / 1000000, xtal_Hz % 1000000);
}
@@ -925,7 +923,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
case MENU_BATCAL: {
const uint16_t vol = (uint32_t) gBatteryVoltageAverage * gBatteryCalibration[3] / gSubMenuSelection;
sprintf(String, "%u.%02uV\n%u", vol / 100, vol % 100, gSubMenuSelection);
sprintf(String, "%u.%02dV\n%lu", vol / 100, vol % 100, gSubMenuSelection);
break;
}
@@ -946,7 +944,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
if (gSubMenuSelection == 0) {
strcpy(String, gSubMenu_OFF_ON[0]);
} else if (gSubMenuSelection < 121) {
sprintf(String, "%dh:%02dm", (gSubMenuSelection / 60), (gSubMenuSelection % 60));
sprintf(String, "%ldh:%02ldm", (gSubMenuSelection / 60), (gSubMenuSelection % 60));
#if !defined(ENABLE_SPECTRUM) || !defined(ENABLE_FMRADIO)
//ST7565_Gauge(4, 1, 120, gSubMenuSelection);
gaugeLine = 4;
@@ -967,16 +965,6 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
strcpy(String, gSubMenu_SET_TOT[gSubMenuSelection]); // Same as SET_TOT
break;
case MENU_SET_CTR:
#ifdef ENABLE_FEAT_F4HWN_CTR
sprintf(String, "%d", gSubMenuSelection);
gSetting_set_ctr = gSubMenuSelection;
ST7565_ContrastAndInv();
#else
strcpy(String, gSubMenu_NA);
#endif
break;
case MENU_SET_INV:
#ifdef ENABLE_FEAT_F4HWN_INV
strcpy(String, gSubMenu_OFF_ON[gSubMenuSelection]);
@@ -997,7 +985,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
if (gSubMenuSelection == 0) {
strcpy(String, gSubMenu_OFF_ON[0]);
} else if (gSubMenuSelection < 64) {
sprintf(String, "%02u", gSubMenuSelection);
sprintf(String, "%02lu", gSubMenuSelection);
#if !defined(ENABLE_SPECTRUM) || !defined(ENABLE_FMRADIO)
//ST7565_Gauge(4, 1, 63, gSubMenuSelection);
gaugeLine = 4;
@@ -1108,12 +1096,12 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
UI_PrintStringSmallNormal(pPrintStr, menu_item_x1, menu_item_x2, 2);
if (IS_MR_CHANNEL(gEeprom.SCANLIST_PRIORITY_CH1[i])) {
sprintf(String, "PRI%d:%u", 1, gEeprom.SCANLIST_PRIORITY_CH1[i] + 1);
sprintf(String, "PRI%ld:%u", 1, gEeprom.SCANLIST_PRIORITY_CH1[i] + 1);
UI_PrintString(String, menu_item_x1, menu_item_x2, 3 , 8);
}
if (IS_MR_CHANNEL(gEeprom.SCANLIST_PRIORITY_CH2[i])) {
sprintf(String, "PRI%d:%u", 2, gEeprom.SCANLIST_PRIORITY_CH2[i] + 1);
sprintf(String, "PRI%ld:%u", 2, gEeprom.SCANLIST_PRIORITY_CH2[i] + 1);
UI_PrintString(String, menu_item_x1, menu_item_x2, 5, 8);
}
*/
@@ -1152,7 +1140,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|| UI_MENU_GetCurrentMenuId() == MENU_D_LIST
#endif
) {
sprintf(String, "%2d", gSubMenuSelection);
sprintf(String, "%2ld", gSubMenuSelection);
UI_PrintStringSmallNormal(String, 105, 0, 0);
}