From c021765b71c4cb4e4dfff5301a74f37b43e35c24 Mon Sep 17 00:00:00 2001 From: "bernard.xiong@gmail.com" Date: Fri, 13 Jan 2012 14:58:58 +0000 Subject: [PATCH] update building script. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1917 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- bsp/lpc176x/SConstruct | 5 ++++- bsp/lpc176x/board.c | 4 +--- bsp/lpc176x/emac.c | 6 +++--- bsp/lpc176x/rtconfig.py | 9 +++++++++ bsp/lpc176x/startup.c | 3 --- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/bsp/lpc176x/SConstruct b/bsp/lpc176x/SConstruct index fddbc18a1..9e9229fa3 100644 --- a/bsp/lpc176x/SConstruct +++ b/bsp/lpc176x/SConstruct @@ -2,7 +2,10 @@ import os import sys import rtconfig -RTT_ROOT = os.path.normpath(os.getcwd() + '/../..') +if os.getenv('RTT_ROOT'): + RTT_ROOT = os.getenv('RTT_ROOT') +else: + RTT_ROOT = os.path.normpath(os.getcwd() + '/../..') sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')] from building import * diff --git a/bsp/lpc176x/board.c b/bsp/lpc176x/board.c index a5cb4b030..24bc828ad 100644 --- a/bsp/lpc176x/board.c +++ b/bsp/lpc176x/board.c @@ -63,7 +63,7 @@ void rt_hw_board_init() #endif /* init systick */ - SysTick_Config( SystemCoreClock/RT_TICK_PER_SECOND - 1); + SysTick_Config( SystemCoreClock/RT_TICK_PER_SECOND); /* set pend exception priority */ NVIC_SetPriority(PendSV_IRQn, (1<<__NVIC_PRIO_BITS) - 1); @@ -71,8 +71,6 @@ void rt_hw_board_init() rt_hw_uart_init(); rt_console_set_device("uart0"); #endif - - rt_kprintf("\r\n\r\nSystemInit......\r\n"); } /*@}*/ diff --git a/bsp/lpc176x/emac.c b/bsp/lpc176x/emac.c index bcdb61fc6..226e5a6e0 100644 --- a/bsp/lpc176x/emac.c +++ b/bsp/lpc176x/emac.c @@ -218,7 +218,7 @@ static rt_err_t lpc17xx_emac_init(rt_device_t dev) switch (lpc17xx_emac_device.phy_mode) { case EMAC_PHY_AUTO: - /* Use autonegotiation about the link speed. */ + /* Use auto negotiation about the link speed. */ write_PHY (PHY_REG_BMCR, PHY_AUTO_NEG); /* Wait to complete Auto_Negotiation. */ for (tout = 0; tout < 0x100000; tout++) @@ -226,7 +226,7 @@ static rt_err_t lpc17xx_emac_init(rt_device_t dev) regv = read_PHY (PHY_REG_BMSR); if (regv & 0x0020) { - /* Autonegotiation Complete. */ + /* Auto negotiation Complete. */ break; } } @@ -463,7 +463,7 @@ void lpc17xx_emac_hw_init(void) rt_event_init(&tx_event, "tx_event", RT_IPC_FLAG_FIFO); rt_sem_init(&sem_lock, "eth_lock", 1, RT_IPC_FLAG_FIFO); - /* set autonegotiation mode */ + /* set auto negotiation mode */ lpc17xx_emac_device.phy_mode = EMAC_PHY_AUTO; // OUI 00-60-37 NXP Semiconductors diff --git a/bsp/lpc176x/rtconfig.py b/bsp/lpc176x/rtconfig.py index 11c425ff9..563590ffb 100644 --- a/bsp/lpc176x/rtconfig.py +++ b/bsp/lpc176x/rtconfig.py @@ -1,8 +1,13 @@ +import os + # toolchains options ARCH='arm' CPU='cortex-m3' CROSS_TOOL='keil' +if os.getenv('RTT_CC'): + CROSS_TOOL = os.getenv('RTT_CC') + if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' EXEC_PATH = 'E:/Program Files/CodeSourcery/Sourcery G++ Lite/bin' @@ -12,6 +17,10 @@ elif CROSS_TOOL == 'keil': elif CROSS_TOOL == 'iar': PLATFORM = 'iar' EXEC_PATH = 'E:/Program Files/IAR Systems/Embedded Workbench 6.0/arm/bin' + +if os.getenv('RTT_EXEC_PATH'): + EXEC_PATH = os.getenv('RTT_EXEC_PATH') + BUILD = 'debug' if PLATFORM == 'gcc': diff --git a/bsp/lpc176x/startup.c b/bsp/lpc176x/startup.c index 212c84d46..86aec2349 100644 --- a/bsp/lpc176x/startup.c +++ b/bsp/lpc176x/startup.c @@ -132,9 +132,6 @@ int main(void) /* disable interrupt first */ rt_hw_interrupt_disable(); - /* init system setting */ - SystemInit(); - /* startup RT-Thread RTOS */ rtthread_startup(); -- GitLab