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 | |
| parent | a4ce05206f7d9dfdf6c37e65f97d129744c5324f (diff) | |
fix GCC compiling error.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@511 bbd45198-f89e-11dd-88c7-29a3b14d5316
| -rw-r--r-- | bsp/stm3210/SConstruct | 2 | ||||
| -rw-r--r-- | bsp/stm3210/rtconfig.py | 59 | ||||
| -rw-r--r-- | libcpu/arm/stm32/serial.c | 6 |
3 files changed, 51 insertions, 16 deletions
diff --git a/bsp/stm3210/SConstruct b/bsp/stm3210/SConstruct index 67451b5922..f57833a134 100644 --- a/bsp/stm3210/SConstruct +++ b/bsp/stm3210/SConstruct @@ -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':
diff --git a/bsp/stm3210/rtconfig.py b/bsp/stm3210/rtconfig.py index 5e76672df7..26ed7866a6 100644 --- a/bsp/stm3210/rtconfig.py +++ b/bsp/stm3210/rtconfig.py @@ -1,28 +1,59 @@ +import SCons.cpp
+
# component options
-# finsh shell option
-RT_USING_FINSH = True
-# device file system options
-RT_USING_DFS = True
-RT_USING_DFS_EFSL = True
-RT_USING_DFS_ELMFAT = False
+# 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'
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 } /*@}*/ |
