Skip to content

Commit

Permalink
tests: posix: common: move printk() out of k_usleep() tick alignment
Browse files Browse the repository at this point in the history
Move printk() out of k_usleep() tick alignment,
for a better tick synchro.

Fixes #25453

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
  • Loading branch information
ABOSTM committed Sep 18, 2020
1 parent 8e1f40a commit 96e2af7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/posix/common/src/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ void test_posix_realtime(void)
struct timespec rts, mts;
struct timeval tv;

printk("POSIX clock set APIs\n");

/* Minimal sleep to align us to the next tick interval. This
* helps with a case that 2 consecutive calls to clock_gettime()
* below return different values. Note that it's still a workaround,
Expand All @@ -63,7 +65,6 @@ void test_posix_realtime(void)
*/
k_usleep(1);

printk("POSIX clock set APIs\n");
ret = clock_gettime(CLOCK_MONOTONIC, &mts);
zassert_equal(ret, 0, "Fail to get monotonic clock");

Expand Down

0 comments on commit 96e2af7

Please sign in to comment.