From 155ef8ed75b12442fde1d80e4ca880d0e7f7c1f1 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 17 Aug 2013 11:52:50 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6169 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/osal/chibios/osal.c | 29 ----------------------------- os/hal/osal/chibios/osal.h | 26 ++++++++++++++++++++++++-- os/hal/platforms/STM32/SPIv2/spi_lld.h | 2 +- os/hal/platforms/STM32/USARTv2/uart_lld.h | 2 +- 4 files changed, 26 insertions(+), 33 deletions(-) (limited to 'os/hal') 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 @@ -267,6 +268,27 @@ extern "C" { /* Module inline functions. */ /*===========================================================================*/ +/** + * @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__) -- cgit v1.2.3