diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/events.h | 37 |
1 files changed, 8 insertions, 29 deletions
diff --git a/src/include/events.h b/src/include/events.h index 47d898dad..6474dcf4a 100644 --- a/src/include/events.h +++ b/src/include/events.h @@ -83,6 +83,11 @@ extern "C" { void chEvtUnregister(EventSource *esp, EventListener *elp);
eventmask_t chEvtClear(eventmask_t mask);
eventmask_t chEvtPend(eventmask_t mask);
+#if defined(CH_OPTIMIZE_SPEED) || !defined(CH_USE_EVENT_TIMEOUT)
+ eventmask_t chEvtWaitOne(eventmask_t ewmask);
+ eventmask_t chEvtWaitAny(eventmask_t ewmask);
+ eventmask_t chEvtWaitAll(eventmask_t ewmask);
+#endif
eventmask_t chEvtWaitOneTimeout(eventmask_t ewmask, systime_t time);
eventmask_t chEvtWaitAnyTimeout(eventmask_t ewmask, systime_t time);
eventmask_t chEvtWaitAllTimeout(eventmask_t ewmask, systime_t time);
@@ -97,38 +102,12 @@ extern "C" { }
#endif
-/**
- * A pending event among those specified in \p ewmask is selected, cleared and
- * its mask returned.
- * @param ewmask mask of the events that the function should wait for,
- * \p ALL_EVENTS enables all the events
- * @return The mask of the lowest id served and cleared event.
- * @note Only a single event is served in the function, the one with the
- * lowest event id. The function is meant to be invoked into a loop in
- * order to serve all the pending events.<br>
- * This means that Event Listeners with a lower event identifier have
- * an higher priority.
- */
+#if !defined(CH_OPTIMIZE_SPEED) && defined(CH_USE_EVENT_TIMEOUT)
#define chEvtWaitOne(ewmask) chEvtWaitOneTimeout(ewmask, TIME_INFINITE)
-
-/**
- * Waits for any of the specified events.
- * The function waits for any event among those specified in \p ewmask to
- * become pending then the events are cleared and returned.
- * @param ewmask mask of the events that the function should wait for,
- * \p ALL_EVENTS enables all the events
- * @return The mask of the served and cleared events.
- */
#define chEvtWaitAny(ewmask) chEvtWaitAnyTimeout(ewmask, TIME_INFINITE)
-
-/**
- * Waits for all the specified event flags then clears them.
- * The function waits for all the events specified in \p ewmask to become
- * pending then the events are cleared and returned.
- * @param ewmask mask of the event ids that the function should wait for
- * @return The mask of the served and cleared events.
- */
#define chEvtWaitAll(ewmask) chEvtWaitAllTimeout(ewmask, TIME_INFINITE)
+#define chEvtWait(ewmask, handlers) chEvtWaitTimeout(ewmask, handlers, TIME_INFINITE)
+#endif
/*
* Old function names, deprecated, will be removed in some next release.
|