diff options
Diffstat (limited to 'os/rt')
-rw-r--r-- | os/rt/include/chevents.h | 1 | ||||
-rw-r--r-- | os/rt/src/chevents.c | 20 |
2 files changed, 19 insertions, 2 deletions
diff --git a/os/rt/include/chevents.h b/os/rt/include/chevents.h index a01c6d71e..8b14ed112 100644 --- a/os/rt/include/chevents.h +++ b/os/rt/include/chevents.h @@ -125,6 +125,7 @@ extern "C" { eventmask_t events,
eventflags_t wflags);
void chEvtUnregister(event_source_t *esp, event_listener_t *elp);
+ eventmask_t chEvtGetAndClearEventsI(eventmask_t events);
eventmask_t chEvtGetAndClearEvents(eventmask_t events);
eventmask_t chEvtAddEvents(eventmask_t events);
eventflags_t chEvtGetAndClearFlags(event_listener_t *elp);
diff --git a/os/rt/src/chevents.c b/os/rt/src/chevents.c index 4f318960a..63740d50b 100644 --- a/os/rt/src/chevents.c +++ b/os/rt/src/chevents.c @@ -157,14 +157,30 @@ void chEvtUnregister(event_source_t *esp, event_listener_t *elp) { * @param[in] events the events to be cleared
* @return The mask of pending events that were cleared.
*
+ * @iclass
+ */
+eventmask_t chEvtGetAndClearEventsI(eventmask_t events) {
+ eventmask_t m;
+
+ m = currp->epending & events;
+ currp->epending &= ~events;
+
+ return m;
+}
+
+/**
+ * @brief Clears the pending events specified in the events mask.
+ *
+ * @param[in] events the events to be cleared
+ * @return The mask of pending events that were cleared.
+ *
* @api
*/
eventmask_t chEvtGetAndClearEvents(eventmask_t events) {
eventmask_t m;
chSysLock();
- m = currp->epending & events;
- currp->epending &= ~events;
+ m = chEvtGetAndClearEventsI(events);
chSysUnlock();
return m;
|