1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/sys/event/Kconfig
Francisco Molina 81c5d5dbcc sys/event/timeout: split xtimer, ztimer backends, don't force usec
This PR makes `event_timeout` and `event_timeout_ztimer` two distinct
pseudomodules, where the only api difference is in the init function.

If only `event_timeout_ztimer` is selected then no default ZTIMER
backend is selected and the old init function is not implemented.

If only `event_timeout` is selected then `xtimer` is used unless
`ztimer_usec` is included. In which case the `xtimer` wrapper on top
of `ztimer` is used and `xtimer` is not directly selected. This
allows for the legacy api to be supported with `ztimer_usec` as
a drop-in replacement.

If `event_timeout` and `event_timeut_ztimer` are selected then
`event_timeout` SRC file is excluded from compilation.
2021-11-17 10:15:11 +01:00

69 lines
1.8 KiB
Plaintext

# Copyright (c) 2020 HAW Hamburg
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
menuconfig MODULE_EVENT
bool "Event queue"
depends on TEST_KCONFIG
select MODULE_CORE_THREAD_FLAGS
help
This module offers an event queue framework like libevent or libuev.
An event queue is basically a FIFO queue of events, with some functions
to efficiently and safely handle adding and getting events to / from
such a queue.
if MODULE_EVENT
config MODULE_EVENT_CALLBACK
bool "Support for callback-with-argument event type"
menuconfig MODULE_EVENT_THREAD
bool "Support for event handler threads"
help
There are three threads of different priorities that can be enabled.
if MODULE_EVENT_THREAD
config MODULE_EVENT_THREAD_LOWEST
bool "Lowest priority thread"
config MODULE_EVENT_THREAD_MEDIUM
bool "Medium priority thread"
config MODULE_EVENT_THREAD_HIGHEST
bool "Highest priority thread"
endif # MODULE_EVENT_THREAD
config MODULE_EVENT_TIMEOUT_ZTIMER
bool "Support for triggering events after timeout, ztimer backend"
select MODULE_ZTIMER
config MODULE_EVENT_TIMEOUT
bool "Legacy API, support for triggering events after timeout"
if MODULE_EVENT_TIMEOUT
choice EVENT_TIMEOUT_IMPLEMENTATION
bool "Event Timeout Implementation"
default EVENT_TIMEOUT_ON_XTIMER
config EVENT_TIMEOUT_ON_ZTIMER
bool "Use ztimer as backend"
select MODULE_EVENT_TIMEOUT_ZTIMER
select MODULE_ZTIMER_USEC
config EVENT_TIMEOUT_ON_XTIMER
bool "Use xtimer as backend"
select MODULE_XTIMER if !ZTIMER_USEC
endchoice # EVENT_TIMEOUT_IMPLEMENTATION
endif # MODULE_EVENT_TIMEOUT
endif # MODULE_EVENT