Skip to content

Commit

Permalink
tests: boards: nrf: qdec: Fix failing drivers.sensor.qdec.pm_runtime
Browse files Browse the repository at this point in the history
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 <krzysztof.chruscinski@nordicsemi.no>
  • Loading branch information
nordic-krch authored and nashif committed Oct 22, 2024
1 parent a441492 commit 6e653a9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/boards/nrf/qdec/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,12 @@ ZTEST(qdec_sensor, test_sensor_channel_get_empty)
pm_device_runtime_get(qdec_dev);
}

rc = sensor_sample_fetch(qdec_dev);
zassert_true(rc == 0, "Failed to fetch sample (%d)", rc);

/* wait for potential new readings */
k_msleep(100);

rc = sensor_sample_fetch(qdec_dev);
zassert_true(rc == 0, "Failed to fetch sample (%d)", rc);

/* get readings but ignore them, as they may include reading from time
* when emulation was still working (i.e. during previous test)
*/
Expand Down

0 comments on commit 6e653a9

Please sign in to comment.