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 --- apps/plugins/battery_bench.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'apps/plugins') diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c index 53931d1930..e918fae39d 100644 --- a/apps/plugins/battery_bench.c +++ b/apps/plugins/battery_bench.c @@ -567,7 +567,12 @@ enum plugin_status plugin_start(const void* parameter) ,MODEL_NAME,rb->rbversion); rb->fdprintf(fd, "# Battery type: %d mAh Buffer Entries: %d\n", - rb->global_settings->battery_capacity, (int)BUF_ELEMENTS); +#if BATTERY_CAPACITY_INC > 0 + rb->global_settings->battery_capacity, +#else + BATTERY_CAPACITY_DEFAULT, +#endif + (int)BUF_ELEMENTS); rb->fdprintf(fd, "# Rockbox has been running for %02d:%02d:%02d\n", HMS((unsigned)start_tick/HZ)); -- cgit v1.2.3