summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zephyr/test/drivers/src/ppc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/zephyr/test/drivers/src/ppc.c b/zephyr/test/drivers/src/ppc.c
index 82b0aeb6c9..d8d5550f56 100644
--- a/zephyr/test/drivers/src/ppc.c
+++ b/zephyr/test/drivers/src/ppc.c
@@ -48,11 +48,13 @@ static void test_ppc_syv682x_interrupt(void)
/* An OC event less than 100 ms should not cause VBUS to turn off. */
syv682x_emul_set_status(emul, SYV682X_STATUS_OC_5V);
syv682x_interrupt(syv682x_port);
+ /* TODO(b/201420132): Simulate passage of time instead of sleeping. */
msleep(50);
syv682x_interrupt(syv682x_port);
zassert_true(ppc_is_sourcing_vbus(syv682x_port),
"PPC is not sourcing VBUS after 50 ms OC");
/* But one greater than 100 ms should. */
+ /* TODO(b/201420132): Simulate passage of time instead of sleeping. */
msleep(60);
syv682x_interrupt(syv682x_port);
zassert_false(ppc_is_sourcing_vbus(syv682x_port),
@@ -76,6 +78,7 @@ static void test_ppc_syv682x_interrupt(void)
"Source enable failed");
syv682x_emul_set_status(emul, SYV682X_STATUS_TSD);
syv682x_interrupt(syv682x_port);
+ /* TODO(b/201420132): Simulate passage of time instead of sleeping. */
msleep(1);
zassert_false(ppc_is_sourcing_vbus(syv682x_port),
"PPC is sourcing power after TSD");
@@ -86,6 +89,7 @@ static void test_ppc_syv682x_interrupt(void)
"Source enable failed");
syv682x_emul_set_status(emul, SYV682X_STATUS_OVP);
syv682x_interrupt(syv682x_port);
+ /* TODO(b/201420132): Simulate passage of time instead of sleeping. */
msleep(1);
zassert_false(ppc_is_sourcing_vbus(syv682x_port),
"PPC is sourcing power after OVP");
@@ -100,6 +104,7 @@ static void test_ppc_syv682x_interrupt(void)
"Sink enable failed");
syv682x_emul_set_status(emul, SYV682X_STATUS_OC_HV);
syv682x_interrupt(syv682x_port);
+ /* TODO(b/201420132): Simulate passage of time instead of sleeping. */
msleep(1);
zassert_ok(syv682x_emul_get_reg(emul, SYV682X_CONTROL_1_REG, &reg),
"Reading CONTROL_1 failed");
@@ -107,6 +112,7 @@ static void test_ppc_syv682x_interrupt(void)
"Power path disabled after HV_OC handled");
syv682x_emul_set_status(emul, SYV682X_STATUS_OC_HV);
syv682x_interrupt(syv682x_port);
+ /* TODO(b/201420132): Simulate passage of time instead of sleeping. */
msleep(1);
zassert_ok(syv682x_emul_get_reg(emul, SYV682X_CONTROL_1_REG, &reg),
"Reading CONTROL_1 failed");
@@ -114,6 +120,7 @@ static void test_ppc_syv682x_interrupt(void)
"Power path disabled after HV_OC handled");
syv682x_emul_set_status(emul, SYV682X_STATUS_OC_HV);
syv682x_interrupt(syv682x_port);
+ /* TODO(b/201420132): Simulate passage of time instead of sleeping. */
msleep(1);
zassert_ok(syv682x_emul_get_reg(emul, SYV682X_CONTROL_1_REG, &reg),
"Reading CONTROL_1 failed");
@@ -129,14 +136,17 @@ static void test_ppc_syv682x_interrupt(void)
ppc_set_vconn(syv682x_port, true);
syv682x_emul_set_control_4(emul, SYV682X_CONTROL_4_VCONN_OCP);
syv682x_interrupt(syv682x_port);
+ /* TODO(b/201420132): Simulate passage of time instead of sleeping. */
msleep(1);
zassert_ok(syv682x_emul_get_reg(emul, SYV682X_CONTROL_4_REG, &reg),
"Reading CONTROL_4 failed");
zassert_true(reg &
(SYV682X_CONTROL_4_VCONN1 | SYV682X_CONTROL_4_VCONN2),
"VCONN disabled after initial VCONN OC");
+ /* TODO(b/201420132): Simulate passage of time instead of sleeping. */
msleep(50);
syv682x_interrupt(syv682x_port);
+ /* TODO(b/201420132): Simulate passage of time instead of sleeping. */
msleep(1);
zassert_ok(syv682x_emul_get_reg(emul, SYV682X_CONTROL_4_REG, &reg),
"Reading CONTROL_4 failed");
@@ -147,8 +157,10 @@ static void test_ppc_syv682x_interrupt(void)
* But if the event keeps going for over 100 ms continuously, the driver
* should turn VCONN off.
*/
+ /* TODO(b/201420132): Simulate passage of time instead of sleeping. */
msleep(60);
syv682x_interrupt(syv682x_port);
+ /* TODO(b/201420132): Simulate passage of time instead of sleeping. */
msleep(1);
zassert_ok(syv682x_emul_get_reg(emul, SYV682X_CONTROL_4_REG, &reg),
"Reading CONTROL_4 failed");