diff options
| author | bernard.xiong <[email protected]> | 2010-03-18 09:20:04 +0000 |
|---|---|---|
| committer | bernard.xiong <[email protected]> | 2010-03-18 09:20:04 +0000 |
| commit | 8da1163675784b1cda1c09677bed96694ea77a91 (patch) | |
| tree | 89542ac8f2c0bff168db82400cf53175353ed8b6 /libcpu | |
| parent | a4ce05206f7d9dfdf6c37e65f97d129744c5324f (diff) | |
fix GCC compiling error.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@511 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'libcpu')
| -rw-r--r-- | libcpu/arm/stm32/serial.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libcpu/arm/stm32/serial.c b/libcpu/arm/stm32/serial.c index 19b0d80375..f77e92e254 100644 --- a/libcpu/arm/stm32/serial.c +++ b/libcpu/arm/stm32/serial.c @@ -335,6 +335,7 @@ static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buf if (size > 0) err_code = -RT_EFULL; } +#ifdef RT_USING_HEAP else if (dev->flag & RT_DEVICE_FLAG_DMA_TX) { /* DMA mode Tx */ @@ -381,6 +382,7 @@ static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buf rt_hw_interrupt_enable(level); } } +#endif else { /* polling mode */ @@ -544,6 +546,7 @@ void rt_hw_serial_dma_rx_isr(rt_device_t device) */ void rt_hw_serial_dma_tx_isr(rt_device_t device) { +#ifdef RT_USING_HEAP rt_uint32_t level; struct stm32_serial_data_node* data_node; struct stm32_serial_device* uart = (struct stm32_serial_device*) device->private; @@ -570,7 +573,7 @@ void rt_hw_serial_dma_tx_isr(rt_device_t device) /* enable interrupt */ rt_hw_interrupt_enable(level); - /* free data node memory */ + /* free data node memory(!!) */ rt_free(data_node); if (uart->dma_tx->list_tail != RT_NULL) @@ -585,6 +588,7 @@ void rt_hw_serial_dma_tx_isr(rt_device_t device) /* no data to be transmitted, disable DMA */ DMA_Cmd(uart->dma_tx->dma_channel, DISABLE); } +#endif } /*@}*/ |
