接收错误中断未触发的问题

/* Enable error interrupt */
NVIC_EnableIRQ(uart->config->rxerr_irq.irq_config.irq_num);
上述代码使能错误接收中断后需要使能串口的接收中断`USART_INT_RX`才可以正常触发中断
This commit is contained in:
ueJone 2022-06-16 10:39:51 +08:00 committed by guo
parent 5774dcac8f
commit 956fdc60c0
1 changed files with 1 additions and 1 deletions

View File

@ -264,7 +264,7 @@ static rt_err_t hc32_configure(struct rt_serial_device *serial, struct serial_co
/* Enable error interrupt */
NVIC_EnableIRQ(uart->config->rxerr_irq.irq_config.irq_num);
USART_FuncCmd(uart->config->Instance, USART_TX | USART_RX, ENABLE);
USART_FuncCmd(uart->config->Instance, USART_TX | USART_RX | USART_INT_RX, ENABLE);
return RT_EOK;
}