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

@ -158,6 +158,7 @@
/* define current usage levels */
#define CURRENT_NORMAL 18 /* playback @48MHz clock, backlight off */
#define CURRENT_BACKLIGHT 23 /* maximum brightness */
#define CURRENT_RECORD 2 /* FIXME: placeholder value */
/* define this if the unit can be powered or charged via USB */
#define HAVE_USB_POWER