powermgmt: Refactor battery current estimation

Create a new battery_current() function to report the
the battery's charging/discharging current. Move the
old runcurrent() implementation into it and clean up
some of the related defines.

Change-Id: I7dbe5b6532d291fa72add1cb23b30e3cbac8c3ca
This commit is contained in:
Aidan MacDonald 2021-11-30 01:26:59 +00:00
parent 8a8dfa0e52
commit f02cd18ad0
7 changed files with 45 additions and 55 deletions

View file

@ -198,7 +198,7 @@
/* define current usage levels */
#define CURRENT_NORMAL 85 /* Measured */
#define CURRENT_BACKLIGHT 200 /* Over 200 mA total measured when on */
#define CURRENT_RECORD 0 /* no recording */
#define CURRENT_REMOTE 2 /* FIXME: placeholder value */
/* Hardware controlled charging with monitoring */
#define CONFIG_CHARGING CHARGING_MONITOR