diff --git a/pkg/u8g2/Kconfig b/pkg/u8g2/Kconfig index 27cfebe8e5..80ab54d0a4 100644 --- a/pkg/u8g2/Kconfig +++ b/pkg/u8g2/Kconfig @@ -10,7 +10,8 @@ config PACKAGE_U8G2 depends on TEST_KCONFIG depends on HAS_PERIPH_GPIO select MODULE_PERIPH_GPIO - select MODULE_XTIMER + select MODULE_ZTIMER + select MODULE_ZTIMER_USEC select MODULE_U8G2_RIOT select MODULE_U8G2_CSRC diff --git a/pkg/u8g2/Makefile.dep b/pkg/u8g2/Makefile.dep index 24df6f6fda..afc477e960 100644 --- a/pkg/u8g2/Makefile.dep +++ b/pkg/u8g2/Makefile.dep @@ -1,4 +1,5 @@ -USEMODULE += xtimer +USEMODULE += ztimer +USEMODULE += ztimer_usec FEATURES_REQUIRED += periph_gpio diff --git a/pkg/u8g2/contrib/u8x8_riotos.c b/pkg/u8g2/contrib/u8x8_riotos.c index a45a479ae3..0730f9da01 100644 --- a/pkg/u8g2/contrib/u8x8_riotos.c +++ b/pkg/u8g2/contrib/u8x8_riotos.c @@ -24,7 +24,7 @@ #include "u8x8_riotos.h" -#include "xtimer.h" +#include "ztimer.h" #ifdef MODULE_PERIPH_SPI #include "periph/spi.h" @@ -97,14 +97,14 @@ uint8_t u8x8_gpio_and_delay_riotos(u8x8_t *u8g2, uint8_t msg, uint8_t arg_int, v _enable_pins(u8x8_riot_ptr); break; case U8X8_MSG_DELAY_MILLI: - xtimer_usleep(arg_int * 1000); + ztimer_sleep(ZTIMER_USEC, arg_int * 1000); break; case U8X8_MSG_DELAY_10MICRO: - xtimer_usleep(arg_int * 10); + ztimer_sleep(ZTIMER_USEC, arg_int * 10); break; case U8X8_MSG_DELAY_100NANO: /* not used in upstream so approximating to 1us should be fine */ - xtimer_usleep(1); + ztimer_sleep(ZTIMER_USEC, 1); break; case U8X8_MSG_GPIO_CS: if (u8x8_riot_ptr != NULL && gpio_is_valid(u8x8_riot_ptr->pin_cs)) { diff --git a/tests/pkg_u8g2/Makefile b/tests/pkg_u8g2/Makefile index baa1cfca57..c7148c9e64 100644 --- a/tests/pkg_u8g2/Makefile +++ b/tests/pkg_u8g2/Makefile @@ -1,6 +1,7 @@ include ../Makefile.tests_common -USEMODULE += xtimer +USEMODULE += ztimer +USEMODULE += ztimer_usec USEPKG += u8g2 diff --git a/tests/pkg_u8g2/main.c b/tests/pkg_u8g2/main.c index 2d797e7ccd..b58565c0e5 100644 --- a/tests/pkg_u8g2/main.c +++ b/tests/pkg_u8g2/main.c @@ -70,7 +70,8 @@ #include "periph/i2c.h" #endif -#include "xtimer.h" +#include "timex.h" +#include "ztimer.h" #include "u8g2.h" #include "u8x8_riotos.h" @@ -200,7 +201,7 @@ int main(void) screen = (screen + 1) % 3; /* sleep a little */ - xtimer_sleep(1); + ztimer_sleep(ZTIMER_USEC, US_PER_SEC); } return 0;