aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/include/chevents.h
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-02-16 14:32:36 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-02-16 14:32:36 +0000
commit84f7aa84b3a62ecc4ffc940bca7f220f48e99107 (patch)
tree23d932a99558ba62c47323ba5bdf00c366f48f4a /os/rt/include/chevents.h
parent03ad1caa98d996b18e32c308ef7d1d62bb8f1ad4 (diff)
downloadChibiOS-84f7aa84b3a62ecc4ffc940bca7f220f48e99107.tar.gz
ChibiOS-84f7aa84b3a62ecc4ffc940bca7f220f48e99107.tar.bz2
ChibiOS-84f7aa84b3a62ecc4ffc940bca7f220f48e99107.zip
Added terminate event replacing the old terminate API.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8907 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/include/chevents.h')
-rw-r--r--os/rt/include/chevents.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/os/rt/include/chevents.h b/os/rt/include/chevents.h
index 1ff0871c7..fa8e4d7a5 100644
--- a/os/rt/include/chevents.h
+++ b/os/rt/include/chevents.h
@@ -37,6 +37,14 @@
/* Module constants. */
/*===========================================================================*/
+/**
+ * @brief Event bit reserved for thread termination request.
+ * @note The most significant bit of the events mask is conventionally
+ * used for thread termination but it can eventually be used for
+ * other events.
+ */
+#define CH_EVENT_TERMINATE ~(((eventmask_t)-1) >> 1U)
+
/*===========================================================================*/
/* Module pre-compile time settings. */
/*===========================================================================*/
@@ -256,6 +264,19 @@ static inline void chEvtBroadcastI(event_source_t *esp) {
chEvtBroadcastFlagsI(esp, (eventflags_t)0);
}
+/**
+ * @brief Returns the events mask.
+ * @details The pending events mask is returned but not altered in any way.
+ *
+ * @return The pending events mask.
+ *
+ * @api
+ */
+static inline eventmask_t chEvtGetEventsX(void) {
+
+ return currp->epending;
+}
+
#endif /* CH_CFG_USE_EVENTS == TRUE */
#endif /* _CHEVENTS_H_ */