drivers/shtc1: migrate to ztimer

This commit is contained in:
Alexandre Abadie 2021-12-10 14:16:58 +01:00
parent 097b1970d2
commit e71988d22a
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
5 changed files with 8 additions and 5 deletions

View File

@ -11,4 +11,3 @@ config MODULE_SHTC1
depends on TEST_KCONFIG depends on TEST_KCONFIG
select MODULE_PERIPH_I2C select MODULE_PERIPH_I2C
select MODULE_CHECKSUM select MODULE_CHECKSUM
select MODULE_XTIMER

View File

@ -1,3 +1,2 @@
FEATURES_REQUIRED += periph_i2c FEATURES_REQUIRED += periph_i2c
USEMODULE += xtimer
USEMODULE += checksum USEMODULE += checksum

View File

@ -3,6 +3,8 @@ include ../Makefile.tests_common
DRIVER ?= shtc1 DRIVER ?= shtc1
USEMODULE += fmt USEMODULE += fmt
USEMODULE += ztimer
USEMODULE += ztimer_msec
USEMODULE += $(DRIVER) USEMODULE += $(DRIVER)
include $(RIOTBASE)/Makefile.include include $(RIOTBASE)/Makefile.include

View File

@ -2,3 +2,5 @@
# application configuration. This is only needed during migration. # application configuration. This is only needed during migration.
CONFIG_MODULE_FMT=y CONFIG_MODULE_FMT=y
CONFIG_MODULE_SHTC1=y CONFIG_MODULE_SHTC1=y
CONFIG_MODULE_ZTIMER=y
CONFIG_MODULE_ZTIMER_MSEC=y

View File

@ -21,10 +21,11 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "timex.h"
#include "ztimer.h"
#include "fmt.h"
#include "shtc1.h" #include "shtc1.h"
#include "shtc1_params.h" #include "shtc1_params.h"
#include "xtimer.h"
#include "fmt.h"
int main(void) int main(void)
{ {
@ -55,7 +56,7 @@ int main(void)
printf("Temperature [°C]: %s\n", str_temp); printf("Temperature [°C]: %s\n", str_temp);
printf(" Humidity [%%rH]: %s\n", str_hum); printf(" Humidity [%%rH]: %s\n", str_hum);
xtimer_sleep(2); ztimer_sleep(ZTIMER_MSEC, 2 * MS_PER_SEC);
} }
return 0; return 0;
} }