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:
Aidan MacDonald 2021-11-29 20:59:05 +00:00
parent 204be7f637
commit e3ee1908dd
8 changed files with 26 additions and 14 deletions

View file

@ -1036,13 +1036,7 @@ const struct settings_list settings[] = {
NULL, NULL, NULL),
/* use this setting for user code even if there's no exchangable battery
* support enabled */
#if BATTERY_CAPACITY_DEFAULT > 0
/* define min/max/inc for this file if there's only one battery */
#ifndef BATTERY_CAPACITY_MIN
#define BATTERY_CAPACITY_MIN BATTERY_CAPACITY_DEFAULT
#define BATTERY_CAPACITY_MAX BATTERY_CAPACITY_DEFAULT
#define BATTERY_CAPACITY_INC 0
#endif
#if BATTERY_CAPACITY_INC > 0
#if defined(IPOD_VIDEO) && !defined(SIMULATOR)
/* its easier to leave this one un-macro()ed for the time being */
{ F_T_INT|F_DEF_ISFUNC|F_INT_SETTING, &global_settings.battery_capacity,