diff options
| author | Bernard Xiong <[email protected]> | 2021-05-28 16:20:08 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-05-28 16:20:08 +0800 |
| commit | 92beddf3bccf6346e26aa097f82464456fb8e6bd (patch) | |
| tree | 197e4a108118dda016ea02274172f0c40e7ee8ed /bsp/lm3s8962 | |
| parent | b18a99b44240ec3152011e159cc24a5af8dff0ce (diff) | |
| parent | 03f4d40e30f3c94e1db0b3a65b3610dee695694a (diff) | |
Merge pull request #4737 from mysterywolf/3,1,xformatv3.1.5
[lts 3.1.x] format codes
Diffstat (limited to 'bsp/lm3s8962')
| -rw-r--r-- | bsp/lm3s8962/applications/application.c | 52 | ||||
| -rw-r--r-- | bsp/lm3s8962/applications/startup.c | 92 | ||||
| -rw-r--r-- | bsp/lm3s8962/drivers/board.c | 82 | ||||
| -rw-r--r-- | bsp/lm3s8962/drivers/board.h | 4 | ||||
| -rw-r--r-- | bsp/lm3s8962/drivers/serial.c | 352 | ||||
| -rw-r--r-- | bsp/lm3s8962/rtconfig.h | 38 |
6 files changed, 310 insertions, 310 deletions
diff --git a/bsp/lm3s8962/applications/application.c b/bsp/lm3s8962/applications/application.c index 97b8c67dba..504962eb66 100644 --- a/bsp/lm3s8962/applications/application.c +++ b/bsp/lm3s8962/applications/application.c @@ -33,45 +33,45 @@ void rt_init_thread_entry(void *parameter) { /* Filesystem Initialization */ #ifdef RT_USING_DFS - { - /* init the device filesystem */ - dfs_init(); + { + /* init the device filesystem */ + dfs_init(); #ifdef RT_USING_DFS_ELMFAT - /* init the elm chan FatFs filesystam*/ - elm_init(); + /* init the elm chan FatFs filesystam*/ + elm_init(); - /* mount sd card fat partition 1 as root directory */ - if (dfs_mount("sd0", "/", "elm", 0, 0) == 0) - { - rt_kprintf("File System initialized!\n"); - } - else - rt_kprintf("File System initialzation failed!\n"); + /* mount sd card fat partition 1 as root directory */ + if (dfs_mount("sd0", "/", "elm", 0, 0) == 0) + { + rt_kprintf("File System initialized!\n"); + } + else + rt_kprintf("File System initialzation failed!\n"); #endif - } + } #endif /* LwIP Initialization */ #ifdef RT_USING_LWIP - { - extern void lwip_sys_init(void); - - /* init lwip system */ - lwip_sys_init(); - rt_kprintf("TCP/IP initialized!\n"); - } + { + extern void lwip_sys_init(void); + + /* init lwip system */ + lwip_sys_init(); + rt_kprintf("TCP/IP initialized!\n"); + } #endif } int rt_application_init() { - rt_thread_t init_thread; + rt_thread_t init_thread; - init_thread = rt_thread_create("init", - rt_init_thread_entry, RT_NULL, - 1024, 21, 20); - rt_thread_startup(init_thread); + init_thread = rt_thread_create("init", + rt_init_thread_entry, RT_NULL, + 1024, 21, 20); + rt_thread_startup(init_thread); - return 0; + return 0; } /*@}*/ diff --git a/bsp/lm3s8962/applications/startup.c b/bsp/lm3s8962/applications/startup.c index d598ee8fc7..45f510a2aa 100644 --- a/bsp/lm3s8962/applications/startup.c +++ b/bsp/lm3s8962/applications/startup.c @@ -58,11 +58,11 @@ extern int __bss_end; *******************************************************************************/ void assert_failed(u8* file, u32 line) { - rt_kprintf("\n\r Wrong parameter value detected on\r\n"); - rt_kprintf(" file %s\r\n", file); - rt_kprintf(" line %d\r\n", line); + rt_kprintf("\n\r Wrong parameter value detected on\r\n"); + rt_kprintf(" file %s\r\n", file); + rt_kprintf(" line %d\r\n", line); - while (1) ; + while (1) ; } #endif @@ -71,82 +71,82 @@ void assert_failed(u8* file, u32 line) */ void rtthread_startup(void) { - /* init board */ - rt_hw_board_init(); + /* init board */ + rt_hw_board_init(); - /* show version */ - rt_show_version(); + /* show version */ + rt_show_version(); - /* init tick */ - rt_system_tick_init(); + /* init tick */ + rt_system_tick_init(); - /* init kernel object */ - rt_system_object_init(); + /* init kernel object */ + rt_system_object_init(); - /* init timer system */ - rt_system_timer_init(); + /* init timer system */ + rt_system_timer_init(); #ifdef RT_USING_HEAP #ifdef __CC_ARM - rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)LM3S_SRAM_END); + rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)LM3S_SRAM_END); #elif __ICCARM__ - rt_system_heap_init(__segment_end("HEAP"), (void*)LM3S_SRAM_END); + rt_system_heap_init(__segment_end("HEAP"), (void*)LM3S_SRAM_END); #else - /* init memory system */ - rt_system_heap_init((void*)&__bss_end, (void*)LM3S_SRAM_END); + /* init memory system */ + rt_system_heap_init((void*)&__bss_end, (void*)LM3S_SRAM_END); #endif #endif -#ifdef RT_USING_MODULE - /* init module system */ - rt_system_module_init(); +#ifdef RT_USING_MODULE + /* init module system */ + rt_system_module_init(); #endif - /* init scheduler system */ - rt_system_scheduler_init(); + /* init scheduler system */ + rt_system_scheduler_init(); #ifdef RT_USING_LWIP - eth_system_device_init(); + eth_system_device_init(); - /* register ethernetif device */ - rt_hw_luminaryif_init(); + /* register ethernetif device */ + rt_hw_luminaryif_init(); #endif - /* init hardware serial device */ - rt_hw_serial_init(); + /* init hardware serial device */ + rt_hw_serial_init(); #ifdef RT_USING_DFS - /* init sd card device */ - rt_hw_sdcard_init(); + /* init sd card device */ + rt_hw_sdcard_init(); #endif - /* init application */ - rt_application_init(); + /* init application */ + rt_application_init(); #ifdef RT_USING_FINSH - /* init finsh */ - finsh_system_init(); + /* init finsh */ + finsh_system_init(); #ifdef RT_USING_DEVICE - finsh_set_device("uart1"); + finsh_set_device("uart1"); #endif #endif - /* init idle thread */ - rt_thread_idle_init(); + /* init idle thread */ + rt_thread_idle_init(); - /* start scheduler */ - rt_system_scheduler_start(); + /* start scheduler */ + rt_system_scheduler_start(); - /* never reach here */ - return ; + /* never reach here */ + return ; } int main(void) { - /* disable interrupt first */ - rt_hw_interrupt_disable(); - rtthread_startup(); - - return 0; + /* disable interrupt first */ + rt_hw_interrupt_disable(); + rtthread_startup(); + + return 0; } /*@}*/ diff --git a/bsp/lm3s8962/drivers/board.c b/bsp/lm3s8962/drivers/board.c index f7a75b0809..ca7e7d7818 100644 --- a/bsp/lm3s8962/drivers/board.c +++ b/bsp/lm3s8962/drivers/board.c @@ -37,23 +37,23 @@ static void rt_hw_console_init(void); extern void rt_hw_interrupt_thread_switch(void); /** * This is the timer interrupt service routine. - * + * */ void rt_hw_timer_handler(void) { - /* enter interrupt */ - rt_interrupt_enter(); + /* enter interrupt */ + rt_interrupt_enter(); + + rt_tick_increase(); - rt_tick_increase(); - - /* leave interrupt */ - rt_interrupt_leave(); - rt_hw_interrupt_thread_switch(); + /* leave interrupt */ + rt_interrupt_leave(); + rt_hw_interrupt_thread_switch(); } /** * This is the ethernet interrupt service routine. - * + * */ void rt_hw_eth_handler(void) { @@ -76,51 +76,51 @@ void rt_hw_eth_handler(void) */ void rt_hw_board_init() { - /* set ldo */ - SysCtlLDOSet(SYSCTL_LDO_2_50V); - /* set clock */ - SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | + /* set ldo */ + SysCtlLDOSet(SYSCTL_LDO_2_50V); + /* set clock */ + SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | LM3S_XTAL_TYPE); - /* init systick */ - SysTickDisable(); - SysTickPeriodSet(SysCtlClockGet()/RT_TICK_PER_SECOND); - SysTickIntEnable(); - SysTickEnable(); + /* init systick */ + SysTickDisable(); + SysTickPeriodSet(SysCtlClockGet()/RT_TICK_PER_SECOND); + SysTickIntEnable(); + SysTickEnable(); + + /* enable ssio */ + SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0); - /* enable ssio */ - SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0); - - /* init console */ - rt_hw_console_init(); + /* init console */ + rt_hw_console_init(); - /* enable interrupt */ - IntMasterEnable(); + /* enable interrupt */ + IntMasterEnable(); } /* init console to support rt_kprintf */ static void rt_hw_console_init() { - /* Enable the UART0 peripherals */ - SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); - SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); + /* Enable the UART0 peripherals */ + SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); + SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); - /* Set GPIO A0 and A1 as UART pins. */ - GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); + /* Set GPIO A0 and A1 as UART pins. */ + GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); - /* Configure the UART for 115,200, 8-N-1 operation. */ - UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200, - (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | - UART_CONFIG_PAR_NONE)); + /* Configure the UART for 115,200, 8-N-1 operation. */ + UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200, + (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | + UART_CONFIG_PAR_NONE)); } /* write one character to serial, must not trigger interrupt */ static void rt_hw_console_putc(const char c) { - if (c == '\n') - while(UARTCharPutNonBlocking(UART0_BASE, '\r') == false); + if (c == '\n') + while(UARTCharPutNonBlocking(UART0_BASE, '\r') == false); - while(UARTCharPutNonBlocking(UART0_BASE, c) == false); + while(UARTCharPutNonBlocking(UART0_BASE, c) == false); } /** @@ -130,10 +130,10 @@ static void rt_hw_console_putc(const char c) */ void rt_hw_console_output(const char* str) { - while (*str) - { - rt_hw_console_putc (*str++); - } + while (*str) + { + rt_hw_console_putc (*str++); + } } /*@}*/ diff --git a/bsp/lm3s8962/drivers/board.h b/bsp/lm3s8962/drivers/board.h index f33af86d26..9b01d613e4 100644 --- a/bsp/lm3s8962/drivers/board.h +++ b/bsp/lm3s8962/drivers/board.h @@ -18,12 +18,12 @@ #define __BOARD_H__ // <o> Internal SRAM memory size[Kbytes] <8-64> -// <i>Default: 64 +// <i>Default: 64 #define LM3S_SRAM_SIZE 64 #define LM3S_SRAM_END (0x20000000 + LM3S_SRAM_SIZE * 1024) // For lm3s8962, it should be SYSCTL_XTAL_8MHZ -#define LM3S_XTAL_TYPE SYSCTL_XTAL_8MHZ +#define LM3S_XTAL_TYPE SYSCTL_XTAL_8MHZ void rt_hw_board_led_on(int n); void rt_hw_board_led_off(int n); diff --git a/bsp/lm3s8962/drivers/serial.c b/bsp/lm3s8962/drivers/serial.c index 0df347cf4b..b283600ecf 100644 --- a/bsp/lm3s8962/drivers/serial.c +++ b/bsp/lm3s8962/drivers/serial.c @@ -29,15 +29,15 @@ extern void rt_hw_interrupt_thread_switch(void); /* LM3S serial device */ struct rt_lm3s_serial { - /* inherit from device */ - struct rt_device parent; + /* inherit from device */ + struct rt_device parent; - rt_uint32_t hw_base; - rt_uint32_t baudrate; + rt_uint32_t hw_base; + rt_uint32_t baudrate; - /* reception field */ - rt_uint16_t save_index, read_index; - rt_uint8_t rx_buffer[RT_UART_RX_BUFFER_SIZE]; + /* reception field */ + rt_uint16_t save_index, read_index; + rt_uint8_t rx_buffer[RT_UART_RX_BUFFER_SIZE]; }; #ifdef RT_USING_UART1 @@ -63,72 +63,72 @@ void rt_hw_uart_isr(struct rt_lm3s_serial* serial) if (device->flag & RT_DEVICE_FLAG_INT_RX) { char ch; - rt_base_t level; + rt_base_t level; while (UARTCharsAvail(serial->hw_base)) { ch = UARTCharGetNonBlocking(serial->hw_base); /* disable interrupt */ - level = rt_hw_interrupt_disable(); + level = rt_hw_interrupt_disable(); - /* read character */ - serial->rx_buffer[serial->save_index] = ch; - serial->save_index ++; - if (serial->save_index >= RT_UART_RX_BUFFER_SIZE) - serial->save_index = 0; + /* read character */ + serial->rx_buffer[serial->save_index] = ch; + serial->save_index ++; + if (serial->save_index >= RT_UART_RX_BUFFER_SIZE) + serial->save_index = 0; - /* if the next position is read index, discard this 'read char' */ - if (serial->save_index == serial->read_index) - { - serial->read_index ++; - if (serial->read_index >= RT_UART_RX_BUFFER_SIZE) - serial->read_index = 0; - } + /* if the next position is read index, discard this 'read char' */ + if (serial->save_index == serial->read_index) + { + serial->read_index ++; + if (serial->read_index >= RT_UART_RX_BUFFER_SIZE) + serial->read_index = 0; + } - /* enable interrupt */ - rt_hw_interrupt_enable(level); + /* enable interrupt */ + rt_hw_interrupt_enable(level); } - /* invoke callback */ - if(device->rx_indicate != RT_NULL) - { - rt_int32_t length; + /* invoke callback */ + if(device->rx_indicate != RT_NULL) + { + rt_int32_t length; - length = serial->save_index - serial->read_index; - if (length < 0) length += RT_UART_RX_BUFFER_SIZE; + length = serial->save_index - serial->read_index; + if (length < 0) length += RT_UART_RX_BUFFER_SIZE; device->rx_indicate(device, length); - } + } } } #ifdef RT_USING_UART1 void rt_hw_uart_isr_1(int irqno) { - /* enter interrupt */ - rt_interrupt_enter(); + /* enter interrupt */ + rt_interrupt_enter(); - /* get serial device */ - rt_hw_uart_isr(&serial1); + /* get serial device */ + rt_hw_uart_isr(&serial1); - /* leave interrupt */ - rt_interrupt_leave(); - rt_hw_interrupt_thread_switch(); + /* leave interrupt */ + rt_interrupt_leave(); + rt_hw_interrupt_thread_switch(); } #endif #ifdef RT_USING_UART2 void rt_hw_uart_isr_2(int irqno) { - /* enter interrupt */ - rt_interrupt_enter(); + /* enter interrupt */ + rt_interrupt_enter(); - /* get serial device */ - rt_hw_uart_isr(&serial2); + /* get serial device */ + rt_hw_uart_isr(&serial2); - /* leave interrupt */ - rt_interrupt_leave(); - rt_hw_interrupt_thread_switch(); + /* leave interrupt */ + rt_interrupt_leave(); + rt_hw_interrupt_thread_switch(); } #endif @@ -139,15 +139,15 @@ void rt_hw_uart_isr_2(int irqno) static rt_err_t rt_serial_init (rt_device_t dev) { - return RT_EOK; + return RT_EOK; } static rt_err_t rt_serial_open(rt_device_t dev, rt_uint16_t oflag) { - struct rt_lm3s_serial* serial; - serial = (struct rt_lm3s_serial*) dev; + struct rt_lm3s_serial* serial; + serial = (struct rt_lm3s_serial*) dev; - RT_ASSERT(serial != RT_NULL); + RT_ASSERT(serial != RT_NULL); if (dev->flag & RT_DEVICE_FLAG_INT_RX) { @@ -160,198 +160,198 @@ static rt_err_t rt_serial_open(rt_device_t dev, rt_uint16_t oflag) UARTIntEnable(serial->hw_base, UART_INT_RX | UART_INT_RT); } - return RT_EOK; + return RT_EOK; } static rt_err_t rt_serial_close(rt_device_t dev) { - struct rt_lm3s_serial* serial; - serial = (struct rt_lm3s_serial*) dev; + struct rt_lm3s_serial* serial; + serial = (struct rt_lm3s_serial*) dev; - RT_ASSERT(serial != RT_NULL); + RT_ASSERT(serial != RT_NULL); - if (dev->flag & RT_DEVICE_FLAG_INT_RX) - { - /* disable UART rx interrupt */ - UARTIntDisable(serial->hw_base, UART_INT_RX | UART_INT_RT); - } + if (dev->flag & RT_DEVICE_FLAG_INT_RX) + { + /* disable UART rx interrupt */ + UARTIntDisable(serial->hw_base, UART_INT_RX | UART_INT_RT); + } - return RT_EOK; + return RT_EOK; } static rt_err_t rt_serial_control(rt_device_t dev, int cmd, void *args) { - return RT_EOK; + return RT_EOK; } static rt_size_t rt_serial_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { - rt_uint8_t* ptr; - struct rt_lm3s_serial *serial = (struct rt_lm3s_serial*)dev; - RT_ASSERT(serial != RT_NULL); + rt_uint8_t* ptr; + struct rt_lm3s_serial *serial = (struct rt_lm3s_serial*)dev; + RT_ASSERT(serial != RT_NULL); - /* point to buffer */ - ptr = (rt_uint8_t*) buffer; + /* point to buffer */ + ptr = (rt_uint8_t*) buffer; - if (dev->flag & RT_DEVICE_FLAG_INT_RX) - { - while (size) - { - /* interrupt receive */ - rt_base_t level; + if (dev->flag & RT_DEVICE_FLAG_INT_RX) + { + while (size) + { + /* interrupt receive */ + rt_base_t level; - /* disable interrupt */ - level = rt_hw_interrupt_disable(); - if (serial->read_index != serial->save_index) - { - *ptr = serial->rx_buffer[serial->read_index]; + /* disable interrupt */ + level = rt_hw_interrupt_disable(); + if (serial->read_index != serial->save_index) + { + *ptr = serial->rx_buffer[serial->read_index]; - serial->read_index ++; - if (serial->read_index >= RT_UART_RX_BUFFER_SIZE) - serial->read_index = 0; - } - else - { - /* no data in rx buffer */ + serial->read_index ++; + if (serial->read_index >= RT_UART_RX_BUFFER_SIZE) + serial->read_index = 0; + } + else + { + /* no data in rx buffer */ - /* enable interrupt */ - rt_hw_interrupt_enable(level); - break; - } + /* enable interrupt */ + rt_hw_interrupt_enable(level); + break; + } - /* enable interrupt */ - rt_hw_interrupt_enable(level); + /* enable interrupt */ + rt_hw_interrupt_enable(level); - ptr ++; size --; - } + ptr ++; size --; + } - return (rt_uint32_t)ptr - (rt_uint32_t)buffer; - } - else if (dev->flag & RT_DEVICE_FLAG_DMA_RX) - { - /* not support right now */ - RT_ASSERT(0); - } + return (rt_uint32_t)ptr - (rt_uint32_t)buffer; + } + else if (dev->flag & RT_DEVICE_FLAG_DMA_RX) + { + /* not support right now */ + RT_ASSERT(0); + } - /* polling mode */ - while (size) - { - *ptr = UARTCharGetNonBlocking(serial->hw_base); + /* polling mode */ + while (size) + { + *ptr = UARTCharGetNonBlocking(serial->hw_base); - ptr ++; size --; - } + ptr ++; size --; + } - return (rt_size_t)ptr - (rt_size_t)buffer; + return (rt_size_t)ptr - (rt_size_t)buffer; } static rt_size_t rt_serial_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { - struct rt_lm3s_serial* serial; - char *ptr; + struct rt_lm3s_serial* serial; + char *ptr; - serial = (struct rt_lm3s_serial*) dev; - if (dev->flag & RT_DEVICE_FLAG_INT_TX) - { - /* not support */ - RT_ASSERT(0); - } - else if (dev->flag & RT_DEVICE_FLAG_DMA_TX) - { - /* not support */ - RT_ASSERT(0); - } + serial = (struct rt_lm3s_serial*) dev; + if (dev->flag & RT_DEVICE_FLAG_INT_TX) + { + /* not support */ + RT_ASSERT(0); + } + else if (dev->flag & RT_DEVICE_FLAG_DMA_TX) + { + /* not support */ + RT_ASSERT(0); + } - /* polling write */ - ptr = (char *)buffer; + /* polling write */ + ptr = (char *)buffer; - if (dev->flag & RT_DEVICE_FLAG_STREAM) - { - /* stream mode */ - while (size) - { - if (*ptr == '\n') - while (UARTCharPutNonBlocking(serial->hw_base, '\r') == false); + if (dev->flag & RT_DEVICE_FLAG_STREAM) + { + /* stream mode */ + while (size) + { + if (*ptr == '\n') + while (UARTCharPutNonBlocking(serial->hw_base, '\r') == false); - while (UARTCharPutNonBlocking(serial->hw_base, *ptr) == false); + while (UARTCharPutNonBlocking(serial->hw_base, *ptr) == false); - ptr ++; - size --; - } - } - else - { - while (size) - { - while (UARTCharPutNonBlocking(serial->hw_base, *ptr) == false); + ptr ++; + size --; + } + } + else + { + while (size) + { + while (UARTCharPutNonBlocking(serial->hw_base, *ptr) == false); - ptr ++; - size --; - } - } + ptr ++; + size --; + } + } - return (rt_size_t) ptr - (rt_size_t) buffer; + return (rt_size_t) ptr - (rt_size_t) buffer; } void rt_hw_serial_init(void) { - struct rt_lm3s_serial* serial; + struct rt_lm3s_serial* serial; #ifdef RT_USING_UART1 - serial = &serial1; + serial = &serial1; - serial->parent.type = RT_Device_Class_Char; + serial->parent.type = RT_Device_Class_Char; - serial->hw_base = UART0_BASE; - serial->baudrate = 115200; + serial->hw_base = UART0_BASE; + serial->baudrate = 115200; - rt_memset(serial->rx_buffer, 0, sizeof(serial->rx_buffer)); - serial->read_index = serial->save_index = 0; + rt_memset(serial->rx_buffer, 0, sizeof(serial->rx_buffer)); + serial->read_index = serial->save_index = 0; - /* enable UART0 clock */ + /* enable UART0 clock */ SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); - /* set UART0 pinmux */ + /* set UART0 pinmux */ GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); - /* Configure the UART for 115,200, 8-N-1 operation. */ - UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), serial->baudrate, + /* Configure the UART for 115,200, 8-N-1 operation. */ + UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), serial->baudrate, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); - serial->parent.init = rt_serial_init; - serial->parent.open = rt_serial_open; - serial->parent.close = rt_serial_close; - serial->parent.read = rt_serial_read; - serial->parent.write = rt_serial_write; - serial->parent.control = rt_serial_control; - serial->parent.user_data = RT_NULL; + serial->parent.init = rt_serial_init; + serial->parent.open = rt_serial_open; + serial->parent.close = rt_serial_close; + serial->parent.read = rt_serial_read; + serial->parent.write = rt_serial_write; + serial->parent.control = rt_serial_control; + serial->parent.user_data = RT_NULL; - rt_device_register(&serial->parent, - "uart1", RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX); + rt_device_register(&serial->parent, + "uart1", RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX); #endif #ifdef RT_USING_UART2 - serial = &serial2; + serial = &serial2; - serial->parent.type = RT_Device_Class_Char; + serial->parent.type = RT_Device_Class_Char; - serial->hw_base = 0xE0010000; - serial->baudrate = 115200; + serial->hw_base = 0xE0010000; + serial->baudrate = 115200; - rt_memset(serial->rx_buffer, 0, sizeof(serial->rx_buffer)); - serial->read_index = serial->save_index = 0; + rt_memset(serial->rx_buffer, 0, sizeof(serial->rx_buffer)); + serial->read_index = serial->save_index = 0; - serial->parent.init = rt_serial_init; - serial->parent.open = rt_serial_open; - serial->parent.close = rt_serial_close; - serial->parent.read = rt_serial_read; - serial->parent.write = rt_serial_write; - serial->parent.control = rt_serial_control; - serial->parent.user_data = RT_NULL; + serial->parent.init = rt_serial_init; + serial->parent.open = rt_serial_open; + serial->parent.close = rt_serial_close; + serial->parent.read = rt_serial_read; + serial->parent.write = rt_serial_write; + serial->parent.control = rt_serial_control; + serial->parent.user_data = RT_NULL; - rt_device_register(&serial->parent, - "uart2", RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX); + rt_device_register(&serial->parent, + "uart2", RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX); #endif } diff --git a/bsp/lm3s8962/rtconfig.h b/bsp/lm3s8962/rtconfig.h index b154688a6d..a3f054b1c6 100644 --- a/bsp/lm3s8962/rtconfig.h +++ b/bsp/lm3s8962/rtconfig.h @@ -3,16 +3,16 @@ #define __RTTHREAD_CFG_H__ /* RT_NAME_MAX*/ -#define RT_NAME_MAX 8 +#define RT_NAME_MAX 8 /* RT_ALIGN_SIZE*/ -#define RT_ALIGN_SIZE 4 +#define RT_ALIGN_SIZE 4 /* PRIORITY_MAX*/ -#define RT_THREAD_PRIORITY_MAX 32 +#define RT_THREAD_PRIORITY_MAX 32 /* Tick per Second*/ -#define RT_TICK_PER_SECOND 100 +#define RT_TICK_PER_SECOND 100 /* SECTION: RT_DEBUG */ /* Thread Debug*/ @@ -66,7 +66,7 @@ /* SECTION: Console options */ #define RT_USING_CONSOLE /* the buffer size of console*/ -#define RT_CONSOLEBUF_SIZE 128 +#define RT_CONSOLEBUF_SIZE 128 /* SECTION: FinSH shell options */ /* Using FinSH as Shell*/ @@ -81,11 +81,11 @@ #define RT_DFS_ELM_WORD_ACCESS /* the max number of mounted filesystem */ -#define DFS_FILESYSTEMS_MAX 1 -/* the max number of opened files */ -#define DFS_FD_MAX 4 -/* the max number of cached sector */ -#define DFS_CACHE_MAX_NUM 4 +#define DFS_FILESYSTEMS_MAX 1 +/* the max number of opened files */ +#define DFS_FD_MAX 4 +/* the max number of cached sector */ +#define DFS_CACHE_MAX_NUM 4 /* SECTION: lwip, a lighwight TCP/IP protocol stack */ /* Using lighweight TCP/IP protocol stack*/ @@ -107,13 +107,13 @@ #define RT_LWIP_TCP /* the number of simulatenously active TCP connections*/ -#define RT_LWIP_TCP_PCB_NUM 5 +#define RT_LWIP_TCP_PCB_NUM 5 /* Ethernet padding size */ #define RT_LWIP_ETH_PAD_SIZE 2 /* TCP sender buffer space*/ -#define RT_LWIP_TCP_SND_BUF 1024*8 +#define RT_LWIP_TCP_SND_BUF 1024*8 /* Enable SNMP protocol*/ #define RT_LWIP_SNMP @@ -132,17 +132,17 @@ #define RT_LWIP_MSKADDR "255.255.255.0" /* tcp thread options */ -#define RT_LWIP_TCPTHREAD_PRIORITY 22 -#define RT_LWIP_TCPTHREAD_MBOX_SIZE 4 -#define RT_LWIP_TCPTHREAD_STACKSIZE 1024 +#define RT_LWIP_TCPTHREAD_PRIORITY 22 +#define RT_LWIP_TCPTHREAD_MBOX_SIZE 4 +#define RT_LWIP_TCPTHREAD_STACKSIZE 1024 /* ethernet if thread options */ -#define RT_LWIP_ETHTHREAD_PRIORITY 23 -#define RT_LWIP_ETHTHREAD_MBOX_SIZE 4 -#define RT_LWIP_ETHTHREAD_STACKSIZE 512 +#define RT_LWIP_ETHTHREAD_PRIORITY 23 +#define RT_LWIP_ETHTHREAD_MBOX_SIZE 4 +#define RT_LWIP_ETHTHREAD_STACKSIZE 512 /* the size of each pbuf in the pbuf pool. */ -#define RT_LWIP_PBUF_POOL_BUFSIZE 1500 +#define RT_LWIP_PBUF_POOL_BUFSIZE 1500 #define RT_USING_LIBC #define RT_USING_LWIP141 |
