mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
drivers/pulse_counter: migrate to ztimer
This commit is contained in:
parent
38c2ea57aa
commit
097b1970d2
@ -12,4 +12,3 @@ config MODULE_PULSE_COUNTER
|
||||
depends on TEST_KCONFIG
|
||||
select MODULE_PERIPH_GPIO
|
||||
select MODULE_PERIPH_GPIO_IRQ
|
||||
select MODULE_XTIMER
|
||||
|
@ -1,2 +1 @@
|
||||
USEMODULE += xtimer
|
||||
FEATURES_REQUIRED += periph_gpio_irq
|
||||
|
@ -4,4 +4,7 @@ BOARD_BLACKLIST := msb-430 msb-430h telosb z1
|
||||
|
||||
USEMODULE += pulse_counter
|
||||
|
||||
USEMODULE += ztimer
|
||||
USEMODULE += ztimer_msec
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
||||
|
@ -1,3 +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_PULSE_COUNTER=y
|
||||
CONFIG_MODULE_ZTIMER=y
|
||||
CONFIG_MODULE_ZTIMER_MSEC=y
|
||||
|
@ -20,10 +20,11 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "xtimer.h"
|
||||
#include "timex.h"
|
||||
#include "ztimer.h"
|
||||
#include "pulse_counter_params.h"
|
||||
|
||||
#define SLEEP_USEC US_PER_SEC
|
||||
#define SLEEP_MS MS_PER_SEC
|
||||
|
||||
int main(void)
|
||||
{
|
||||
@ -45,7 +46,7 @@ int main(void)
|
||||
int16_t count = pulse_counter_read_with_reset(&dev);
|
||||
printf("pulse counter: %d\n", count);
|
||||
|
||||
xtimer_usleep(SLEEP_USEC);
|
||||
ztimer_sleep(ZTIMER_MSEC, SLEEP_MS);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user