From e3ee1908ddf99711b65b46fdab0c7b4ddca7867d Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Mon, 29 Nov 2021 20:59:05 +0000 Subject: 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 --- firmware/export/powermgmt.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'firmware/export/powermgmt.h') diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h index f45690573a..329e64d653 100644 --- a/firmware/export/powermgmt.h +++ b/firmware/export/powermgmt.h @@ -157,8 +157,10 @@ void battery_read_info(int *voltage, int *level); bool battery_level_safe(void); void set_poweroff_timeout(int timeout); +#if BATTERY_CAPACITY_INC > 0 void set_battery_capacity(int capacity); /* set local battery capacity value */ -int get_battery_capacity(void); /* get local battery capacity value */ +#endif +int get_battery_capacity(void); /* get local battery capacity value */ void set_battery_type(int type); /* set local battery type */ void set_sleeptimer_duration(int minutes); -- cgit v1.2.3