STM32H743/Core/Src/stm32h7xx_it.c
@@ -23,6 +23,7 @@
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "bluetooth.h"
#include "DBG.h"
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
@@ -452,19 +453,16 @@
void USART6_IRQHandler(void)
{
  /* USER CODE BEGIN USART6_IRQn 0 */
  // Circular DMA Mode: Just set a flag, do NOT stop DMA
  uint32_t tmp_flag = 0;
    uint32_t temp;
    tmp_flag = __HAL_UART_GET_FLAG(&huart6, UART_FLAG_IDLE); 
    if ((tmp_flag != RESET)) 
    {
        g_u32BtIdleIntCount++; // Debug Counter
        __HAL_UART_CLEAR_IDLEFLAG(&huart6);
        HAL_UART_DMAStop(&huart6); //
        temp  =  __HAL_DMA_GET_COUNTER(&hdma_usart6_rx);
        uart6_dma_recv_len =  UART6_DMA_RX_BUF_SIZE - temp;
        uart6_dma_recv_end_flag = 1;
      HAL_UART_Receive_DMA(&huart6, uart6_dma_rxbuf, UART6_DMA_RX_BUF_SIZE);
        // For Circular DMA, we do NOT stop DMA. Just set a flag to notify Poll.
        uart6_dma_recv_end_flag = 1; // Notify Poll that new data arrived
    }
  /* USER CODE END USART6_IRQn 0 */