forked from len0rd/rockbox
powermgmt: Small cleanups to battery capacity code
- Don't include the 'battery capacity' setting unless the target allows changing it. - Clean up the preprocessor conditionals used to check for variable battery capacity support. - Don't use a variable for battery capacity unless it is actually needed. Change-Id: I3d8a338f107014f2c5098bc0a44ef0cfb4df9356
This commit is contained in:
parent
204be7f637
commit
e3ee1908dd
8 changed files with 26 additions and 14 deletions
|
|
@ -114,7 +114,11 @@ int _battery_time(void) { return powermgmt_est_runningtime_min; }
|
|||
#endif
|
||||
|
||||
/* default value, mAh */
|
||||
#if BATTERY_CAPACITY_INC > 0
|
||||
static int battery_capacity = BATTERY_CAPACITY_DEFAULT;
|
||||
#else
|
||||
# define battery_capacity BATTERY_CAPACITY_DEFAULT
|
||||
#endif
|
||||
|
||||
#if BATTERY_TYPES_COUNT > 1
|
||||
static int battery_type = 0;
|
||||
|
|
@ -170,7 +174,7 @@ void set_battery_type(int type)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef BATTERY_CAPACITY_MIN
|
||||
#if BATTERY_CAPACITY_INC > 0
|
||||
void set_battery_capacity(int capacity)
|
||||
{
|
||||
if (capacity > BATTERY_CAPACITY_MAX)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue