diff options
| author | ueJone <[email protected]> | 2022-06-16 10:39:51 +0800 |
|---|---|---|
| committer | guo <[email protected]> | 2022-06-21 14:16:17 +0800 |
| commit | 956fdc60c0f658025012e2d90d638d4bb40f566e (patch) | |
| tree | 90c5261eb474db812108cee7f4143718b6e4d927 /bsp | |
| parent | 5774dcac8fe15d3621f014afb5ae409bcf27a1c2 (diff) | |
接收错误中断未触发的问题
/* Enable error interrupt */
NVIC_EnableIRQ(uart->config->rxerr_irq.irq_config.irq_num);
上述代码使能错误接收中断后需要使能串口的接收中断`USART_INT_RX`才可以正常触发中断
Diffstat (limited to 'bsp')
| -rw-r--r-- | bsp/hc32/libraries/hc32_drivers/drv_usart.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bsp/hc32/libraries/hc32_drivers/drv_usart.c b/bsp/hc32/libraries/hc32_drivers/drv_usart.c index 582bb343d2..36df63c428 100644 --- a/bsp/hc32/libraries/hc32_drivers/drv_usart.c +++ b/bsp/hc32/libraries/hc32_drivers/drv_usart.c @@ -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; } |
