summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2013-09-05 10:55:01 +0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-09-10 18:24:07 +0000
commitc2e8372b418610f2095ea79be214f3352fed2b44 (patch)
tree3e78a7955f9c5d1a276d3900c76f7297254a41ff
parent8d921815bf0d3424fec28dc13be0294fae3978d1 (diff)
downloadchrome-ec-c2e8372b418610f2095ea79be214f3352fed2b44.tar.gz
Show charging allowed info for 'battery' command
This will help us debug battery charging. BUG=chrome-os-partner:22055 TEST=On Kirby, type 'battery' and check the output. BRANCH=None Change-Id: Id510ca7816f359e64072837df6464a412eb7739f Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/168181
-rw-r--r--common/battery.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/battery.c b/common/battery.c
index 0aaeb3ef79..f61c2585ef 100644
--- a/common/battery.c
+++ b/common/battery.c
@@ -91,6 +91,10 @@ static int print_battery_info(void)
battery_is_in_10mw_mode(&value);
unit = value ? "0 mW" : " mAh";
+ print_item_name("Charging:");
+ if (check_print_error(battery_charging_allowed(&value)))
+ ccprintf("%sAllowed\n", value ? "" : "Not ");
+
print_item_name("Charge:");
if (check_print_error(battery_state_of_charge(&value)))
ccprintf("%d %%\n", value);