From 89e6d25569bcc112b014d81368f90ca2fa4ae06a Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Mon, 6 Jun 2016 12:13:10 -0400 Subject: Split HAL_UART_RxCpltCallback into uart-specific callbacks. --- .../TARGET_CRYPTECH_ALPHA/stm32f4xx_it.c | 58 ++++++++++++++++++---- 1 file changed, 47 insertions(+), 11 deletions(-) diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_CRYPTECH_ALPHA/stm32f4xx_it.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_CRYPTECH_ALPHA/stm32f4xx_it.c index b3de408..f9f21ef 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_CRYPTECH_ALPHA/stm32f4xx_it.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_CRYPTECH_ALPHA/stm32f4xx_it.c @@ -44,6 +44,11 @@ /* Cortex-M4 Processor Exceptions Handlers */ /******************************************************************************/ +/* + * We define these to make debugging easier, because otherwise gdb reports + * HardFault_Handler as WWDG_IRQHandler. + */ + /** * @brief This function handles NMI exception. * @param None @@ -144,11 +149,27 @@ void SysTick_Handler(void) /* file (startup_stm32f4xx.s). */ /******************************************************************************/ +/** +* @brief This function handles DMA1 stream5 global interrupt. +*/ +void DMA1_Stream5_IRQHandler(void) +{ + HAL_DMA_IRQHandler(&hdma_usart_user_rx); +} + +/** +* @brief This function handles DMA2 stream2 global interrupt. +*/ +void DMA2_Stream2_IRQHandler(void) +{ + HAL_DMA_IRQHandler(&hdma_usart_mgmt_rx); +} + /** * @brief This function handles UART interrupt request. * @param None * @retval None - * @Note HAL_UART_IRQHandler will call HAL_UART_TxCpltCallback in main.c. + * @Note HAL_UART_IRQHandler will call HAL_UART_RxCpltCallback in main.c. */ void USART1_IRQHandler(void) { @@ -159,28 +180,43 @@ void USART1_IRQHandler(void) * @brief This function handles UART interrupt request. * @param None * @retval None - * @Note HAL_UART_IRQHandler will call HAL_UART_TxCpltCallback in main.c. + * @Note HAL_UART_IRQHandler will call HAL_UART_RxCpltCallback in main.c. */ void USART2_IRQHandler(void) { HAL_UART_IRQHandler(&huart_user); } -/** -* @brief This function handles DMA1 stream5 global interrupt. -*/ -void DMA1_Stream5_IRQHandler(void) +void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) { - HAL_DMA_IRQHandler(&hdma_usart_user_rx); + extern void HAL_UART1_RxCpltCallback(UART_HandleTypeDef *huart); + extern void HAL_UART2_RxCpltCallback(UART_HandleTypeDef *huart); + + if (huart->Instance == USART1) + HAL_UART1_RxCpltCallback(huart); + + else if (huart->Instance == USART2) + HAL_UART2_RxCpltCallback(huart); } /** -* @brief This function handles DMA2 stream2 global interrupt. -*/ -void DMA2_Stream2_IRQHandler(void) + * @brief Rx Transfer completed callbacks. + * @param huart: pointer to a UART_HandleTypeDef structure that contains + * the configuration information for the specified UART module. + * @retval None + */ +__weak void HAL_UART1_RxCpltCallback(UART_HandleTypeDef *huart) { - HAL_DMA_IRQHandler(&hdma_usart_mgmt_rx); + /* NOTE: This function Should not be modified, when the callback is needed, + the HAL_UART_TxCpltCallback could be implemented in the user file + */ } +__weak void HAL_UART2_RxCpltCallback(UART_HandleTypeDef *huart) +{ + /* NOTE: This function Should not be modified, when the callback is needed, + the HAL_UART_TxCpltCallback could be implemented in the user file + */ +} /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ -- cgit v1.2.3