diff options
Diffstat (limited to 'os/rt/src/chevents.c')
-rw-r--r-- | os/rt/src/chevents.c | 20 |
1 files changed, 18 insertions, 2 deletions
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;
|