mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
examples/nimble_heart_rate_sensor: use event_timeout_ztimer
This commit is contained in:
parent
81c5d5dbcc
commit
39b896e933
@ -8,7 +8,7 @@ BOARD ?= nrf52dk
|
|||||||
RIOTBASE ?= $(CURDIR)/../..
|
RIOTBASE ?= $(CURDIR)/../..
|
||||||
|
|
||||||
# Some RIOT modules needed for this example
|
# Some RIOT modules needed for this example
|
||||||
USEMODULE += event_timeout
|
USEMODULE += event_timeout_ztimer
|
||||||
|
|
||||||
# Include NimBLE
|
# Include NimBLE
|
||||||
USEPKG += nimble
|
USEPKG += nimble
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
#define HRS_FLAGS_DEFAULT (0x01) /* 16-bit BPM value */
|
#define HRS_FLAGS_DEFAULT (0x01) /* 16-bit BPM value */
|
||||||
#define SENSOR_LOCATION (0x02) /* wrist sensor */
|
#define SENSOR_LOCATION (0x02) /* wrist sensor */
|
||||||
#define UPDATE_INTERVAL (250U * US_PER_MS)
|
#define UPDATE_INTERVAL (250U)
|
||||||
#define BPM_MIN (80U)
|
#define BPM_MIN (80U)
|
||||||
#define BPM_MAX (210U)
|
#define BPM_MAX (210U)
|
||||||
#define BPM_STEP (2)
|
#define BPM_STEP (2)
|
||||||
@ -287,7 +287,7 @@ int main(void)
|
|||||||
/* setup local event queue (for handling heart rate updates) */
|
/* setup local event queue (for handling heart rate updates) */
|
||||||
event_queue_init(&_eq);
|
event_queue_init(&_eq);
|
||||||
_update_evt.handler = _hr_update;
|
_update_evt.handler = _hr_update;
|
||||||
event_timeout_init(&_update_timeout_evt, &_eq, &_update_evt);
|
event_timeout_ztimer_init(&_update_timeout_evt, ZTIMER_MSEC, &_eq, &_update_evt);
|
||||||
|
|
||||||
/* verify and add our custom services */
|
/* verify and add our custom services */
|
||||||
res = ble_gatts_count_cfg(gatt_svr_svcs);
|
res = ble_gatts_count_cfg(gatt_svr_svcs);
|
||||||
|
Loading…
Reference in New Issue
Block a user