From eae327a32e0512f35c15933753f4e65e6b7c4d9f Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Mon, 25 Sep 2017 07:23:34 +0000 Subject: Added chEvtAddEventsI(). git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10710 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/chevents.h | 14 ++++++++++++++ os/rt/src/chevents.c | 6 +++--- readme.txt | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/os/rt/include/chevents.h b/os/rt/include/chevents.h index bb368e96b..a01c6d71e 100644 --- a/os/rt/include/chevents.h +++ b/os/rt/include/chevents.h @@ -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. diff --git a/os/rt/src/chevents.c b/os/rt/src/chevents.c index eedd240ad..4f318960a 100644 --- a/os/rt/src/chevents.c +++ b/os/rt/src/chevents.c @@ -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; } /** diff --git a/readme.txt b/readme.txt index d0aca1ea1..57eb7a473 100644 --- a/readme.txt +++ b/readme.txt @@ -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. -- cgit v1.2.3