diff --git a/Makefile b/Makefile index b8f41fc..c222d1d 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ ENABLE_BOOT_BEEPS := 0 ENABLE_COMPANDER := 1 ENABLE_SHOW_CHARGE_LEVEL := 0 ENABLE_REVERSE_BAT_SYMBOL := 1 -ENABLE_STATUSBAR_VOLTAGE := 0 +ENABLE_STATUSBAR_VOLTAGE := 1 ENABLE_STATUSBAR_PERCENTAGE := 1 #ENABLE_SINGLE_VFO_CHAN := 1 #ENABLE_BAND_SCOPE := 1 diff --git a/firmware b/firmware index f9358c3..6914ede 100644 Binary files a/firmware and b/firmware differ diff --git a/firmware.bin b/firmware.bin index 080ccf7..ae5aa5c 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index 41d3ed1..01fce7e 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/ui/status.c b/ui/status.c index 4b4ebb8..0bf66c0 100644 --- a/ui/status.c +++ b/ui/status.c @@ -115,20 +115,23 @@ void UI_DisplayStatus(const bool test_display) else if (!gChargingWithTypeC) { // battery voltage or percentage + char s[8]; #ifdef ENABLE_STATUSBAR_VOLTAGE - char s[6]; - sprintf(s, "%u.%02u", gBatteryVoltageAverage / 100, gBatteryVoltageAverage % 100); - UI_PrintStringSmallBuffer(s, line); - //line += 8 * 4; + + const char *fmt[] = {"%u.%02u", "%2u.%02uV"}; + unsigned int i = gEeprom.VOX_SWITCH ? 0 : 1; // add a 'V' and shift the text left a bit if the VOX is not showing + sprintf(s, fmt[i], gBatteryVoltageAverage / 100, gBatteryVoltageAverage % 100); + UI_PrintStringSmallBuffer(s, line - (i ? 20 : 0)); + #elif defined(ENABLE_STATUSBAR_PERCENTAGE) + const uint16_t volts = (gBatteryVoltageAverage < gMin_bat_v) ? gMin_bat_v : gBatteryVoltageAverage; const uint16_t percent = (100 * (volts - gMin_bat_v)) / (gMax_bat_v - gMin_bat_v); const unsigned int x = (percent >= 100) ? 0 : 4; // move to the right a bit - char s[8]; sprintf(s, "%u%%", percent); UI_PrintStringSmallBuffer(s, line + x); - //line += 8 * 4; + #endif }