Skip to content

Commit 6e653a9

Browse files
nordic-krchnashif
authored andcommitted
tests: boards: nrf: qdec: Fix failing drivers.sensor.qdec.pm_runtime
Test was failing because after re-enabling QDEC there is an interrupt REPORTRDY coming after some time. Test had k_msleep(100) added to accomodate for that but it was added after sensor_sample_fetch and should be added before so that sample with data from REPORTRDY event is fetched so that next read is empty as expected. Signed-off-by: Krzysztof Chruściński <[email protected]>
1 parent a441492 commit 6e653a9

File tree

1 file changed

+3
-3
lines changed
  • tests/boards/nrf/qdec/src

1 file changed

+3
-3
lines changed

tests/boards/nrf/qdec/src/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,12 @@ ZTEST(qdec_sensor, test_sensor_channel_get_empty)
308308
pm_device_runtime_get(qdec_dev);
309309
}
310310

311-
rc = sensor_sample_fetch(qdec_dev);
312-
zassert_true(rc == 0, "Failed to fetch sample (%d)", rc);
313-
314311
/* wait for potential new readings */
315312
k_msleep(100);
316313

314+
rc = sensor_sample_fetch(qdec_dev);
315+
zassert_true(rc == 0, "Failed to fetch sample (%d)", rc);
316+
317317
/* get readings but ignore them, as they may include reading from time
318318
* when emulation was still working (i.e. during previous test)
319319
*/

0 commit comments

Comments
 (0)