summaryrefslogtreecommitdiff
path: root/src/print_battery_info.c
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2009-10-16 20:37:41 +0200
committerMichael Stapelberg <michael@stapelberg.de>2009-10-16 20:37:41 +0200
commitda8cb9ebfc69b9f56dbd5764f4da6ba22fd087de (patch)
tree10094d55a36efa5d6cf18ce2ca32fc81e323d1fa /src/print_battery_info.c
parent8a66289702bb17c2874497319ea2a2921e7a3e0d (diff)
Implement option to use the last full capacity instead of the design capacity
Diffstat (limited to 'src/print_battery_info.c')
-rw-r--r--src/print_battery_info.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/print_battery_info.c b/src/print_battery_info.c
index eb1f6bb..4685d52 100644
--- a/src/print_battery_info.c
+++ b/src/print_battery_info.c
@@ -16,7 +16,7 @@
* worn off your battery is.
*
*/
-void print_battery_info(int number, const char *format) {
+void print_battery_info(int number, const char *format, bool last_full_capacity) {
char buf[1024];
char *walk, *last;
int full_design = -1,
@@ -52,17 +52,15 @@ void print_battery_info(int number, const char *format) {
status = CS_FULL;
else {
/* The only thing left is the full capacity */
-#if 0
- if (bat->use_last_full) {
+ if (last_full_capacity) {
if (!BEGINS_WITH(last, "POWER_SUPPLY_ENERGY_FULL") &&
!BEGINS_WITH(last, "POWER_SUPPLY_CHARGE_FULL"))
continue;
} else {
-#endif
if (!BEGINS_WITH(last, "POWER_SUPPLY_CHARGE_FULL_DESIGN") &&
!BEGINS_WITH(last, "POWER_SUPPLY_ENERGY_FULL_DESIGN"))
continue;
- //}
+ }
full_design = atoi(walk+1);
}