mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-21 02:27:10 +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)
|
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_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.RT_USING_DFS:
|
||||||
if rtconfig.STM32_TYPE == 'STM32F10X_HD':
|
if rtconfig.STM32_TYPE == 'STM32F10X_HD':
|
||||||
|
@ -1,28 +1,59 @@
|
|||||||
# component options
|
import SCons.cpp
|
||||||
# finsh shell option
|
|
||||||
RT_USING_FINSH = True
|
|
||||||
|
|
||||||
# device file system options
|
# component options
|
||||||
RT_USING_DFS = True
|
|
||||||
RT_USING_DFS_EFSL = True
|
# make all component false
|
||||||
RT_USING_DFS_ELMFAT = False
|
RT_USING_FINSH = False
|
||||||
|
RT_USING_DFS = False
|
||||||
|
RT_USING_DFS_EFSL = False
|
||||||
RT_USING_DFS_YAFFS2 = 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
|
# 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
|
# rtgui options
|
||||||
RT_USING_RTGUI = False
|
if rtconfig_ns.has_key('RT_USING_RTGUI'):
|
||||||
|
RT_USING_RTGUI = True
|
||||||
|
|
||||||
# toolchains options
|
# toolchains options
|
||||||
ARCH='arm'
|
ARCH='arm'
|
||||||
CPU='stm32'
|
CPU='stm32'
|
||||||
PLATFORM = 'gcc'
|
CROSS_TOOL='gcc'
|
||||||
EXEC_PATH = 'E:/Program Files/CodeSourcery/Sourcery G++ Lite/bin'
|
|
||||||
#PLATFORM = 'armcc'
|
if CROSS_TOOL == 'gcc':
|
||||||
#EXEC_PATH = 'C:/Keil'
|
PLATFORM = 'gcc'
|
||||||
#PLATFORM = 'iar'
|
EXEC_PATH = 'D:/SourceryGCC/bin'
|
||||||
#EXEC_PATH = 'E:/Program Files/IAR Systems/Embedded Workbench 5.4/'
|
elif CROSS_TOOL == 'keil':
|
||||||
|
PLATFORM = 'armcc'
|
||||||
|
EXEC_PATH = 'E:/Keil'
|
||||||
|
|
||||||
BUILD = 'debug'
|
BUILD = 'debug'
|
||||||
STM32_TYPE = 'STM32F10X_HD'
|
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)
|
if (size > 0)
|
||||||
err_code = -RT_EFULL;
|
err_code = -RT_EFULL;
|
||||||
}
|
}
|
||||||
|
#ifdef RT_USING_HEAP
|
||||||
else if (dev->flag & RT_DEVICE_FLAG_DMA_TX)
|
else if (dev->flag & RT_DEVICE_FLAG_DMA_TX)
|
||||||
{
|
{
|
||||||
/* DMA mode 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);
|
rt_hw_interrupt_enable(level);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* polling mode */
|
/* 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)
|
void rt_hw_serial_dma_tx_isr(rt_device_t device)
|
||||||
{
|
{
|
||||||
|
#ifdef RT_USING_HEAP
|
||||||
rt_uint32_t level;
|
rt_uint32_t level;
|
||||||
struct stm32_serial_data_node* data_node;
|
struct stm32_serial_data_node* data_node;
|
||||||
struct stm32_serial_device* uart = (struct stm32_serial_device*) device->private;
|
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 */
|
/* enable interrupt */
|
||||||
rt_hw_interrupt_enable(level);
|
rt_hw_interrupt_enable(level);
|
||||||
|
|
||||||
/* free data node memory */
|
/* free data node memory(!!) */
|
||||||
rt_free(data_node);
|
rt_free(data_node);
|
||||||
|
|
||||||
if (uart->dma_tx->list_tail != RT_NULL)
|
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 */
|
/* no data to be transmitted, disable DMA */
|
||||||
DMA_Cmd(uart->dma_tx->dma_channel, DISABLE);
|
DMA_Cmd(uart->dma_tx->dma_channel, DISABLE);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user