aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-10-04 08:11:39 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-10-04 08:11:39 +0000
commit7b941c2420b266dab562e010a60674e388d42c5f (patch)
tree6f57ec7fcc9f29df691e04876a842e65c9bcf5a1
parent6d419676cde900b91f8de3cbfd8664ffa81232d7 (diff)
downloadChibiOS-7b941c2420b266dab562e010a60674e388d42c5f.tar.gz
ChibiOS-7b941c2420b266dab562e010a60674e388d42c5f.tar.bz2
ChibiOS-7b941c2420b266dab562e010a60674e388d42c5f.zip
Added new function chEvtGetAndClearEventsI().
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10760 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--os/rt/include/chevents.h1
-rw-r--r--os/rt/src/chevents.c20
-rw-r--r--readme.txt3
3 files changed, 21 insertions, 3 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;
diff --git a/readme.txt b/readme.txt
index 803ebe7f4..422f649d4 100644
--- a/readme.txt
+++ b/readme.txt
@@ -94,7 +94,8 @@
timeout capability, for consistency with the rest of the system.
- NEW: Modified mailboxes to use a size_t as counter instead of a cnt_t,
this is a leftover of semaphores in previous mailboxes implementation.
-- NEW: Added a new function to RT events chEvtAddEventsI().
+- NEW: Added a new functions to RT events chEvtGetAndClearEventsI() and
+ chEvtAddEventsI().
- NEW: Integrated the latest FatFS 0.13 with patches.
- NEW: Improved RT and NIL test suite to report version numbers and
configuration settings.