drivers/lis3mdl: fix timer dep + migrate app to ztimer
This commit is contained in:
parent
3e717480ac
commit
c5e28d4ef3
@ -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
|
||||
|
||||
@ -1,2 +1 @@
|
||||
FEATURES_REQUIRED += periph_i2c
|
||||
USEMODULE += xtimer
|
||||
|
||||
@ -2,6 +2,7 @@ BOARD ?= limifrog-v1
|
||||
include ../Makefile.tests_common
|
||||
|
||||
USEMODULE += lis3mdl
|
||||
USEMODULE += xtimer
|
||||
USEMODULE += ztimer
|
||||
USEMODULE += ztimer_msec
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user