1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

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
select MODULE_PERIPH_I2C
select MODULE_CHECKSUM
select MODULE_XTIMER

View File

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

View File

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

View File

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

View File

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