erosqnative: hw4 units prefer egauge battery percentage

Use AXP2101's egauge battery percent level if available (hw4 units).
If not available (_battery_level() will return -1 on hw1-hw3 units),
fall back to voltage battery level.

Also fix logic in axp2101_battery_status()

Change-Id: Ic300418532dae6f7772fff8bf5e2b32516f3b973
This commit is contained in:
Dana Conrad 2025-01-11 19:43:05 +00:00 committed by Solomon Peachy
parent f566f63b63
commit 96463d855f
6 changed files with 43 additions and 8 deletions

View file

@ -97,7 +97,7 @@
#define STORAGE_NEEDS_BOUNCE_BUFFER
/* Power management */
#define CONFIG_BATTERY_MEASURE (VOLTAGE_MEASURE/*|CURRENT_MEASURE*/)
#define CONFIG_BATTERY_MEASURE (VOLTAGE_MEASURE | PERCENTAGE_MEASURE/*|CURRENT_MEASURE*/)
#define CONFIG_CHARGING CHARGING_MONITOR
#define HAVE_SW_POWEROFF