From da8cb9ebfc69b9f56dbd5764f4da6ba22fd087de Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 16 Oct 2009 20:37:41 +0200 Subject: Implement option to use the last full capacity instead of the design capacity --- src/print_battery_info.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/print_battery_info.c') 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); } -- cgit v1.2.3