aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-05-17 09:26:53 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-05-17 09:26:53 +0000
commitd8be93f6a6eff07e8d8c9919443bbd2f5fdcd605 (patch)
tree2b1da338f431688205be77c11537c5825d0e2cbd /src
parent53e6a9d2a79a83aa79338ea0a4ef898f95a155eb (diff)
downloadChibiOS-d8be93f6a6eff07e8d8c9919443bbd2f5fdcd605.tar.gz
ChibiOS-d8be93f6a6eff07e8d8c9919443bbd2f5fdcd605.tar.bz2
ChibiOS-d8be93f6a6eff07e8d8c9919443bbd2f5fdcd605.zip
Fixed warning in event sources static initializer.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@981 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src')
-rw-r--r--src/include/events.h64
1 files changed, 32 insertions, 32 deletions
diff --git a/src/include/events.h b/src/include/events.h
index 6b79553ed..c8bf0c6e6 100644
--- a/src/include/events.h
+++ b/src/include/events.h
@@ -29,9 +29,6 @@
#if CH_USE_EVENTS
-/** All events allowed mask.*/
-#define ALL_EVENTS -1
-
typedef struct EventListener EventListener;
/**
@@ -54,10 +51,42 @@ typedef struct EventSource {
the Event Source.*/
} EventSource;
+/**
+ * @brief Data part of a static event source initializer.
+ * @details This macro should be used when statically initializing an event
+ * source that is part of a bigger structure.
+ * @param name the name of the event source variable
+ */
+#define _EVENTSOURCE_DATA(name) {(void *)(&name)}
+
+/**
+ * @brief Static event source initializer.
+ * @details Statically initialized event sources require no explicit
+ * initialization using @p chEvtInit().
+ * @param name the name of the event source variable
+ */
+#define EVENTSOURCE_DECL(name) EventSource name = _EVENTSOURCE_DATA(name)
+
+/** All events allowed mask.*/
+#define ALL_EVENTS -1
+
/** Returns the event mask from the event identifier.*/
#define EVENT_MASK(eid) (1 << (eid))
/**
+ * Registers an Event Listener on an Event Source.
+ * @param esp pointer to the @p EventSource structure
+ * @param elp pointer to the @p EventListener structure
+ * @param eid numeric identifier assigned to the Event Listener. The identifier
+ * is used as index for the event callback function.
+ * The value must range between zero and the size, in bit, of the
+ * @p eventid_t type minus one.
+ * @note Multiple Event Listeners can use the same event identifier, the
+ * listener will share the callback function.
+ */
+#define chEvtRegister(esp, elp, eid) chEvtRegisterMask(esp, elp, EVENT_MASK(eid))
+
+/**
* Initializes an Event Source.
* @param esp pointer to the @p EventSource structure
* @note Can be called with interrupts disabled or enabled.
@@ -103,35 +132,6 @@ extern "C" {
}
#endif
-/**
- * @brief Data part of a static event source initializer.
- * @details This macro should be used when statically initializing an event
- * source that is part of a bigger structure.
- * @param name the name of the event source variable
- */
-#define _EVENTSOURCE_DATA(name) {(EventListener *)&name}
-
-/**
- * @brief Static event source initializer.
- * @details Statically initialized event sources require no explicit
- * initialization using @p chEvtInit().
- * @param name the name of the event source variable
- */
-#define EVENTSOURCE_DECL(name) EventSource name = _EVENTSOURCE_DATA(name)
-
-/**
- * Registers an Event Listener on an Event Source.
- * @param esp pointer to the @p EventSource structure
- * @param elp pointer to the @p EventListener structure
- * @param eid numeric identifier assigned to the Event Listener. The identifier
- * is used as index for the event callback function.
- * The value must range between zero and the size, in bit, of the
- * @p eventid_t type minus one.
- * @note Multiple Event Listeners can use the same event identifier, the
- * listener will share the callback function.
- */
-#define chEvtRegister(esp, elp, eid) chEvtRegisterMask(esp, elp, EVENT_MASK(eid))
-
#if !CH_OPTIMIZE_SPEED && CH_USE_EVENTS_TIMEOUT
#define chEvtWaitOne(ewmask) chEvtWaitOneTimeout(ewmask, TIME_INFINITE)
#define chEvtWaitAny(ewmask) chEvtWaitAnyTimeout(ewmask, TIME_INFINITE)