aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/include/chevents.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/kernel/include/chevents.h')
-rw-r--r--os/kernel/include/chevents.h36
1 files changed, 30 insertions, 6 deletions
diff --git a/os/kernel/include/chevents.h b/os/kernel/include/chevents.h
index 6a1cd6106..d934340ab 100644
--- a/os/kernel/include/chevents.h
+++ b/os/kernel/include/chevents.h
@@ -56,6 +56,11 @@ typedef struct EventSource {
} EventSource;
/**
+ * @brief Event Handler callback function.
+ */
+typedef void (*evhandler_t)(eventid_t);
+
+/**
* @brief Data part of a static event source initializer.
* @details This macro should be used when statically initializing an event
* source that is part of a bigger structure.
@@ -119,9 +124,28 @@ typedef struct EventSource {
((void *)(esp) != (void *)(esp)->es_next)
/**
- * @brief Event Handler callback function.
+ * @brief Signals all the Event Listeners registered on the specified Event
+ * Source.
+ *
+ * @param[in] esp pointer to the @p EventSource structure
+ *
+ * @api
*/
-typedef void (*evhandler_t)(eventid_t);
+#define chEvtBroadcast(esp) chEvtBroadcastFlags(esp, 0)
+
+/**
+ * @brief Signals all the Event Listeners registered on the specified Event
+ * Source.
+ * @post This function does not reschedule so a call to a rescheduling
+ * function must be performed before unlocking the kernel. Note that
+ * interrupt handlers always reschedule on exit so an explicit
+ * reschedule must not be performed in ISRs.
+ *
+ * @param[in] esp pointer to the @p EventSource structure
+ *
+ * @iclass
+ */
+#define chEvtBroadcastI(esp) chEvtBroadcastFlagsI(esp, 0)
#ifdef __cplusplus
extern "C" {
@@ -132,10 +156,10 @@ extern "C" {
void chEvtUnregister(EventSource *esp, EventListener *elp);
eventmask_t chEvtClearFlags(eventmask_t mask);
eventmask_t chEvtAddFlags(eventmask_t mask);
- void chEvtSignal(Thread *tp, eventmask_t mask);
- void chEvtSignalI(Thread *tp, eventmask_t mask);
- void chEvtBroadcast(EventSource *esp);
- void chEvtBroadcastI(EventSource *esp);
+ void chEvtSignalFlags(Thread *tp, eventmask_t mask);
+ void chEvtSignalFlagsI(Thread *tp, eventmask_t mask);
+ void chEvtBroadcastFlags(EventSource *esp, eventmask_t mask);
+ void chEvtBroadcastFlagsI(EventSource *esp, eventmask_t mask);
void chEvtDispatch(const evhandler_t *handlers, eventmask_t mask);
#if CH_OPTIMIZE_SPEED || !CH_USE_EVENTS_TIMEOUT
eventmask_t chEvtWaitOne(eventmask_t mask);