1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:12:57 +01:00

drivers/lis2dh12: migrate to ztimer

This commit is contained in:
Alexandre Abadie 2021-12-10 13:57:29 +01:00
parent 9d53ed3ebf
commit d9fe3a74e5
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
4 changed files with 7 additions and 6 deletions

View File

@ -23,7 +23,7 @@
#include "byteorder.h"
#include "mutex.h"
#include "timex.h"
#include "xtimer.h"
#include "ztimer.h"
#include "lis2dh12.h"
#include "lis2dh12_internal.h"
@ -595,8 +595,8 @@ int lis2dh12_read_temperature(const lis2dh12_t *dev, int16_t *temp)
if (!_read(dev, REG_TEMP_CFG_REG)) {
uint8_t odr = _read(dev, REG_CTRL_REG1) >> 4;
_write(dev, REG_TEMP_CFG_REG, LIS2DH12_TEMP_CFG_REG_ENABLE);
if (IS_USED(MODULE_XTIMER)) {
xtimer_msleep(MS_PER_SEC / hz_per_dr[odr]);
if (IS_USED(MODULE_ZTIMER)) {
ztimer_sleep(ZTIMER_MSEC, MS_PER_SEC / hz_per_dr[odr]);
}
}

View File

@ -4,7 +4,8 @@ include ../Makefile.tests_common
DRIVER ?= lis2dh12_spi
USEMODULE += fmt
USEMODULE += xtimer
USEMODULE += ztimer
USEMODULE += ztimer_msec
USEMODULE += shell
USEMODULE += shell_commands
USEMODULE += $(DRIVER)

View File

@ -1,7 +1,8 @@
# this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration.
CONFIG_MODULE_FMT=y
CONFIG_MODULE_XTIMER=y
CONFIG_MODULE_ZTIMER=y
CONFIG_MODULE_ZTIMER_MSEC=y
CONFIG_MODULE_SHELL=y
CONFIG_MODULE_SHELL_COMMANDS=y
CONFIG_MODULE_LIS2DH12=y

View File

@ -23,7 +23,6 @@
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include "xtimer.h"
#include "fmt.h"
#include "thread.h"
#include "shell.h"