mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-07 05:35:02 -05:00
hosted: consolidate sysfs-based battery measurement code
Several hosted targets read their battery state from a fixed sysfs path. Get rid of the duplicated code by handling this common case in power-linux.c. Some targets use non-standard units in sysfs instead of the typical microvolts / microamps, so allow the scale factors to be overridden by the target. Change-Id: I31dc4ffc7a2d2c066d00a74070f9f9849c1663d0
This commit is contained in:
parent
7ffdf50ba5
commit
806b71b2ed
20 changed files with 74 additions and 454 deletions
|
|
@ -125,6 +125,14 @@
|
|||
#define BATTERY_CAPACITY_MAX 1100 /* max. capacity selectable */
|
||||
#define BATTERY_CAPACITY_INC 0 /* capacity increment */
|
||||
|
||||
/* Voltage reported in millivolts */
|
||||
#define BATTERY_VOLTAGE_SCALE_MUL 1
|
||||
#define BATTERY_VOLTAGE_SCALE_DIV 1
|
||||
|
||||
/* Capacity reported as a value 0-5, 20% increments */
|
||||
#define BATTERY_LEVEL_SCALE_MUL 20
|
||||
#define BATTERY_LEVEL_SCALE_DIV 1
|
||||
|
||||
/* ROLO */
|
||||
#define BOOTFILE_EXT "m3k"
|
||||
#define BOOTFILE "rockbox." BOOTFILE_EXT
|
||||
|
|
|
|||
|
|
@ -70,6 +70,10 @@
|
|||
#define BATTERY_CAPACITY_MAX 1050 /* max. capacity selectable */
|
||||
#define BATTERY_CAPACITY_INC 0 /* capacity increment */
|
||||
|
||||
/* Voltage reported in millivolts */
|
||||
#define BATTERY_VOLTAGE_SCALE_MUL 1
|
||||
#define BATTERY_VOLTAGE_SCALE_DIV 1
|
||||
|
||||
/* Define this for LCD backlight available */
|
||||
#define BACKLIGHT_RG_NANO
|
||||
#define HAVE_BACKLIGHT
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue