aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2016-06-06 12:13:10 -0400
committerPaul Selkirk <paul@psgd.org>2016-06-06 12:13:10 -0400
commit89e6d25569bcc112b014d81368f90ca2fa4ae06a (patch)
tree900fe96632510ceab966b9e46db3a059871f38f9
parentb37cbe6a58367c9ecaf732e05f445230c64a6b08 (diff)
Split HAL_UART_RxCpltCallback into uart-specific callbacks.
-rw-r--r--libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_CRYPTECH_ALPHA/stm32f4xx_it.c58
1 files 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
@@ -145,10 +150,26 @@ void SysTick_Handler(void)
/******************************************************************************/
/**
+* @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****/