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/ls1bdev/drivers/board.c | |
| 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/ls1bdev/drivers/board.c')
| -rw-r--r-- | bsp/ls1bdev/drivers/board.c | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/bsp/ls1bdev/drivers/board.c b/bsp/ls1bdev/drivers/board.c index 92bb2d5146..63a827be09 100644 --- a/bsp/ls1bdev/drivers/board.c +++ b/bsp/ls1bdev/drivers/board.c @@ -19,7 +19,7 @@ /** * @addtogroup Loongson LS1B */ - + /*@{*/ /** @@ -27,14 +27,14 @@ */ 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(); + /* increase a OS tick */ + rt_tick_increase(); } /** @@ -42,8 +42,8 @@ void rt_hw_timer_handler(void) */ 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); } /** @@ -52,47 +52,47 @@ void rt_hw_timer_init(void) void rt_hw_board_init(void) { #ifdef RT_USING_UART - /* init hardware UART device */ - rt_hw_uart_init(); + /* init hardware UART device */ + rt_hw_uart_init(); #endif #ifdef RT_USING_CONSOLE - /* set console device */ - rt_console_set_device("uart0"); + /* set console device */ + rt_console_set_device("uart0"); #endif - /* init operating system timer */ - rt_hw_timer_init(); + /* init operating system timer */ + rt_hw_timer_init(); - rt_kprintf("current sr: 0x%08x\n", read_c0_status()); + rt_kprintf("current sr: 0x%08x\n", read_c0_status()); } #define __raw_out_put(unr) \ - while (*ptr) \ - { \ - if (*ptr == '\n') \ - { \ - /* FIFO status, contain valid data */ \ - while (!(UART_LSR(UART##unr##_BASE) & (UARTLSR_TE | UARTLSR_TFE))); \ - /* write data */ \ - UART_DAT(UART##unr##_BASE) = '\r'; \ - } \ - /* FIFO status, contain valid data */ \ - while (!(UART_LSR(UART##unr##_BASE) & (UARTLSR_TE | UARTLSR_TFE))); \ - /* write data */ \ - UART_DAT(UART##unr##_BASE) = *ptr; \ - ptr ++; \ - } + while (*ptr) \ + { \ + if (*ptr == '\n') \ + { \ + /* FIFO status, contain valid data */ \ + while (!(UART_LSR(UART##unr##_BASE) & (UARTLSR_TE | UARTLSR_TFE))); \ + /* write data */ \ + UART_DAT(UART##unr##_BASE) = '\r'; \ + } \ + /* FIFO status, contain valid data */ \ + while (!(UART_LSR(UART##unr##_BASE) & (UARTLSR_TE | UARTLSR_TFE))); \ + /* write data */ \ + UART_DAT(UART##unr##_BASE) = *ptr; \ + ptr ++; \ + } /* UART line status register value */ -#define UARTLSR_ERROR (1 << 7) -#define UARTLSR_TE (1 << 6) -#define UARTLSR_TFE (1 << 5) -#define UARTLSR_BI (1 << 4) -#define UARTLSR_FE (1 << 3) -#define UARTLSR_PE (1 << 2) -#define UARTLSR_OE (1 << 1) -#define UARTLSR_DR (1 << 0) +#define UARTLSR_ERROR (1 << 7) +#define UARTLSR_TE (1 << 6) +#define UARTLSR_TFE (1 << 5) +#define UARTLSR_BI (1 << 4) +#define UARTLSR_FE (1 << 3) +#define UARTLSR_PE (1 << 2) +#define UARTLSR_OE (1 << 1) +#define UARTLSR_DR (1 << 0) void rt_hw_console_output(const char *ptr) { #if defined(RT_USING_UART0) |
