From 23b5fe5239a00260dfafb321112760b6200c377f Mon Sep 17 00:00:00 2001 From: quintin Date: Mon, 31 Aug 2015 14:57:01 +0800 Subject: [PATCH] fix DMA tx mod tx_dma->activated flag init bug. --- components/drivers/serial/serial.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c index 8744aa4657..f5a199e10b 100644 --- a/components/drivers/serial/serial.c +++ b/components/drivers/serial/serial.c @@ -27,6 +27,8 @@ * the size of ring buffer. * 2014-07-10 bernard rewrite serial framework * 2014-12-31 bernard use open_flag for poll_tx stream mode. + * 2015-05-19 Quintin fix DMA tx mod tx_dma->activated flag !=RT_FALSE BUG + * in open function. */ #include @@ -302,6 +304,7 @@ static rt_err_t rt_serial_open(struct rt_device *dev, rt_uint16_t oflag) tx_dma = (struct rt_serial_tx_dma*) rt_malloc (sizeof(struct rt_serial_tx_dma)); RT_ASSERT(tx_dma != RT_NULL); + tx_dma->activated = RT_FALSE; rt_data_queue_init(&(tx_dma->data_queue), 8, 4, RT_NULL); serial->serial_tx = tx_dma;