summaryrefslogtreecommitdiff
path: root/components/drivers
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2015-10-09 09:26:17 +0800
committerBernard Xiong <[email protected]>2015-10-09 09:26:17 +0800
commit1bebbecd221376340e4163c96eef399ffc92141f (patch)
tree517660afbe20338bb853ebf37eeec5547b14b74b /components/drivers
parent84833525918e56be8716c68e9f3bd0d6a737902b (diff)
Merge patch from master to prepare release v2.0.2
Diffstat (limited to 'components/drivers')
-rw-r--r--components/drivers/serial/serial.c9
-rw-r--r--components/drivers/src/completion.c4
2 files changed, 8 insertions, 5 deletions
diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c
index bcdd4db519..4e29b041a5 100644
--- a/components/drivers/serial/serial.c
+++ b/components/drivers/serial/serial.c
@@ -279,7 +279,7 @@ static rt_err_t rt_serial_open(struct rt_device *dev, rt_uint16_t oflag)
serial->config.bufsz);
RT_ASSERT(rx_fifo != RT_NULL);
rx_fifo->buffer = (rt_uint8_t*) (rx_fifo + 1);
- rt_memset(rx_fifo->buffer, 0, RT_SERIAL_RB_BUFSZ);
+ rt_memset(rx_fifo->buffer, 0, serial->config.bufsz);
rx_fifo->put_index = 0;
rx_fifo->get_index = 0;
@@ -302,6 +302,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;
@@ -519,12 +520,10 @@ void rt_hw_serial_isr(struct rt_serial_device *serial, int event)
rt_base_t level;
struct rt_serial_rx_fifo* rx_fifo;
+ /* interrupt mode receive */
rx_fifo = (struct rt_serial_rx_fifo*)serial->serial_rx;
RT_ASSERT(rx_fifo != RT_NULL);
-
- /* interrupt mode receive */
- RT_ASSERT(serial->parent.open_flag & RT_DEVICE_FLAG_INT_RX);
-
+
while (1)
{
ch = serial->ops->getc(serial);
diff --git a/components/drivers/src/completion.c b/components/drivers/src/completion.c
index 48afc2ee34..ef0b2911a7 100644
--- a/components/drivers/src/completion.c
+++ b/components/drivers/src/completion.c
@@ -39,6 +39,7 @@ void rt_completion_init(struct rt_completion *completion)
rt_list_init(&completion->suspended_list);
rt_hw_interrupt_enable(level);
}
+RTM_EXPORT(rt_completion_init);
rt_err_t rt_completion_wait(struct rt_completion *completion,
rt_int32_t timeout)
@@ -105,6 +106,7 @@ __exit:
return result;
}
+RTM_EXPORT(rt_completion_wait);
void rt_completion_done(struct rt_completion *completion)
{
@@ -139,3 +141,5 @@ void rt_completion_done(struct rt_completion *completion)
rt_hw_interrupt_enable(level);
}
}
+RTM_EXPORT(rt_completion_done);
+