diff --git a/drivers/at86rf2xx/Kconfig b/drivers/at86rf2xx/Kconfig index f93c04e1ab7e..a0b3772cf9ae 100644 --- a/drivers/at86rf2xx/Kconfig +++ b/drivers/at86rf2xx/Kconfig @@ -14,7 +14,8 @@ menuconfig MODULE_AT86RF2XX select MODULE_NETDEV select MODULE_NETDEV_IEEE802154 select MODULE_NETDEV_LEGACY_API - select MODULE_XTIMER + select MODULE_ZTIMER + select MODULE_ZTIMER_USEC if MODULE_AT86RF2XX diff --git a/drivers/at86rf2xx/Makefile.dep b/drivers/at86rf2xx/Makefile.dep index 6f377f217ffe..0c81eb5cdbba 100644 --- a/drivers/at86rf2xx/Makefile.dep +++ b/drivers/at86rf2xx/Makefile.dep @@ -1,7 +1,8 @@ DEFAULT_MODULE += auto_init_at86rf2xx DEFAULT_MODULE += netdev_ieee802154_oqpsk -USEMODULE += xtimer +USEMODULE += ztimer +USEMODULE += ztimer_usec USEMODULE += ieee802154 USEMODULE += netdev_ieee802154 USEMODULE += netdev_legacy_api diff --git a/drivers/at86rf2xx/aes_spi.c b/drivers/at86rf2xx/aes_spi.c index d7554120e349..fe34b48ee1ef 100644 --- a/drivers/at86rf2xx/aes_spi.c +++ b/drivers/at86rf2xx/aes_spi.c @@ -18,7 +18,7 @@ #include -#include "xtimer.h" +#include "ztimer.h" #include "periph/spi.h" #include "at86rf2xx_aes.h" @@ -55,7 +55,7 @@ uint8_t _aes_status(at86rf2xx_t *dev) static inline void _aes_wait_for_result(at86rf2xx_t *dev) { - xtimer_usleep(AT86RF2XX_AES_DELAY_US); + ztimer_sleep(ZTIMER_USEC, AT86RF2XX_AES_DELAY_US); uint8_t status = _aes_status(dev); /* If this assert fires, there probably is an implementation error. diff --git a/drivers/at86rf2xx/at86rf2xx_internal.c b/drivers/at86rf2xx/at86rf2xx_internal.c index 22a118e7a2db..dcb33256ab09 100644 --- a/drivers/at86rf2xx/at86rf2xx_internal.c +++ b/drivers/at86rf2xx/at86rf2xx_internal.c @@ -21,7 +21,7 @@ * @} */ -#include "xtimer.h" +#include "ztimer.h" #include "at86rf2xx_internal.h" #include "at86rf2xx_registers.h" @@ -127,9 +127,9 @@ void at86rf2xx_assert_awake(at86rf2xx_t *dev) #else gpio_clear(dev->params.sleep_pin); #endif - xtimer_usleep(AT86RF2XX_WAKEUP_DELAY); + ztimer_sleep(ZTIMER_USEC, AT86RF2XX_WAKEUP_DELAY); - /* update state: on some platforms, the timer behind xtimer + /* update state: on some platforms, the timer behind ztimer * may be inaccurate or the radio itself may take longer * to wake up due to extra capacitance on the oscillator. * Spin until we are actually awake @@ -149,10 +149,10 @@ void at86rf2xx_hardware_reset(at86rf2xx_t *dev) *(AT86RF2XX_REG__TRXPR) |= AT86RF2XX_TRXPR_TRXRST; #else gpio_clear(dev->params.reset_pin); - xtimer_usleep(AT86RF2XX_RESET_PULSE_WIDTH); + ztimer_sleep(ZTIMER_USEC, AT86RF2XX_RESET_PULSE_WIDTH); gpio_set(dev->params.reset_pin); #endif - xtimer_usleep(AT86RF2XX_RESET_DELAY); + ztimer_sleep(ZTIMER_USEC, AT86RF2XX_RESET_DELAY); /* update state: if the radio state was P_ON (initialization phase), * it remains P_ON. Otherwise, it should go to TRX_OFF diff --git a/drivers/at86rf2xx/include/at86rf2xx_internal.h b/drivers/at86rf2xx/include/at86rf2xx_internal.h index 2cad8c34ebbf..44f846a8710a 100644 --- a/drivers/at86rf2xx/include/at86rf2xx_internal.h +++ b/drivers/at86rf2xx/include/at86rf2xx_internal.h @@ -65,7 +65,7 @@ extern "C" { /** * @brief Minimum reset pulse width, refer p.190. We use 62us so - * that it is at least one tick on platforms with coarse xtimers + * that it is at least one tick on platforms with coarse ztimers */ #define AT86RF2XX_RESET_PULSE_WIDTH (62U) diff --git a/sys/net/gnrc/Makefile.dep b/sys/net/gnrc/Makefile.dep index 4426854df4b2..f61bb305cc98 100644 --- a/sys/net/gnrc/Makefile.dep +++ b/sys/net/gnrc/Makefile.dep @@ -493,5 +493,6 @@ ifneq (,$(filter gnrc_lwmac,$(USEMODULE))) USEMODULE += gnrc_netif USEMODULE += gnrc_nettype_lwmac USEMODULE += gnrc_mac + USEMODULE += xtimer FEATURES_REQUIRED += periph_rtt endif diff --git a/tests/driver_at86rf2xx_aes/main.c b/tests/driver_at86rf2xx_aes/main.c index 11924bf513ab..c562d0588837 100644 --- a/tests/driver_at86rf2xx_aes/main.c +++ b/tests/driver_at86rf2xx_aes/main.c @@ -19,7 +19,6 @@ #include #include -#include "xtimer.h" #include "at86rf2xx.h" #include "at86rf2xx_params.h" #include "at86rf2xx_aes.h"