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

33 Commits

Author SHA1 Message Date
Fabian Hüßler
3047bef039 sys/event: add event_is_queued() 2023-10-06 18:21:34 +02:00
9386e08ecf
sys/event: move dependency resolution in its own Makefile.dep 2023-06-15 10:24:55 +02:00
Leandro Lanzieri
b3b76bf6f3
sys/event: ensure that a queue has a waiter before waiting for flags
Document and enforce that a queue has a waiter (i.e. it is claimed)
before waiting for thread flags.
2022-04-14 17:10:24 +02:00
benpicco
21205bd6ce
Merge pull request #17351 from benpicco/ztimer_periodic-return
ztimer_periodic: make callback function return bool
2022-03-03 14:42:33 +01:00
Francisco Molina
dff92b59b5 sys/event/periodic: remove wrong event_timeout_dependency 2022-02-23 12:14:52 +01:00
Francisco Molina
b4a70fc29c sys/event/timeout: remove alternative xtimer implementation
The old event_timeout API is no soley implemented on top of ztimer_usec.
2022-02-23 12:14:30 +01:00
Francisco Molina
797f19d4cd sys/event/callback: in init set list_node.next to NULL
When using static initializers uninitialized fields are set to 0, or
NULL for pointers. But when using event_callback_init() on non
static variables event_callback_t structure may hold non 0 values.
This will lead to the event never being called since if super.list_node.next
is not NULL as it is considered already in the event queue and therefore
not touched.
2022-02-09 13:08:21 +01:00
Francisco Molina
dda5441c6c sys/event/periodic: model in Kconfig 2022-01-19 10:32:33 +01:00
Benjamin Valentin
64bd80d389 ztimer_periodic: make callback function return bool
The callback function of `ztimer_periodic` is only expected to have
two states.
So let it return `true` if the timer should keep repeating, `false`
otherwise.
2021-12-08 00:10:55 +01:00
Francisco Molina
7d084a43ff sys/include/event/periodic: add count 2021-12-07 19:42:32 +01:00
Leandro Lanzieri
004da59672
sys/ztimer/kconfig: enable xtimer compat only with timer backend
This also moves the selection of MODULE_ZTIMER_PERIPH_TIMER from
MODULE_ZTIMER_USEC to the visible symbol ZTIMER_USEC.
2021-12-02 09:38:06 +01:00
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
Francisco Molina
ae5e10bc26 sys/event/thread: add STACKSTEST flag 2021-09-24 16:20:35 +02:00
Martine Lenders
8924077a25
event_timeout: check clock before removing ztimer on clear 2021-07-21 13:30:54 +02:00
Francisco Molina
4ddbac3be3
sys/event: add periodic event 2021-06-03 17:53:44 +02:00
Francisco Molina
4f34e50130
sys/event/timeout: add option to use ztimer as backend 2021-05-27 22:34:01 +02:00
Hauke Petersen
91859fc261 sys/event: add event_wait_timeout_ztimer() 2021-03-31 10:11:29 +02:00
7f5d17da83 sys/event: fix possibly uninitialized return warning 2021-03-03 22:28:31 +01:00
benpicco
1a25df9d34
Merge pull request #15471 from maribu/event-threads-multi
sys/event: Allow single event_thread handling all queues
2020-12-03 21:04:36 +01:00
Marian Buschsieweke
c6211cc6c2
sys/event: Allow shared thread for multiple queues
Allow using `event_loop_multi()` to handle event queues of multiple priorities
in an single thread. In the extreme case, all three event queues are handled
by a single thread (thus saving two stacks). This comes for the price of
increased worst case latency, as already running event handlers will no longer
be preempted by higher priority events.

With this, all three event queue priorities are always provided. Using modules,
the old behavior of one thread per event queue can be restored for better worst
case latency at the expense of additional thread size.
2020-12-03 15:28:35 +01:00
Leandro Lanzieri
a7d1ebc0fd
sys/event: add modules to Kconfig 2020-11-18 18:38:45 +01:00
Marian Buschsieweke
2c03dfca13
sys/event: Made trivial functions static inline
When the expected ROM overhead of a function is bigger than the actual function,
it is better to provide the function as static inline function in the header.
2020-08-05 11:45:53 +02:00
Marian Buschsieweke
649486f5cd
sys/event: Remove incorrect comment
The value of `queue->waiter` at the time the event was queued (with IRQs
disabled) was backed up to the stack-variable `waiter`. Thus, the test later on
for `waiter` checks if the queue was already claimed at the time the event
was queued. Therefore, there is no race.
2020-08-05 11:44:25 +02:00
Marian Buschsieweke
8bda9fac1b
sys/event: Add support for multiple queues
Added `event_wait_multi()` that takes an array of event queues rather than
a single event queues. The queue with the lowest index will have the highest
priority.
2020-08-04 13:30:25 +02:00
Francisco Molina
2331448644
Makefile: remove usage of SUBMODULES_NOFORCE
With #10970 only existing *.c files will be added to SRC when using
the SUBMODULES mechanism, so SUBMODULES_NOFORCE (used to filter out
non existing source files) is now redundant so remove the usage.
2020-04-15 12:11:44 +02:00
Hauke Petersen
e06cbce940 sys/event: add event_wait_timeout64() 2020-02-13 16:18:32 +01:00
e01ad86eb3 sys/event: add shared event threads 2020-02-07 12:17:56 +01:00
Hauke Petersen
63d85ad1b5 sys/event: add event_wait_timeout() 2019-05-16 12:01:36 +02:00
0ec9c57b2b add copyrights from IOTPUSH project 2019-05-02 12:09:37 +02:00
Hauke Petersen
b9aeaa7418 sys/event: decouple event_queue from thread 2018-12-11 13:41:21 +01:00
Hauke Petersen
46888a1eaf sys/event: allow calling event_post multiple times 2018-04-19 16:41:13 +02:00
Hauke Petersen
03dccb568d sys/event/timeout: add timeout_clear() function 2018-01-09 15:21:29 +01:00
0e09213e53 sys/event: initial commit of handler-based event system 2017-11-06 14:19:31 +01:00