mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-19 04:31:36 +08:00
fix GCC compiling error.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@511 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
a4ce05206f
commit
8da1163675
@ -37,7 +37,7 @@ if rtconfig.RT_USING_LWIP:
|
||||
objs = objs + SConscript(RTT_ROOT + '/net/lwip/SConscript', variant_dir='build/net/lwip', duplicate=0)
|
||||
|
||||
src_bsp = ['application.c', 'startup.c', 'board.c', 'stm32f10x_it.c']
|
||||
src_drv = ['rtc.c', 'usart.c']
|
||||
src_drv = ['rtc.c', 'usart.c', 'led.c']
|
||||
|
||||
if rtconfig.RT_USING_DFS:
|
||||
if rtconfig.STM32_TYPE == 'STM32F10X_HD':
|
||||
|
@ -1,28 +1,59 @@
|
||||
# component options
|
||||
# finsh shell option
|
||||
RT_USING_FINSH = True
|
||||
import SCons.cpp
|
||||
|
||||
# device file system options
|
||||
RT_USING_DFS = True
|
||||
RT_USING_DFS_EFSL = True
|
||||
RT_USING_DFS_ELMFAT = False
|
||||
# component options
|
||||
|
||||
# make all component false
|
||||
RT_USING_FINSH = False
|
||||
RT_USING_DFS = False
|
||||
RT_USING_DFS_EFSL = False
|
||||
RT_USING_DFS_YAFFS2 = False
|
||||
RT_USING_LWIP = False
|
||||
RT_USING_WEBSERVER = False
|
||||
RT_USING_RTGUI = False
|
||||
|
||||
# parse rtconfig.h to get used component
|
||||
PreProcessor = SCons.cpp.PreProcessor()
|
||||
f = file('rtconfig.h', 'r')
|
||||
contents = f.read()
|
||||
f.close()
|
||||
PreProcessor.process_contents(contents)
|
||||
rtconfig_ns = PreProcessor.cpp_namespace
|
||||
|
||||
# finsh shell options
|
||||
if rtconfig_ns.has_key('RT_USING_FINSH'):
|
||||
RT_USING_FINSH = True
|
||||
|
||||
# device virtual filesystem options
|
||||
if rtconfig_ns.has_key('RT_USING_DFS'):
|
||||
RT_USING_DFS = True
|
||||
|
||||
if rtconfig_ns.has_key('RT_USING_DFS_EFSL'):
|
||||
RT_USING_DFS_EFSL = True
|
||||
if rtconfig_ns.has_key('RT_USING_DFS_YAFFS2'):
|
||||
RT_USING_DFS_YAFFS2 = True
|
||||
|
||||
# lwip options
|
||||
RT_USING_LWIP = True
|
||||
if rtconfig_ns.has_key('RT_USING_LWIP'):
|
||||
RT_USING_LWIP = True
|
||||
if rtconfig_ns.has_key('RT_USING_WEBSERVER'):
|
||||
RT_USING_WEBSERVER = True
|
||||
|
||||
# rtgui options
|
||||
RT_USING_RTGUI = False
|
||||
if rtconfig_ns.has_key('RT_USING_RTGUI'):
|
||||
RT_USING_RTGUI = True
|
||||
|
||||
# toolchains options
|
||||
ARCH='arm'
|
||||
CPU='stm32'
|
||||
PLATFORM = 'gcc'
|
||||
EXEC_PATH = 'E:/Program Files/CodeSourcery/Sourcery G++ Lite/bin'
|
||||
#PLATFORM = 'armcc'
|
||||
#EXEC_PATH = 'C:/Keil'
|
||||
#PLATFORM = 'iar'
|
||||
#EXEC_PATH = 'E:/Program Files/IAR Systems/Embedded Workbench 5.4/'
|
||||
CROSS_TOOL='gcc'
|
||||
|
||||
if CROSS_TOOL == 'gcc':
|
||||
PLATFORM = 'gcc'
|
||||
EXEC_PATH = 'D:/SourceryGCC/bin'
|
||||
elif CROSS_TOOL == 'keil':
|
||||
PLATFORM = 'armcc'
|
||||
EXEC_PATH = 'E:/Keil'
|
||||
|
||||
BUILD = 'debug'
|
||||
STM32_TYPE = 'STM32F10X_HD'
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
/*@}*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user