fix(battery): harden charge-complete inference

This commit is contained in:
chenjintao
2026-08-25 10:03:36 +08:00
parent f33ad70c16
commit 61f034b288
3 changed files with 34 additions and 6 deletions
+22
View File
@@ -979,6 +979,28 @@ menu "Example Configuration"
range 0 1
depends on TQ_BATTERY_ENABLE
config TQ_BATTERY_FULL_MIN_VOLTAGE_MV
int "Minimum voltage for charge-complete prompt (mV)"
default 4150
range 4000 4200
depends on TQ_BATTERY_ENABLE
help
The TP4057 status pin cannot distinguish charge termination
from charger removal. Require at least this filtered battery
voltage before inferring that charging has completed.
config TQ_BATTERY_FULL_MIN_PERCENT
int "Minimum level for charge-complete prompt (percent)"
default 95
range 90 100
depends on TQ_BATTERY_ENABLE
config TQ_BATTERY_FULL_CONFIRM_SEC
int "Charge-complete stable confirmation time (seconds)"
default 30
range 5 300
depends on TQ_BATTERY_ENABLE
config TQ_BATTERY_DIVIDER_HIGH_OHM
int "Battery divider resistance from VBAT to ADC (ohm)"
default 100000