diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-08-07 08:00:46 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-08-07 08:00:46 +0000 |
commit | 07339aeb0e0cb5f6a6f66933df2fd8f21051da92 (patch) | |
tree | 4ad311be231abf3d588394b3bf7981d15e4a106f /os/hal/osal | |
parent | 3ff810e5eea0387733022bf5304d4f94265439b0 (diff) | |
download | ChibiOS-07339aeb0e0cb5f6a6f66933df2fd8f21051da92.tar.gz ChibiOS-07339aeb0e0cb5f6a6f66933df2fd8f21051da92.tar.bz2 ChibiOS-07339aeb0e0cb5f6a6f66933df2fd8f21051da92.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7151 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/osal')
-rw-r--r-- | os/hal/osal/nil/osal.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/os/hal/osal/nil/osal.h b/os/hal/osal/nil/osal.h index 77afc18eb..37838cc88 100644 --- a/os/hal/osal/nil/osal.h +++ b/os/hal/osal/nil/osal.h @@ -731,6 +731,8 @@ static inline msg_t osalThreadEnqueueTimeoutS(threads_queue_t *tqp, */
static inline void osalEventObjectInit(event_source_t *esp) {
+ osalDbgCheck(esp != NULL);
+
esp->flags = 0;
esp->cb = NULL;
esp->param = NULL;
@@ -747,6 +749,8 @@ static inline void osalEventObjectInit(event_source_t *esp) { static inline void osalEventBroadcastFlagsI(event_source_t *esp,
eventflags_t flags) {
+ osalDbgCheck(esp != NULL);
+
esp->flags |= flags;
if (esp->cb != NULL)
esp->cb(esp);
@@ -763,6 +767,8 @@ static inline void osalEventBroadcastFlagsI(event_source_t *esp, static inline void osalEventBroadcastFlags(event_source_t *esp,
eventflags_t flags) {
+ osalDbgCheck(esp != NULL);
+
chSysLock();
osalEventBroadcastFlagsI(esp, flags);
chSchRescheduleS();
@@ -770,6 +776,29 @@ static inline void osalEventBroadcastFlags(event_source_t *esp, }
/**
+ * @brief Event callback setup.
+ * @note The callback is invoked from ISR context and can
+ * only invoke I-Class functions. The callback is meant
+ * to wakeup the task that will handle the event by
+ * calling @p osalEventGetAndClearFlagsI().
+ *
+ * @param[in] esp pointer to the event flags object
+ * @param[in] cb pointer to the callback function
+ * @param[in] param parameter to be passed to the callback function
+ *
+ * @api
+ */
+static inline void osalEventSetCallback(event_source_t *esp,
+ eventcallback_t cb,
+ void *param) {
+
+ osalDbgCheck(esp != NULL);
+
+ esp->cb = cb;
+ esp->param = param;
+}
+
+/**
* @brief Initializes s @p mutex_t object.
*
* @param[out] mp pointer to the @p mutex_t object
|