aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2018-03-17 09:03:27 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2018-03-17 09:03:27 +0000
commit5806f29b87e6d94957c907de200e6cdbe49aea78 (patch)
treea5916c512460bf0fa9bb1293870d7ef1d5146637 /os
parent946ea7eb8ee1d136933321a84e96d23324342c73 (diff)
downloadChibiOS-5806f29b87e6d94957c907de200e6cdbe49aea78.tar.gz
ChibiOS-5806f29b87e6d94957c907de200e6cdbe49aea78.tar.bz2
ChibiOS-5806f29b87e6d94957c907de200e6cdbe49aea78.zip
New halconf.h template.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11788 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os')
-rw-r--r--os/hal/include/hal_can.h13
-rw-r--r--os/hal/templates/halconf.h7
2 files changed, 17 insertions, 3 deletions
diff --git a/os/hal/include/hal_can.h b/os/hal/include/hal_can.h
index 3a12c09d1..61bd8b1be 100644
--- a/os/hal/include/hal_can.h
+++ b/os/hal/include/hal_can.h
@@ -79,6 +79,13 @@
#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
#define CAN_USE_SLEEP_MODE TRUE
#endif
+
+/**
+ * @brief Enforces the driver to use direct callbacks rather than OSAL events.
+ */
+#if !defined(CAN_ENFORCE_USE_CALLBACKS) || defined(__DOXYGEN__)
+#define CAN_ENFORCE_USE_CALLBACKS FALSE
+#endif
/** @} */
/*===========================================================================*/
@@ -136,7 +143,7 @@ typedef enum {
* @name Low level driver helper macros
* @{
*/
-#if !defined(CAN_ENFORCE_USE_CALLBACKS)
+#if CAN_ENFORCE_USE_CALLBACKS == FALSE
/**
* @brief TX mailbox empty event.
*/
@@ -174,7 +181,7 @@ typedef enum {
osalEventBroadcastFlagsI(&(canp)->error_event, flags); \
osalSysUnlockFromISR(); \
}
-#else /* defined(CAN_ENFORCE_USE_CALLBACKS) */
+#else /* CAN_ENFORCE_USE_CALLBACKS == TRUE */
#define _can_tx_empty_isr(canp, flags) { \
if ((canp)->txempty_cb != NULL) { \
(canp)->txempty_cb(canp, flags); \
@@ -204,7 +211,7 @@ typedef enum {
(canp)->error_cb(canp, flags); \
} \
}
-#endif /* defined(CAN_ENFORCE_USE_CALLBACKS) */
+#endif /* CAN_ENFORCE_USE_CALLBACKS == TRUE */
/** @} */
/*===========================================================================*/
diff --git a/os/hal/templates/halconf.h b/os/hal/templates/halconf.h
index 2eac78b5e..f27169ae4 100644
--- a/os/hal/templates/halconf.h
+++ b/os/hal/templates/halconf.h
@@ -238,6 +238,13 @@
#define CAN_USE_SLEEP_MODE TRUE
#endif
+/**
+ * @brief Enforces the driver to use direct callbacks rather than OSAL events.
+ */
+#if !defined(CAN_ENFORCE_USE_CALLBACKS) || defined(__DOXYGEN__)
+#define CAN_ENFORCE_USE_CALLBACKS FALSE
+#endif
+
/*===========================================================================*/
/* CRY driver related settings. */
/*===========================================================================*/