Skip to content

Commit

Permalink
Merge pull request #10396 from Josar/pr/xtimer_hang/periodic_wakeup
Browse files Browse the repository at this point in the history
test/xtimer_hang: use xtimer_periodic_wakeup
  • Loading branch information
smlng authored Dec 21, 2018
2 parents 8449324 + 82d1261 commit cf1a5e0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/xtimer_hang/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,16 @@ int main(void)
uint32_t now = 0;
uint32_t start = xtimer_now_usec();
uint32_t until = start + (TEST_TIME_S * US_PER_SEC);
uint32_t interval = TEST_INTERVAL_MS * US_PER_MS;
xtimer_ticks32_t last_wakeup = xtimer_now();

puts("[START]");
while((now = xtimer_now_usec()) < until) {
unsigned percent = (100 * (now - start)) / (until - start);
#if defined(MAIN_THREAD_PIN)
gpio_set(main_pin);
#endif
xtimer_usleep(TEST_INTERVAL_MS * US_PER_MS);
xtimer_periodic_wakeup(&last_wakeup, interval);
#if defined(MAIN_THREAD_PIN)
gpio_clear(main_pin);
#endif
Expand Down

0 comments on commit cf1a5e0

Please sign in to comment.