diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2021-08-04 09:38:08 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2021-08-04 09:39:37 -0400 |
commit | 37bfcab23f55f81e890c9e6ec7f41ef89d17006f (patch) | |
tree | de61c00382c02517f1b9628ead0c3014713e77de /firmware | |
parent | 0d0640e57a4a1c30eab6f8467e25ae9e7958c49e (diff) |
powermgmt: Clean up some convoluted #ifdefs
Makes it more explicit what code is used under which circumstances.
Change-Id: I0a482dd48e1eb4b119ca6d8dca2b8aa450445fd1
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/powermgmt.c | 7 |
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 */ |