diff --git a/bsp/dev3210/application.c b/bsp/dev3210/application.c index 5791d6eaa18652ae4aceaa22c14f30df08f2bbe7..f5a2caf03c736ecc369e7a1c9cb944cd17565959 100644 --- a/bsp/dev3210/application.c +++ b/bsp/dev3210/application.c @@ -1,7 +1,7 @@ /* - * File : app.c + * File : application.c * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006, RT-Thread Development Team + * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -32,7 +32,7 @@ #include #endif -void rt_init_thread_entry(void* parameter) +void rt_init_thread_entry(void *parameter) { /* Filesystem Initialization */ #ifdef RT_USING_DFS @@ -89,30 +89,31 @@ void rt_init_thread_entry(void* parameter) rect.y1 = 0; rect.x2 = 400; rect.y2 = 480; - rtgui_panel_register("panel", &rect); +// rtgui_panel_register("panel", &rect); /* register main panel */ rect.x1 = 400; rect.y1 = 0; rect.x2 = 800; rect.y2 = 480; - rtgui_panel_register("main", &rect); - rtgui_panel_set_default_focused("main"); +// rtgui_panel_register("main", &rect); +// rtgui_panel_set_default_focused("main"); rt_hw_lcd_init(); } #endif } -int rt_application_init() +int rt_application_init(void) { rt_thread_t tid; /* create initialization thread */ tid = rt_thread_create("init", - rt_init_thread_entry, RT_NULL, - 4096, 8, 20); - if (tid != RT_NULL) rt_thread_startup(tid); + rt_init_thread_entry, RT_NULL, + 4096, 8, 20); + if (tid != RT_NULL) + rt_thread_startup(tid); return 0; } diff --git a/bsp/dev3210/board.c b/bsp/dev3210/board.c index c0f6710f02ce61bf8f74cb2e7a87a57e80631374..ef8d1bf4d70e97c0b5ec62172519d1280b5238be 100644 --- a/bsp/dev3210/board.c +++ b/bsp/dev3210/board.c @@ -1,7 +1,7 @@ /* * File : board.c * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006, RT-Thread Develop Team + * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -22,18 +22,19 @@ /** * @addtogroup Loongson SoC3210 */ + /*@{*/ /** * This is the timer interrupt service routine. */ -void rt_hw_timer_handler() +void rt_hw_timer_handler(void) { - unsigned int count; + unsigned int count; - count = read_c0_compare(); - write_c0_compare(count); - write_c0_count(0); + count = read_c0_compare(); + write_c0_compare(count); + write_c0_count(0); /* increase a OS tick */ rt_tick_increase(); @@ -42,16 +43,16 @@ void rt_hw_timer_handler() /** * This function will initial OS timer */ -void rt_hw_timer_init() +void rt_hw_timer_init(void) { - write_c0_compare(CPU_HZ/2/RT_TICK_PER_SECOND); - write_c0_count(0); + write_c0_compare(CPU_HZ/2/RT_TICK_PER_SECOND); + write_c0_count(0); } /** * This function will initial sam7s64 board. */ -void rt_hw_board_init() +void rt_hw_board_init(void) { #ifdef RT_USING_UART /* init hardware UART device */ @@ -79,7 +80,7 @@ void rt_hw_board_init() #define UARTLSR_PE (1 << 2) #define UARTLSR_OE (1 << 1) #define UARTLSR_DR (1 << 0) -void rt_hw_console_output(const char* ptr) +void rt_hw_console_output(const char *ptr) { /* stream mode */ while (*ptr) diff --git a/bsp/dev3210/lnn800x480.c b/bsp/dev3210/lnn800x480.c index f9c68e002207ad455078d4070230da2eb5957bcd..33a50fff0ed80c631667ef946f3afb7835c81487 100644 --- a/bsp/dev3210/lnn800x480.c +++ b/bsp/dev3210/lnn800x480.c @@ -1,7 +1,7 @@ /* - * File : lcd_800480.c + * File : lnn800x480.c * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2010, RT-Thread Develop Team + * COPYRIGHT (C) 2010 - 2012, RT-Thread Development Team * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -77,10 +77,11 @@ static rt_err_t rt_lcd_control (rt_device_t dev, rt_uint8_t cmd, void *args) return RT_EOK; } -void rt_hw_lcd_init() +void rt_hw_lcd_init(void) { rt_device_t lcd = rt_malloc(sizeof(struct rt_device)); - if (lcd == RT_NULL) return; /* no memory yet */ + if (lcd == RT_NULL) + return; /* no memory yet */ _lcd_info.bits_per_pixel = 16; _lcd_info.pixel_format = RTGRAPHIC_PIXEL_FORMAT_RGB565P; diff --git a/bsp/dev3210/newlib_stub.c b/bsp/dev3210/newlib_stub.c index 0ac10667fcf619a6e23cc7b4a630a270e4fabe49..9dd6e8b95fc863bd4cf71dcf851b511c2917f6dd 100644 --- a/bsp/dev3210/newlib_stub.c +++ b/bsp/dev3210/newlib_stub.c @@ -1,3 +1,16 @@ +/* + * File : newlib_stub.c + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2009 - 2012, RT-Thread Development Team + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rt-thread.org/license/LICENSE + * + * Change Logs: + * Date Author Notes + */ + #include #include @@ -6,14 +19,12 @@ /* some newlib leaked function in CodeSourcery G++ Lite for MIPS version */ -int -getpid() +int getpid(void) { return 0; } -int -gettimeofday(struct timeval *__tp, void *__tzp) +int gettimeofday(struct timeval *__tp, void *__tzp) { struct timespec tp; diff --git a/bsp/dev3210/rtconfig.py b/bsp/dev3210/rtconfig.py index a2e0082144860d56c1bedf8b80a54677a51f91f5..be8f92edaef91fbe76fdc1ca928193fe0c63c65f 100644 --- a/bsp/dev3210/rtconfig.py +++ b/bsp/dev3210/rtconfig.py @@ -12,7 +12,7 @@ if os.getenv('RTT_CC'): if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' - EXEC_PATH = 'E:/Program Files/CodeSourcery/Sourcery G++ Lite/bin' + EXEC_PATH = 'C:/Program Files/CodeSourcery/Sourcery_CodeBench_Lite_for_MIPS_ELF/bin' elif CROSS_TOOL == 'keil': print '================ERROR============================' print 'Not support keil yet!' diff --git a/bsp/dev3210/startup.c b/bsp/dev3210/startup.c index 5312814582fe68da1e3558a274fe899307df5fb4..fe679f468ab5d72ed884c05d916c525f028f600d 100644 --- a/bsp/dev3210/startup.c +++ b/bsp/dev3210/startup.c @@ -1,7 +1,7 @@ /* * File : startup.c * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006, RT-Thread Develop Team + * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at diff --git a/bsp/dev3210/uart.c b/bsp/dev3210/uart.c index 22c2486e98302039909e21b5422c5e9df023c26f..53451eb0c60a7a12e72eeee2a9f4bd2976c3a766 100644 --- a/bsp/dev3210/uart.c +++ b/bsp/dev3210/uart.c @@ -1,3 +1,16 @@ +/* + * File : uart.c + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2009 - 2012, RT-Thread Development Team + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rt-thread.org/license/LICENSE + * + * Change Logs: + * Date Author Notes + */ + #include #include @@ -50,9 +63,9 @@ static void rt_uart_irqhandler(int irqno) { rt_ubase_t level; rt_uint8_t isr; - struct rt_uart_soc3210* uart = &uart_device; + struct rt_uart_soc3210* uart = &uart_device; - /* read interrupt status and clear it */ + /* read interrupt status and clear it */ isr = UART_IIR(uart->hw_base); isr = (isr >> 1) & 0x3; @@ -71,7 +84,7 @@ static void rt_uart_irqhandler(int irqno) } /* invoke callback */ - if(uart->parent.rx_indicate != RT_NULL) + if (uart->parent.rx_indicate != RT_NULL) { rt_size_t length; if (uart->read_index > uart->save_index) @@ -149,10 +162,10 @@ static rt_err_t rt_uart_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_uart_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_size_t rt_uart_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { - rt_uint8_t* ptr; - struct rt_uart_soc3210 *uart = (struct rt_uart_soc3210*)dev; + rt_uint8_t *ptr; + struct rt_uart_soc3210 *uart = (struct rt_uart_soc3210 *)dev; RT_ASSERT(uart != RT_NULL); @@ -197,14 +210,14 @@ static rt_size_t rt_uart_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_si return 0; } -static rt_size_t rt_uart_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_size_t rt_uart_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { char *ptr; - struct rt_uart_soc3210 *uart = (struct rt_uart_soc3210*)dev; + struct rt_uart_soc3210 *uart = (struct rt_uart_soc3210 *)dev; RT_ASSERT(uart != RT_NULL); - ptr = (char*)buffer; + ptr = (char *)buffer; if (dev->flag & RT_DEVICE_FLAG_STREAM) { @@ -230,7 +243,7 @@ static rt_size_t rt_uart_write(rt_device_t dev, rt_off_t pos, const void* buffer } else { - while ( size != 0 ) + while (size != 0) { /* FIFO status, contain valid data */ while (!(UART_LSR(uart->hw_base) & (UARTLSR_TE | UARTLSR_TFE))); @@ -248,7 +261,7 @@ static rt_size_t rt_uart_write(rt_device_t dev, rt_off_t pos, const void* buffer void rt_hw_uart_init(void) { - struct rt_uart_soc3210* uart; + struct rt_uart_soc3210 *uart; /* get uart device */ uart = &uart_device; diff --git a/bsp/dev3210/uart.h b/bsp/dev3210/uart.h index 7b4663aa3d92aff506e26c3ef69b9657f994ae04..acbab2c0bda3446f3e7f586dfc11550a44dcf86b 100644 --- a/bsp/dev3210/uart.h +++ b/bsp/dev3210/uart.h @@ -1,3 +1,16 @@ +/* + * File : uart.h + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2009 - 2012, RT-Thread Development Team + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rt-thread.org/license/LICENSE + * + * Change Logs: + * Date Author Notes + */ + #ifndef __UART_H__ #define __UART_H__