diff Common/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c @ 918:f72613a152dd Evo_2_23

Switch external interface tx communication to DMA: In the previous version the transmitting of data was done in polling mode. With the introduction of new sensors the length of commands send to the sensor may increase and have a impact to the runtim behavior of the SW. To avoid this the DMA transfers for TX has been activated.
author Ideenmodellierer
date Sun, 03 Nov 2024 15:40:55 +0100
parents c78bcbd5deda
children
line wrap: on
line diff
--- a/Common/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c	Sun Nov 03 15:37:00 2024 +0100
+++ b/Common/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c	Sun Nov 03 15:40:55 2024 +0100
@@ -182,8 +182,6 @@
 static void UART_EndRxTransfer(UART_HandleTypeDef *huart);
 static void UART_DMATransmitCplt(DMA_HandleTypeDef *hdma);
 static void UART_DMAReceiveCplt(DMA_HandleTypeDef *hdma);
-static void UART_DMATxHalfCplt(DMA_HandleTypeDef *hdma);
-static void UART_DMARxHalfCplt(DMA_HandleTypeDef *hdma);
 static void UART_DMAError(DMA_HandleTypeDef *hdma); 
 static void UART_DMAAbortOnError(DMA_HandleTypeDef *hdma);
 static void UART_DMATxAbortCallback(DMA_HandleTypeDef *hdma);
@@ -896,7 +894,7 @@
     huart->hdmatx->XferCpltCallback = UART_DMATransmitCplt;
 
     /* Set the UART DMA Half transfer complete callback */
-    huart->hdmatx->XferHalfCpltCallback = UART_DMATxHalfCplt;
+    huart->hdmatx->XferHalfCpltCallback = NULL;
 
     /* Set the DMA error callback */
     huart->hdmatx->XferErrorCallback = UART_DMAError;
@@ -960,7 +958,7 @@
     huart->hdmarx->XferCpltCallback = UART_DMAReceiveCplt;
     
     /* Set the UART DMA Half transfer complete callback */
-    huart->hdmarx->XferHalfCpltCallback = UART_DMARxHalfCplt;
+    huart->hdmarx->XferHalfCpltCallback = NULL;
     
     /* Set the DMA error callback */
     huart->hdmarx->XferErrorCallback = UART_DMAError;
@@ -2012,6 +2010,7 @@
   }
 }
 
+#ifdef HALF_COMPLETE_NEEDED
 /**
   * @brief DMA UART transmit process half complete callback 
   * @param  hdma pointer to a DMA_HandleTypeDef structure that contains
@@ -2024,7 +2023,7 @@
 
   HAL_UART_TxHalfCpltCallback(huart);
 }
-
+#endif
 /**
   * @brief  DMA UART receive process complete callback. 
   * @param  hdma DMA handle
@@ -2058,12 +2057,14 @@
   *                the configuration information for the specified DMA module.
   * @retval None
   */
+#if 0
 static void UART_DMARxHalfCplt(DMA_HandleTypeDef *hdma)
 {
   UART_HandleTypeDef* huart = (UART_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent;
 
   HAL_UART_RxHalfCpltCallback(huart); 
 }
+#endif
 
 /**
   * @brief  DMA UART communication error callback.