summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2017-09-08 12:05:33 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-01-26 13:25:38 -0800
commite5c6f97d1a4a1fa5ad17c2bab4e316a47b8def9a (patch)
tree88986d177cc58fd4c4f039cca41bc532ccb1a418 /util
parentecfa69663813ec41aa79ed01c4af2f36723fe194 (diff)
downloadchrome-ec-e5c6f97d1a4a1fa5ad17c2bab4e316a47b8def9a.tar.gz
charge_state_v2: Basic dual-battery charging algorithm
First version of the algorithm, some TODOs are left in the code but this, generally, works reasonably well. When charging, we allocate input current in this general order: - Base system (fixed, low, number) - Lid system (based on PSYS) - Lid battery (estimating how much current the battery actually requires) - Base battery (similar estimation) - Provide everything else to lid When discharging, we generally: - First discharge the base battery - Then discharge the lid battery BRANCH=none BUG=b:71881017 TEST=Flash lux and wand, EC-EC communication works, adapter power is split in a sensible way, and discharging works fine. Change-Id: I8a4f87963962fc5466b2fedf1347eb4dadd35740 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/659460 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'util')
-rw-r--r--util/ectool.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/util/ectool.c b/util/ectool.c
index c0aa05e06c..155947d4a2 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -6076,6 +6076,11 @@ int get_battery_command(int index)
if (rv < 0)
return -1;
+ if (dynamic_r.flags & EC_BATT_FLAG_INVALID_DATA) {
+ printf(" Invalid data (not present?)\n");
+ return -1;
+ }
+
if (!is_string_printable(static_r.manufacturer))
goto cmd_error;
printf(" OEM name: %s\n", static_r.manufacturer);