diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2018-11-01 13:40:18 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-11-15 13:16:05 -0800 |
commit | 268b07da45535033ae39240e958fc00386e37684 (patch) | |
tree | 5a49240ca8e6d03f99330e583f68ed018e28c653 /common/battery.c | |
parent | 43085b3aafbc7be83707559988c7d2695fa5c34f (diff) | |
download | chrome-ec-268b07da45535033ae39240e958fc00386e37684.tar.gz |
Battery: Make battery command print display percentage
This patch make battery console command print display percentage
and compensated full capacity.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=b:109954565,b:80270446
BRANCH=none
TEST=Verify display percentage and compensated full capacity are
printed on Sona.
Change-Id: Idc8ee063249fd0937209c8cb32aee59ee3598258
Reviewed-on: https://chromium-review.googlesource.com/1313475
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'common/battery.c')
-rw-r--r-- | common/battery.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/common/battery.c b/common/battery.c index 71b05ba40a..c143826802 100644 --- a/common/battery.c +++ b/common/battery.c @@ -203,7 +203,14 @@ static void print_battery_info(void) print_item_name("Cap-full:"); if (check_print_error(battery_full_charge_capacity(&value))) - ccprintf("%d mAh\n", value); + ccprintf("%d mAh (%d mAh with %d %% compensation)\n", + value, value*batt_full_factor/100, batt_full_factor); + +#ifdef CONFIG_CHARGER_V2 + print_item_name("Display:"); + value = charge_get_display_charge(); + ccprintf("%d.%d %%\n", value / 10, value % 10); +#endif print_item_name(" Design:"); if (check_print_error(battery_design_capacity(&value))) |