diff --git a/drivers/si70xx/Kconfig b/drivers/si70xx/Kconfig index c265b7475e..ccf773efd7 100644 --- a/drivers/si70xx/Kconfig +++ b/drivers/si70xx/Kconfig @@ -10,7 +10,8 @@ config MODULE_SI70XX depends on TEST_KCONFIG depends on HAS_PERIPH_I2C select MODULE_PERIPH_I2C - select MODULE_XTIMER + select MODULE_ZTIMER + select MODULE_ZTIMER_MSEC choice bool "Sensor variant" @@ -56,4 +57,4 @@ config HAVE_SI7021 bool select MODULE_SI70XX if MODULE_SAUL_DEFAULT help - Indicates that a si7021 sensor is present. \ No newline at end of file + Indicates that a si7021 sensor is present. diff --git a/drivers/si70xx/Makefile.dep b/drivers/si70xx/Makefile.dep index 095389d9a5..f053614553 100644 --- a/drivers/si70xx/Makefile.dep +++ b/drivers/si70xx/Makefile.dep @@ -1,2 +1,3 @@ -USEMODULE += xtimer +USEMODULE += ztimer +USEMODULE += ztimer_msec FEATURES_REQUIRED += periph_i2c diff --git a/drivers/si70xx/si70xx.c b/drivers/si70xx/si70xx.c index 0dbd830b15..3ce6924a7d 100644 --- a/drivers/si70xx/si70xx.c +++ b/drivers/si70xx/si70xx.c @@ -19,7 +19,7 @@ */ #include -#include "xtimer.h" +#include "ztimer.h" #include "si70xx_internals.h" #include "si70xx.h" @@ -162,7 +162,7 @@ int si70xx_init(si70xx_t *dev, const si70xx_params_t *params) i2c_release(SI70XX_I2C); /* sensor is ready after at most 25 ms */ - xtimer_msleep(25); + ztimer_sleep(ZTIMER_MSEC, 25); DEBUG("[DEBUG] Device initialized with success.\n"); return SI70XX_OK; diff --git a/tests/driver_si70xx/Makefile b/tests/driver_si70xx/Makefile index e80b4b1bac..2a863a6b02 100644 --- a/tests/driver_si70xx/Makefile +++ b/tests/driver_si70xx/Makefile @@ -5,4 +5,7 @@ SI70XX_VARIANT ?= si7021 USEMODULE += $(SI70XX_VARIANT) +USEMODULE += ztimer +USEMODULE += ztimer_msec + include $(RIOTBASE)/Makefile.include diff --git a/tests/driver_si70xx/app.config.test b/tests/driver_si70xx/app.config.test index cb5672d30e..49a97de4b2 100644 --- a/tests/driver_si70xx/app.config.test +++ b/tests/driver_si70xx/app.config.test @@ -4,3 +4,6 @@ # This test should also work with Si7006, Si7013 and Si7020 variants. CONFIG_MODULE_SI70XX=y CONFIG_MODULE_SI7021=y + +CONFIG_MODULE_ZTIMER=y +CONFIG_MODULE_ZTIMER_MSEC=y diff --git a/tests/driver_si70xx/main.c b/tests/driver_si70xx/main.c index f148401cc1..a823379b76 100644 --- a/tests/driver_si70xx/main.c +++ b/tests/driver_si70xx/main.c @@ -20,7 +20,8 @@ #include -#include "xtimer.h" +#include "timex.h" +#include "ztimer.h" #include "si70xx_params.h" #include "si70xx.h" @@ -74,7 +75,7 @@ int main(void) temperature % 100); /* sleep between measurements */ - xtimer_msleep(1000); + ztimer_sleep(ZTIMER_MSEC, MS_PER_SEC); /* 1s delay */ } return 0;