mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 14:21:25 +03:00
On-screen charge level now has compile option
This commit is contained in:
parent
1655bd8e23
commit
0390cf792a
4
Makefile
4
Makefile
@ -19,6 +19,7 @@ ENABLE_MAIN_KEY_HOLD := 1
|
||||
ENABLE_BOOT_BEEPS := 0
|
||||
ENABLE_DTMF_DECODER := 1
|
||||
ENABLE_COMPANDER := 1
|
||||
ENABLE_SHOW_CHARGE_LEVEL := 1
|
||||
#ENABLE_SINGLE_VFO_CHAN := 1
|
||||
#ENABLE_BAND_SCOPE := 1
|
||||
|
||||
@ -189,6 +190,9 @@ endif
|
||||
ifeq ($(ENABLE_COMPANDER),1)
|
||||
CFLAGS += -DENABLE_COMPANDER
|
||||
endif
|
||||
ifeq ($(ENABLE_SHOW_CHARGE_LEVEL),1)
|
||||
CFLAGS += -DENABLE_SHOW_CHARGE_LEVEL
|
||||
endif
|
||||
ifeq ($(ENABLE_DTMF_DECODER),1)
|
||||
CFLAGS += -DENABLE_DTMF_DECODER
|
||||
endif
|
||||
|
@ -30,6 +30,7 @@ ENABLE_MAIN_KEY_HOLD := 1 initial F-key press not needed, instead
|
||||
ENABLE_BOOT_BEEPS := 0 give user audio feedback on volume knob position at boot-up
|
||||
ENABLE_DTMF_DECODER := 1 live on-screen DTMF decoder
|
||||
ENABLE_COMPANDER := 1 compander option - setting not yet saved
|
||||
ENABLE_SHOW_CHARGE_LEVEL := 1 show the charge level when the radio is on charge
|
||||
#ENABLE_SINGLE_VFO_CHAN := 1 not yet implemented - single VFO on display when possible
|
||||
#ENABLE_BAND_SCOPE := 1 not yet implemented - spectrum/pan-adapter
|
||||
```
|
||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
22
ui/main.c
22
ui/main.c
@ -465,16 +465,18 @@ void UI_DisplayMain(void)
|
||||
#endif
|
||||
if (gChargingWithTypeC)
|
||||
{ // charging .. show the battery state
|
||||
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);
|
||||
#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
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user