diff options
Diffstat (limited to 'os/hal')
-rw-r--r-- | os/hal/osal/chibios/osal.c | 29 | ||||
-rw-r--r-- | os/hal/osal/chibios/osal.h | 26 | ||||
-rw-r--r-- | os/hal/platforms/STM32/SPIv2/spi_lld.h | 2 | ||||
-rw-r--r-- | os/hal/platforms/STM32/USARTv2/uart_lld.h | 2 |
4 files changed, 26 insertions, 33 deletions
diff --git a/os/hal/osal/chibios/osal.c b/os/hal/osal/chibios/osal.c index ed291880b..52fc27041 100644 --- a/os/hal/osal/chibios/osal.c +++ b/os/hal/osal/chibios/osal.c @@ -36,13 +36,6 @@ /* Module exported variables. */
/*===========================================================================*/
-/**
- * @brief Pointer to a halt error message.
- * @note The message is meant to be retrieved by the debugger after the
- * system halt caused by an unexpected error.
- */
-const char *osal_halt_msg;
-
/*===========================================================================*/
/* Module local types. */
/*===========================================================================*/
@@ -59,26 +52,4 @@ const char *osal_halt_msg; /* Module exported functions. */
/*===========================================================================*/
-/**
- * @brief OSAL module initialization.
- *
- * @api
- */
-void osalInit(void) {
-
-}
-
-/**
- * @brief System halt with error message.
- *
- * @param[in] reason the halt message pointer
- *
- * @api
- */
-void osalSysHalt(const char *reason) {
-
- osal_halt_msg = reason;
- chSysHalt();
-}
-
/** @} */
diff --git a/os/hal/osal/chibios/osal.h b/os/hal/osal/chibios/osal.h index b3d0fae2b..3633a1f02 100644 --- a/os/hal/osal/chibios/osal.h +++ b/os/hal/osal/chibios/osal.h @@ -55,6 +55,7 @@ #define OSAL_FAILED TRUE
/** @} */
+#if 0
/**
* @name Messages
* @{
@@ -63,6 +64,7 @@ #define MSG_RESET RDY_RESET
#define MSG_TIMEOUT RDY_TIMEOUT
/** @} */
+#endif
#if 0
/**
@@ -257,8 +259,7 @@ typedef struct { #ifdef __cplusplus
extern "C" {
#endif
- void osalInit(void);
- void osalSysHalt(const char *reason);
+
#ifdef __cplusplus
}
#endif
@@ -268,6 +269,27 @@ extern "C" { /*===========================================================================*/
/**
+ * @brief OSAL module initialization.
+ *
+ * @api
+ */
+static inline void osalInit(void) {
+
+}
+
+/**
+ * @brief System halt with error message.
+ *
+ * @param[in] reason the halt message pointer
+ *
+ * @api
+ */
+static inline void osalSysHalt(const char *reason) {
+
+ chSysHalt(reason);
+}
+
+/**
* @brief Enters a critical zone from thread context.
* @note This function cannot be used for reentrant critical zones.
*
diff --git a/os/hal/platforms/STM32/SPIv2/spi_lld.h b/os/hal/platforms/STM32/SPIv2/spi_lld.h index fc2b39fa5..9f06fa5e5 100644 --- a/os/hal/platforms/STM32/SPIv2/spi_lld.h +++ b/os/hal/platforms/STM32/SPIv2/spi_lld.h @@ -121,7 +121,7 @@ * @brief SPI DMA error hook.
*/
#if !defined(STM32_SPI_DMA_ERROR_HOOK) || defined(__DOXYGEN__)
-#define STM32_SPI_DMA_ERROR_HOOK(spip) chSysHalt()
+#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
#endif
#if STM32_ADVANCED_DMA || defined(__DOXYGEN__)
diff --git a/os/hal/platforms/STM32/USARTv2/uart_lld.h b/os/hal/platforms/STM32/USARTv2/uart_lld.h index 6d44af0ba..c34123aca 100644 --- a/os/hal/platforms/STM32/USARTv2/uart_lld.h +++ b/os/hal/platforms/STM32/USARTv2/uart_lld.h @@ -123,7 +123,7 @@ * error can only happen because programming errors.
*/
#if !defined(STM32_UART_DMA_ERROR_HOOK) || defined(__DOXYGEN__)
-#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt()
+#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
#endif
#if STM32_ADVANCED_DMA || defined(__DOXYGEN__)
|