1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

drivers/stmpe811: migrate to ztimer

This commit is contained in:
Alexandre Abadie 2021-12-01 17:10:43 +01:00
parent 15165bfdf7
commit 0076eb83fc
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
4 changed files with 12 additions and 5 deletions

View File

@ -9,9 +9,12 @@ config MODULE_STMPE811
bool
depends on HAS_PERIPH_GPIO
depends on HAS_PERIPH_GPIO_IRQ
depends on HAS_PERIPH_I2C
depends on TEST_KCONFIG
select MODULE_PERIPH_GPIO
select MODULE_PERIPH_GPIO_IRQ
select MODULE_XTIMER
select MODULE_ZTIMER
select MODULE_ZTIMER_MSEC
depends on TEST_KCONFIG
choice

View File

@ -8,4 +8,5 @@ ifneq (,$(filter stmpe811_i2c,$(USEMODULE)))
FEATURES_REQUIRED += periph_i2c
endif
USEMODULE += xtimer
USEMODULE += ztimer
USEMODULE += ztimer_msec

View File

@ -20,7 +20,7 @@
#include <inttypes.h>
#include "xtimer.h"
#include "ztimer.h"
#if IS_USED(MODULE_STMPE811_SPI)
#include "periph/spi.h"
#else
@ -135,13 +135,13 @@ static int _soft_reset(const stmpe811_t *dev)
DEBUG("[stmpe811] soft reset: cannot write soft reset bit to SYS_CTRL1 register\n");
return -EPROTO;
}
xtimer_msleep(10);
ztimer_sleep(ZTIMER_MSEC, 10);
if (_write_reg(dev, STMPE811_SYS_CTRL1, 0) < 0) {
DEBUG("[stmpe811] soft reset: cannot clear SYS_CTRL1 register\n");
return -EPROTO;
}
xtimer_msleep(2);
ztimer_sleep(ZTIMER_MSEC, 2);
return 0;
}

View File

@ -0,0 +1,3 @@
BOARD_INSUFFICIENT_MEMORY := \
nucleo-l011k4 \
#