summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2021-08-04 09:38:08 -0400
committerSolomon Peachy <pizza@shaftnet.org>2021-08-04 09:39:37 -0400
commit37bfcab23f55f81e890c9e6ec7f41ef89d17006f (patch)
treede61c00382c02517f1b9628ead0c3014713e77de
parent0d0640e57a4a1c30eab6f8467e25ae9e7958c49e (diff)
downloadrockbox-37bfcab23f55f81e890c9e6ec7f41ef89d17006f.tar.gz
rockbox-37bfcab23f55f81e890c9e6ec7f41ef89d17006f.tar.bz2
rockbox-37bfcab23f55f81e890c9e6ec7f41ef89d17006f.zip
powermgmt: Clean up some convoluted #ifdefs
Makes it more explicit what code is used under which circumstances. Change-Id: I0a482dd48e1eb4b119ca6d8dca2b8aa450445fd1
-rw-r--r--firmware/powermgmt.c7
1 files changed, 5 insertions, 2 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;
-
+ return _battery_time();
#endif
+
+#else
return _battery_time();
+#endif
}
/* Returns battery level in percent */