summaryrefslogtreecommitdiff
path: root/bsp/nuvoton_m451/drivers
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2021-05-28 16:20:08 +0800
committerGitHub <[email protected]>2021-05-28 16:20:08 +0800
commit92beddf3bccf6346e26aa097f82464456fb8e6bd (patch)
tree197e4a108118dda016ea02274172f0c40e7ee8ed /bsp/nuvoton_m451/drivers
parentb18a99b44240ec3152011e159cc24a5af8dff0ce (diff)
parent03f4d40e30f3c94e1db0b3a65b3610dee695694a (diff)
Merge pull request #4737 from mysterywolf/3,1,xformatv3.1.5
[lts 3.1.x] format codes
Diffstat (limited to 'bsp/nuvoton_m451/drivers')
-rw-r--r--bsp/nuvoton_m451/drivers/board.c40
-rw-r--r--bsp/nuvoton_m451/drivers/board.h2
-rw-r--r--bsp/nuvoton_m451/drivers/led.h2
-rw-r--r--bsp/nuvoton_m451/drivers/usart.c10
4 files changed, 27 insertions, 27 deletions
diff --git a/bsp/nuvoton_m451/drivers/board.c b/bsp/nuvoton_m451/drivers/board.c
index 39dbd04c62..9ab8d97b27 100644
--- a/bsp/nuvoton_m451/drivers/board.c
+++ b/bsp/nuvoton_m451/drivers/board.c
@@ -38,11 +38,11 @@ void NVIC_Configuration(void)
*/
static void delay(__IO uint32_t nCount)
{
- /* Decrement nCount value */
- while (nCount != 0)
- {
- nCount--;
- }
+ /* Decrement nCount value */
+ while (nCount != 0)
+ {
+ nCount--;
+ }
}
static void rt_hw_system_init(void)
@@ -52,7 +52,7 @@ static void rt_hw_system_init(void)
/*---------------------------------------------------------------------------------------------------------*/
/* Unlock protected registers */
SYS_UnlockReg();
-
+
/* Enable HIRC clock (Internal RC 22.1184MHz) */
CLK_EnableXtalRC(CLK_PWRCTL_HIRCEN_Msk);
@@ -73,7 +73,7 @@ static void rt_hw_system_init(void)
/* Set SysTick clock source to HCLK source divide 2 */
CLK_SetSysTickClockSrc(CLK_CLKSEL0_STCLKSEL_HCLK_DIV2);
-
+
/* Lock protected registers */
SYS_LockReg();
}
@@ -84,34 +84,34 @@ static void rt_hw_system_init(void)
*/
void SysTick_Handler(void)
{
- /* enter interrupt */
- rt_interrupt_enter();
+ /* enter interrupt */
+ rt_interrupt_enter();
- rt_tick_increase();
+ rt_tick_increase();
- /* leave interrupt */
- rt_interrupt_leave();
+ /* leave interrupt */
+ rt_interrupt_leave();
}
/**
* This function will initial Nuvoton board.
*/
void rt_hw_board_init()
{
- /* NVIC Configuration */
- NVIC_Configuration();
+ /* NVIC Configuration */
+ NVIC_Configuration();
/* Configure the system clock */
rt_hw_system_init();
- /* Configure the SysTick */
- SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);
+ /* Configure the SysTick */
+ SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);
- /* Initial usart deriver, and set console device */
- rt_hw_usart_init();
+ /* Initial usart deriver, and set console device */
+ rt_hw_usart_init();
#ifdef RT_USING_CONSOLE
- rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
+ rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
#endif
- /* Call components board initial (use INIT_BOARD_EXPORT()) */
+ /* Call components board initial (use INIT_BOARD_EXPORT()) */
#ifdef RT_USING_COMPONENTS_INIT
rt_components_board_init();
#endif
diff --git a/bsp/nuvoton_m451/drivers/board.h b/bsp/nuvoton_m451/drivers/board.h
index 3aba14d32e..93588253c0 100644
--- a/bsp/nuvoton_m451/drivers/board.h
+++ b/bsp/nuvoton_m451/drivers/board.h
@@ -18,7 +18,7 @@
/* board configuration */
// <o> Internal SRAM memory size[Kbytes]
-// <i>Default: 64
+// <i>Default: 64
#define M451_SRAM_SIZE 32
#define M451_SRAM_END (0x20000000 + M451_SRAM_SIZE * 1024)
diff --git a/bsp/nuvoton_m451/drivers/led.h b/bsp/nuvoton_m451/drivers/led.h
index e4c1eb7ce9..730e82c0c6 100644
--- a/bsp/nuvoton_m451/drivers/led.h
+++ b/bsp/nuvoton_m451/drivers/led.h
@@ -15,7 +15,7 @@
#include <rtthread.h>
#include "M451Series.h"
-void rt_hw_led_on(void);
+void rt_hw_led_on(void);
void rt_hw_led_off(void);
int rt_hw_led_init(void);
diff --git a/bsp/nuvoton_m451/drivers/usart.c b/bsp/nuvoton_m451/drivers/usart.c
index 1ee0ded403..e0644a4828 100644
--- a/bsp/nuvoton_m451/drivers/usart.c
+++ b/bsp/nuvoton_m451/drivers/usart.c
@@ -20,20 +20,20 @@ static rt_err_t m451_configure(struct rt_serial_device *serial, struct serial_co
if (uart == UART0) {
/* Enable UART module clock */
CLK_EnableModuleClock(UART0_MODULE);
-
+
/* Select UART module clock source as HXT and UART module clock divider as 1 */
CLK_SetModuleClock(UART0_MODULE, CLK_CLKSEL1_UARTSEL_HXT, CLK_CLKDIV0_UART(1));
-
+
/* Set PD multi-function pins for UART0 RXD(PD.0) and TXD(PD.1) */
SYS->GPD_MFPL &= ~(SYS_GPD_MFPL_PD0MFP_Msk | SYS_GPD_MFPL_PD1MFP_Msk);
SYS->GPD_MFPL |= (SYS_GPD_MFPL_PD0MFP_UART0_RXD | SYS_GPD_MFPL_PD1MFP_UART0_TXD);
-
+
/* Reset UART module */
SYS_ResetModule(UART0_RST);
-
+
/* Configure UART0 and set UART0 Baudrate */
UART_Open(UART0, cfg->baud_rate);
-
+
/* Enable Interrupt */
UART_EnableInt(UART0, UART_INTEN_RDAIEN_Msk);
}