..Driversp_user.c(309): error: #134: expected a field name,困扰了一天 不知道怎么解决

2019-07-20 15:53发布

    __HAL_DMA_CLEAR_FLAG(&UART8_RxDMA_Handler,DMA_FLAG_TCIF1_5);        不报错
   __HAL_DMA_ENABLE_IT(&UART8_RxDMA_Handler, DMA_IT_TC);                       报错 错误如下
   __HAL_DMA_GET_FLAG(&UART8_RxDMA_Handler,DMA_FLAG_TCIF3_7);        不报错
    HAL_NVIC_SetPriority(DMA1_Stream6_IRQn,2,2);                 
    HAL_NVIC_EnableIRQ(DMA1_Stream6_IRQn);

..Driversp_user.c(309): error:  #134: expected a field name

可是dma.h文件里有
#define __HAL_DMA_CLEAR_FLAG(__HANDLE__, __FLAG__)
(((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA2_Stream3)? (DMA2->HIFCR = (__FLAG__)) :
((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream7)? (DMA2->LIFCR = (__FLAG__)) :
((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream3)? (DMA1->HIFCR = (__FLAG__)) : (DMA1->LIFCR = (__FLAG__)))

/**
  * @brief  Enable the specified DMA Stream interrupts.
  * @param  __HANDLE__: DMA handle
  * @param  __INTERRUPT__: specifies the DMA interrupt sources to be enabled or disabled.
  *        This parameter can be one of the following values:
  *           @arg DMA_IT_TC: Transfer complete interrupt mask.
  *           @arg DMA_IT_HT: Half transfer complete interrupt mask.
  *           @arg DMA_IT_TE: Transfer error interrupt mask.
  *           @arg DMA_IT_FE: FIFO error interrupt mask.
  *           @arg DMA_IT_DME: Direct mode error interrupt.
  * @retval None
  */
#define __HAL_DMA_ENABLE_IT(__HANDLE__, __INTERRUPT__)   (((__INTERRUPT__) != DMA_IT_FE)?
((__HANDLE__)->Instance->CR |= (__INTERRUPT__)) : ((__HANDLE__)->Instance->FCR |= (__INTERRUPT__)))


这两个define都定义了啊 这是为什么呢困扰一天了


友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。