aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
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. */
/*===========================================================================*/