1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-27 15:31:17 +01:00

tests/sys_atomic_utils: use ztimer_usec

This commit is contained in:
Francisco Molina 2022-03-22 08:30:30 +01:00
parent feda38ceb5
commit da489697e4
3 changed files with 7 additions and 6 deletions

View File

@ -4,6 +4,6 @@ USEMODULE += atomic_utils
USEMODULE += fmt
USEMODULE += random
USEMODULE += shell
USEMODULE += xtimer
USEMODULE += ztimer_usec
include $(RIOTBASE)/Makefile.include

View File

@ -5,4 +5,4 @@ CONFIG_MODULE_FMT=y
CONFIG_MODULE_SHELL=y
CONFIG_MODULE_RANDOM=y
CONFIG_MODULE_PRNG_MUSL_LCG=y
CONFIG_MODULE_XTIMER=y
CONFIG_ZTIMER_USEC=y

View File

@ -29,7 +29,8 @@
#include "random.h"
#include "shell.h"
#include "thread.h"
#include "xtimer.h"
#include "timex.h"
#include "ztimer.h"
#include "volatile_utils.h"
@ -1093,7 +1094,7 @@ static void *thread_checker_func(void *arg)
break;
}
xtimer_usleep((random_uint32() & 0x3ff) + XTIMER_BACKOFF);
ztimer_sleep(ZTIMER_USEC, (random_uint32() & 0x3ff));
}
return NULL;
@ -1144,8 +1145,8 @@ static int start_test(test_width_t width, size_t fn_index, int timeout)
}
if (timeout) {
static xtimer_t xt = { .callback = test_timeout_callback };
xtimer_set(&xt, US_PER_SEC * timeout);
static ztimer_t xt = { .callback = test_timeout_callback };
ztimer_set(ZTIMER_USEC, &xt, US_PER_SEC * timeout);
}
mutex_unlock(&conf_mutex);
return 0;