diff options
author | Bill Richardson <wfrichar@chromium.org> | 2014-05-14 12:13:08 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-05-15 05:28:08 +0000 |
commit | 65df2fd6e444f6655838d55af63de59e699238a2 (patch) | |
tree | 8049186891b2509a1bced4d30cf4ba15b238d54c /common/battery.c | |
parent | 10aecec841361727e7ed8f16a13e0d7a575e77ff (diff) | |
download | chrome-ec-65df2fd6e444f6655838d55af63de59e699238a2.tar.gz |
Add "debug" option to charge_state_v2.c
This is useful for testing battery charge profiles. When enabled, a dump of
all battery, charger, and charge state information will be printed whenever
the battery charge percentage changes.
BUG=none
BRANCH=ToT
TEST=make buildall -j
On the EC console:
chg debug on
then watch the console while either charging or discharging the battery.
Disable with
chg debug off
Change-Id: I6725c461461f90fcd812873f97490e980ab47bc6
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/199816
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'common/battery.c')
-rw-r--r-- | common/battery.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/common/battery.c b/common/battery.c index 20baa1e431..323f3d2790 100644 --- a/common/battery.c +++ b/common/battery.c @@ -209,6 +209,14 @@ static void print_battery_info(void) } } +void print_battery_debug(void) +{ + print_battery_status(); + print_battery_params(); + print_battery_strings(); + print_battery_info(); +} + static int command_battery(int argc, char **argv) { int repeat = 1; @@ -233,10 +241,7 @@ static int command_battery(int argc, char **argv) } for (loop = 0; loop < repeat; loop++) { - print_battery_status(); - print_battery_params(); - print_battery_strings(); - print_battery_info(); + print_battery_debug(); /* * Running with a high repeat count will take so long the |