2323#include "net/gnrc/mac/timeout.h"
2424#include "thread.h"
2525#include "msg.h"
26- #include "xtimer .h"
26+ #include "ztimer .h"
2727
2828#define TIMEOUT_COUNT 3
2929#define TIMEOUT_1_DURATION 1000
@@ -34,7 +34,7 @@ static gnrc_mac_timeout_event_t test_timeouts[TIMEOUT_COUNT];
3434static gnrc_mac_timeout_type_t timeout_1 ;
3535static gnrc_mac_timeout_type_t timeout_2 ;
3636static gnrc_mac_timeout_type_t timeout_3 ;
37- static uint32_t start_time ;
37+ static ztimer_now_t start_time ;
3838
3939static char worker_stack [THREAD_STACKSIZE_MAIN ];
4040
@@ -47,10 +47,10 @@ void *worker_thread(void *arg)
4747
4848 while (1 ) {
4949 msg_t m ;
50- uint32_t now ;
50+ ztimer_now_t now ;
5151
5252 msg_receive (& m );
53- now = xtimer_now_usec () / US_PER_MS ;
53+ now = ztimer_now ( ZTIMER_MSEC ) ;
5454
5555 if (gnrc_mac_timeout_is_expired (& mac_timeout , timeout_1 )) {
5656 printf ("At %6" PRIu32 " ms received msg %i: timeout_1 (set at %" PRIu32 " ms) expired, "
@@ -102,7 +102,7 @@ int main(void)
102102 timeout_2 = -2 ;
103103 timeout_3 = -3 ;
104104
105- start_time = xtimer_now_usec () / US_PER_MS ;
105+ start_time = ztimer_now ( ZTIMER_MSEC ) ;
106106 gnrc_mac_init_timeouts (& mac_timeout , test_timeouts , TIMEOUT_COUNT );
107107 gnrc_mac_set_timeout (& mac_timeout , timeout_1 , TIMEOUT_1_DURATION , pid );
108108 gnrc_mac_set_timeout (& mac_timeout , timeout_2 , TIMEOUT_2_DURATION , pid );
0 commit comments