diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2015-01-09 17:12:35 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-01-13 18:48:18 +0000 |
commit | ed4d13fde2d19bffa6cb58e199179a6a710b218e (patch) | |
tree | f1bb0892839c4fdad52d50f08ca1257202ab3701 /test | |
parent | 4cbb3941b188beaf04ffaa2473e65e352aee6254 (diff) | |
download | chrome-ec-ed4d13fde2d19bffa6cb58e199179a6a710b218e.tar.gz |
charger v2: Combine prevent_*_discharge functions
prevent_hot_discharge and prevent_deep_discharge are near-identical
copies of one another, and can be combined without the loss of any
useful functionality.
BUG=chrome-os-partner:35188
TEST=Manual on Samus. Charge to 2% and boot system with 5V power supply.
Verify that warnings print to console and AP powers down after 30s. Also
pass unit tests.
BRANCH=Samus
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I0f1da5248825a3884f7910babc742dfa7eadf5a3
Reviewed-on: https://chromium-review.googlesource.com/240033
Diffstat (limited to 'test')
-rw-r--r-- | test/sbs_charging_v2.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/sbs_charging_v2.c b/test/sbs_charging_v2.c index bb5097948c..a42d286378 100644 --- a/test/sbs_charging_v2.c +++ b/test/sbs_charging_v2.c @@ -222,7 +222,7 @@ static int test_charge_state(void) TEST_ASSERT(state == PWR_STATE_DISCHARGE); sb_write(SB_TEMPERATURE, CELSIUS_TO_DECI_KELVIN(90)); state = wait_charging_state(); - sleep(HIGH_TEMP_SHUTDOWN_TIMEOUT); + sleep(CRITICAL_BATTERY_SHUTDOWN_TIMEOUT); TEST_ASSERT(is_shutdown); TEST_ASSERT(state == PWR_STATE_DISCHARGE); sb_write(SB_TEMPERATURE, CELSIUS_TO_DECI_KELVIN(40)); @@ -277,7 +277,7 @@ static int test_low_battery(void) ccprintf("[CHARGING TEST] Low battery with AC and negative current\n"); sb_write(SB_CURRENT, -1000); wait_charging_state(); - sleep(LOW_BATTERY_SHUTDOWN_TIMEOUT); + sleep(CRITICAL_BATTERY_SHUTDOWN_TIMEOUT); TEST_ASSERT(is_hibernated); ccprintf("[CHARGING TEST] Low battery shutdown S0->S5\n"); @@ -293,7 +293,7 @@ static int test_low_battery(void) hook_notify(HOOK_CHIPSET_SHUTDOWN); wait_charging_state(); /* after a while, the EC should hibernate */ - sleep(LOW_BATTERY_SHUTDOWN_TIMEOUT); + sleep(CRITICAL_BATTERY_SHUTDOWN_TIMEOUT); TEST_ASSERT(is_hibernated); ccprintf("[CHARGING TEST] Low battery shutdown S5\n"); @@ -303,7 +303,7 @@ static int test_low_battery(void) sb_write(SB_RELATIVE_STATE_OF_CHARGE, 2); wait_charging_state(); /* after a while, the EC should hibernate */ - sleep(LOW_BATTERY_SHUTDOWN_TIMEOUT); + sleep(CRITICAL_BATTERY_SHUTDOWN_TIMEOUT); TEST_ASSERT(is_hibernated); ccprintf("[CHARGING TEST] Low battery AP shutdown\n"); @@ -334,7 +334,7 @@ static int test_high_temp_battery(void) wait_charging_state(); TEST_ASSERT(ev_is_set(EC_HOST_EVENT_BATTERY_SHUTDOWN)); TEST_ASSERT(!is_shutdown); - sleep(HIGH_TEMP_SHUTDOWN_TIMEOUT); + sleep(CRITICAL_BATTERY_SHUTDOWN_TIMEOUT); TEST_ASSERT(is_shutdown); ccprintf("[CHARGING TEST] High battery temp S0->S5 hibernate\n"); @@ -666,7 +666,7 @@ static int test_low_battery_hostevents(void) TEST_ASSERT(ev_is_set(EC_HOST_EVENT_BATTERY_SHUTDOWN)); TEST_ASSERT(!is_shutdown); /* after a while, the AP should shut down */ - sleep(LOW_BATTERY_SHUTDOWN_TIMEOUT); + sleep(CRITICAL_BATTERY_SHUTDOWN_TIMEOUT); TEST_ASSERT(is_shutdown); return EC_SUCCESS; |