drivers/lis3mdl: fix timer dep + migrate app to ztimer

This commit is contained in:
Alexandre Abadie 2021-12-10 14:37:06 +01:00
parent 3e717480ac
commit c5e28d4ef3
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
5 changed files with 8 additions and 7 deletions

View File

@ -10,7 +10,6 @@ config MODULE_LIS3MDL
depends on HAS_PERIPH_I2C
depends on TEST_KCONFIG
select MODULE_PERIPH_I2C
select MODULE_XTIMER
config HAVE_LIS3MDL
bool

View File

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

View File

@ -2,6 +2,7 @@ BOARD ?= limifrog-v1
include ../Makefile.tests_common
USEMODULE += lis3mdl
USEMODULE += xtimer
USEMODULE += ztimer
USEMODULE += ztimer_msec
include $(RIOTBASE)/Makefile.include

View File

@ -1,4 +1,5 @@
# this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration.
CONFIG_MODULE_LIS3MDL=y
CONFIG_MODULE_XTIMER=y
CONFIG_MODULE_ZTIMER=y
CONFIG_MODULE_ZTIMER_MSEC=y

View File

@ -21,11 +21,12 @@
#include <stdio.h>
#include "xtimer.h"
#include "timex.h"
#include "ztimer.h"
#include "lis3mdl.h"
#include "lis3mdl_params.h"
#define SLEEP_USEC (800 * 800U)
#define SLEEP_MS (640U)
int main(void)
{
@ -54,7 +55,7 @@ int main(void)
lis3mdl_read_temp(&dev, &temp_value);
printf("Temperature:\t\t%i°C\n", temp_value);
xtimer_usleep(SLEEP_USEC);
ztimer_sleep(ZTIMER_MSEC, SLEEP_MS);
}
return 0;