From 8f0fffc1323ff393bf8365aaa09e15e4ae7fa4bf Mon Sep 17 00:00:00 2001 From: reynoldxu Date: Wed, 24 Jul 2013 17:14:54 +0800 Subject: fix a bug in rt_hw_uart_init() where u CAN NOT init some feature. --- components/drivers/serial/serial.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'components/drivers') 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) { -- cgit v1.3.1 From 10c75c3dc6d5d0e1653384a9cf94f74fe1549900 Mon Sep 17 00:00:00 2001 From: reynoldxu Date: Thu, 25 Jul 2013 10:18:33 +0800 Subject: remove a var for INT_TX. --- components/drivers/serial/serial.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'components/drivers') diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c index bcc9f431d9..c7b8e79b2b 100644 --- a/components/drivers/serial/serial.c +++ b/components/drivers/serial/serial.c @@ -146,9 +146,12 @@ static rt_err_t rt_serial_init(struct rt_device *dev) if (dev->flag & RT_DEVICE_FLAG_INT_TX) { + /* not supported yet */ + /* 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) -- cgit v1.3.1