From 37bfcab23f55f81e890c9e6ec7f41ef89d17006f Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Wed, 4 Aug 2021 09:38:08 -0400 Subject: [PATCH] powermgmt: Clean up some convoluted #ifdefs Makes it more explicit what code is used under which circumstances. Change-Id: I0a482dd48e1eb4b119ca6d8dca2b8aa450445fd1 --- firmware/powermgmt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index 7e1523eb57..aaec959f50 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c @@ -197,12 +197,15 @@ int battery_time(void) #ifndef CURRENT_NORMAL /* no estimation without current */ return -1; -#endif +#else if (battery_capacity <= 0) /* nor without capacity */ return -1; - -#endif return _battery_time(); +#endif + +#else + return _battery_time(); +#endif } /* Returns battery level in percent */