summaryrefslogtreecommitdiff
path: root/test/battery_get_params_smart.c
diff options
context:
space:
mode:
authorTang Qijun <qijun.tang@ecs.corp-partner.google.com>2022-12-27 15:08:43 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-01-10 19:42:58 +0000
commitf0436fe4c66f1a6759c2ae28157ec495b53eab9c (patch)
tree729d4cd2351faef5e171fcb3b04e46c44d1c32fa /test/battery_get_params_smart.c
parentac7ce85654cceb9782eb9aeb7c7904624be6ce73 (diff)
downloadchrome-ec-f0436fe4c66f1a6759c2ae28157ec495b53eab9c.tar.gz
chgstv2: optimization battery protection for low voltage
Deep_charge_battery needs to precharge first, and then enter the idle or charge state. Because before entering deep_charge_battery, the curr.state state may be the idle state, which may cause no precharge process. Therefore, add a flag to curr.batt.flags for record whether the precharge process has been performed. BRANCH=trogdor BUG=b:263921114 TEST=After the battery is discharged below voltage_min, the charging process enters deep_charge_battery and precharges first, and when the battery voltage is greater than voltage_min, it enters the charge state and charges normally. TEST=run-battery_get_params_smart Change-Id: I3a353bbcb4149b873176006bc009fbd3e8824aab Signed-off-by: Tang Qijun <qijun.tang@ecs.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4125706 Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Bob Moragues <moragues@chromium.org>
Diffstat (limited to 'test/battery_get_params_smart.c')
-rw-r--r--test/battery_get_params_smart.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/battery_get_params_smart.c b/test/battery_get_params_smart.c
index 63a0abe64c..f63003d8d9 100644
--- a/test/battery_get_params_smart.c
+++ b/test/battery_get_params_smart.c
@@ -167,9 +167,9 @@ static int test_flags(void)
*/
reset_and_fail_on(0, 0, -1);
batt.flags |= BATT_FLAG_BAD_TEMPERATURE;
- batt.flags |= BIT(31);
+ batt.flags |= BATT_FLAG_DEEP_CHARGE;
battery_get_params(&batt);
- TEST_ASSERT(batt.flags & BIT(31));
+ TEST_ASSERT(batt.flags & BATT_FLAG_DEEP_CHARGE);
TEST_ASSERT(!(batt.flags & BATT_FLAG_BAD_ANY));
/*