Added chEvtAddEventsI().

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10710 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2017-09-25 07:23:34 +00:00
parent 024ed93d46
commit eae327a32e
3 changed files with 18 additions and 3 deletions

View File

@ -256,6 +256,20 @@ static inline void chEvtBroadcastI(event_source_t *esp) {
chEvtBroadcastFlagsI(esp, (eventflags_t)0);
}
/**
* @brief Adds (OR) a set of events to the current thread, this is
* @b much faster than using @p chEvtBroadcast() or @p chEvtSignal().
*
* @param[in] events the events to be added
* @return The mask of currently pending events.
*
* @iclass
*/
static inline eventmask_t chEvtAddEventsI(eventmask_t events) {
return currp->epending |= events;
}
/**
* @brief Returns the events mask.
* @details The pending events mask is returned but not altered in any way.

View File

@ -180,13 +180,13 @@ eventmask_t chEvtGetAndClearEvents(eventmask_t events) {
* @api
*/
eventmask_t chEvtAddEvents(eventmask_t events) {
eventmask_t newevt;
chSysLock();
currp->epending |= events;
events = currp->epending;
newevt = chEvtAddEventsI(events);
chSysUnlock();
return events;
return newevt;
}
/**

View File

@ -89,6 +89,7 @@
*****************************************************************************
*** Next ***
- NEW: Added a new function to RT events chEvtAddEventsI().
- NEW: Integrated the latest FatFS 0.13 with patches.
- NEW: Improved RT and NIL test suite to report version numbers and
configuration settings.