aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/include/chevents.h
diff options
context:
space:
mode:
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_ */