__HAL_RCC_USART1_CLK_ENABLE();
//USART1 //ELMO
USART1_Handler.Instance = USART1;
USART1_Handler.Init.BaudRate = 115200;
USART1_Handler.Init.WordLength = UART_WORDLENGTH_8B;
USART1_Handler.Init.StopBits = UART_STOPBITS_1;
USART1_Handler.Init.Parity = UART_PARITY_NONE;
USART1_Handler.Init.HwFlowCtl = UART_HWCONTROL_NONE;
USART1_Handler.Init.Mode = UART_MODE_TX_RX;
HAL_UART_Init(&USART1_Handler);
//¿aÆô′®¿úÖD¶Ï
HAL_UART_Receive_IT(&USART1_Handler, USART1_Receive_Buffer, 1);
HAL_NVIC_SetPriority(USART1_IRQn,0,3);
HAL_NVIC_EnableIRQ(USART1_IRQn);
void USART1_IRQHandler(void)
{
HAL_UART_IRQHandler(&USART1_Handler);
}
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
HAL_UART_Receive_IT(&USART1_Handler, USART1_Receive_Buffer, 1);
}
找不到哪里问题
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>