summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bsp/K60Fxxxx/drivers/drv_uart.c2
-rw-r--r--components/drivers/serial/serial.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/bsp/K60Fxxxx/drivers/drv_uart.c b/bsp/K60Fxxxx/drivers/drv_uart.c
index c621713c37..4264af4d4c 100644
--- a/bsp/K60Fxxxx/drivers/drv_uart.c
+++ b/bsp/K60Fxxxx/drivers/drv_uart.c
@@ -241,8 +241,6 @@ void rt_hw_uart_init(void)
rt_hw_serial_register(&_k60_serial, "uart5",
RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX | RT_DEVICE_FLAG_STREAM,
(void*)&_k60_node);
-
- rt_device_control(&_k60_serial.parent, RT_DEVICE_CTRL_SET_INT, 0);
}
void rt_hw_console_output(const char *str)
diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c
index 1f6b29e261..bcc9f431d9 100644
--- a/components/drivers/serial/serial.c
+++ b/components/drivers/serial/serial.c
@@ -145,7 +145,11 @@ static rt_err_t rt_serial_init(struct rt_device *dev)
serial_ringbuffer_init(serial->int_rx);
if (dev->flag & RT_DEVICE_FLAG_INT_TX)
+ {
+ serial->ops->control(serial, RT_DEVICE_CTRL_SET_INT, (void *)RT_NULL);
serial_ringbuffer_init(serial->int_tx);
+ serial->int_sending_flag = RT_FALSE;
+ }
if (dev->flag & RT_DEVICE_FLAG_DMA_TX)
{