0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 06:39:49 +03:00

1 sec status bar update rate is volt/percent is enabled

This commit is contained in:
OneOfEleven
2023-09-19 10:23:50 +01:00
parent aeb22b7028
commit 88a556db81
19 changed files with 134 additions and 126 deletions

View File

@ -447,34 +447,29 @@ void UI_DisplayMain(void)
UI_PrintStringSmall("SCR", LCD_WIDTH + 106, 0, Line + 1);
}
#ifdef ENABLE_DTMF_DECODER
if (center_line_is_free)
{
if (gDTMF_ReceivedSaved[0] >= 32)
{ // show live DTMF decode
UI_PrintStringSmall(gDTMF_ReceivedSaved, 8, 0, 3);
}
else
#else
if (center_line_is_free)
{
#endif
if (gChargingWithTypeC)
{ // charging .. show the battery state
#ifdef ENABLE_SHOW_CHARGE_LEVEL
const uint16_t volts = (gBatteryVoltageAverage < gMin_bat_v) ? gMin_bat_v :
(gBatteryVoltageAverage > gMax_bat_v) ? gMax_bat_v :
gBatteryVoltageAverage;
sprintf(String, "Charge %u.%02uV %u%%",
gBatteryVoltageAverage / 100,
gBatteryVoltageAverage % 100,
(100 * (volts - gMin_bat_v)) / (gMax_bat_v - gMin_bat_v));
UI_PrintStringSmall(String, 2, 0, 3);
#endif
}
if (center_line_is_free)
{
if (gSetting_live_DTMF_decoder && gDTMF_ReceivedSaved[0] >= 32)
{ // show live DTMF decode
UI_PrintStringSmall(gDTMF_ReceivedSaved, 8, 0, 3);
}
else
if (gChargingWithTypeC)
{ // charging .. show the battery state
#ifdef ENABLE_SHOW_CHARGE_LEVEL
const uint16_t volts = (gBatteryVoltageAverage < gMin_bat_v) ? gMin_bat_v :
(gBatteryVoltageAverage > gMax_bat_v) ? gMax_bat_v :
gBatteryVoltageAverage;
sprintf(String, "Charge %u.%02uV %u%%",
gBatteryVoltageAverage / 100,
gBatteryVoltageAverage % 100,
(100 * (volts - gMin_bat_v)) / (gMax_bat_v - gMin_bat_v));
UI_PrintStringSmall(String, 2, 0, 3);
#endif
}
}
ST7565_BlitFullScreen();
}

View File

@ -90,6 +90,7 @@ const char MenuList[][7] =
"PTT-ID",
"D-DCD",
"D-LIST",
"D-LIVE", // live DTMF decoder
"PONMSG",
"ROGER",
"BATVOL", // was "VOL"
@ -427,6 +428,7 @@ void UI_DisplayMenu(void)
case MENU_STE:
case MENU_D_ST:
case MENU_D_DCD:
case MENU_D_LIVE_DEC:
#ifdef ENABLE_NOAA
case MENU_NOAA_S:
#endif

View File

@ -73,6 +73,7 @@ enum
MENU_PTT_ID,
MENU_D_DCD,
MENU_D_LIST,
MENU_D_LIVE_DEC,
MENU_PONMSG,
MENU_ROGER,
MENU_VOL,