diff options
| author | FuChao <[email protected]> | 2021-09-09 21:50:53 +0800 |
|---|---|---|
| committer | FuChao <[email protected]> | 2021-09-09 21:50:53 +0800 |
| commit | 3c1c2d4ff37a8a3cbf036cb9721199438d2b2e7d (patch) | |
| tree | 2f65804d933a7a7b02df1f741bf28f31a4c8161e /bsp | |
| parent | a33e89a79c9500c48a24ef1f3402ce372cf12062 (diff) | |
花括弧换行;ignore_format.yml以空行结束
Diffstat (limited to 'bsp')
| -rw-r--r-- | bsp/Vango_V85xx/.ignore_format.yml | 2 | ||||
| -rw-r--r-- | bsp/Vango_V85xx/drivers/drv_usart.c | 21 |
2 files changed, 15 insertions, 8 deletions
diff --git a/bsp/Vango_V85xx/.ignore_format.yml b/bsp/Vango_V85xx/.ignore_format.yml index 98f16fd398..9ca31ca955 100644 --- a/bsp/Vango_V85xx/.ignore_format.yml +++ b/bsp/Vango_V85xx/.ignore_format.yml @@ -3,4 +3,4 @@ # If you need to exclude a file, add the path to the file in file_path. dir_path: -- Libraries/VangoV85xx_standard_peripheral
\ No newline at end of file +- Libraries/VangoV85xx_standard_peripheral diff --git a/bsp/Vango_V85xx/drivers/drv_usart.c b/bsp/Vango_V85xx/drivers/drv_usart.c index 5a8e8567ac..49245f0f4b 100644 --- a/bsp/Vango_V85xx/drivers/drv_usart.c +++ b/bsp/Vango_V85xx/drivers/drv_usart.c @@ -105,7 +105,8 @@ void UART4_IRQHandler(void) } #endif /* BSP_USING_UART4 */ -static const struct V85xx_uart uarts[] = { +static const struct V85xx_uart uarts[] = +{ #ifdef BSP_USING_UART0 { UART0, /* uart peripheral index */ @@ -167,7 +168,8 @@ static rt_err_t V85xx_configure(struct rt_serial_device *serial, struct serial_c UARTx = (UART_TypeDef *)uart->uart_periph; UART_InitParaStruct.Baudrate = cfg->baud_rate; - switch (cfg->data_bits) { + switch (cfg->data_bits) + { case DATA_BITS_9: UART_InitParaStruct.WordLen = UART_WORDLEN_9B; break; @@ -177,7 +179,8 @@ static rt_err_t V85xx_configure(struct rt_serial_device *serial, struct serial_c break; } - switch (cfg->parity) { + switch (cfg->parity) + { case PARITY_ODD: UART_InitParaStruct.Parity = UART_PARITY_ODD; break; @@ -205,7 +208,8 @@ static rt_err_t V85xx_control(struct rt_serial_device *serial, int cmd, void *ar uart = (struct V85xx_uart *)serial->parent.user_data; UARTx = (UART_TypeDef *)uart->uart_periph; - switch (cmd) { + switch (cmd) + { case RT_DEVICE_CTRL_CLR_INT: /* disable rx irq */ NVIC_DisableIRQ(uart->irqn); @@ -263,14 +267,16 @@ static void uart_isr(struct rt_serial_device *serial) RT_ASSERT(uart != RT_NULL); if ((UART_GetINTStatus((UART_TypeDef *)uart->uart_periph, UART_INTSTS_RX) != RESET) && - (UART_GetFlag((UART_TypeDef *)uart->uart_periph, UART_FLAG_RXPE) != RESET)) { + (UART_GetFlag((UART_TypeDef *)uart->uart_periph, UART_FLAG_RXPE) != RESET)) + { rt_hw_serial_isr(serial, RT_SERIAL_EVENT_RX_IND); /* Clear RXNE interrupt flag */ UART_ClearINTStatus(uart->uart_periph, UART_INTSTS_RX); } } -static const struct rt_uart_ops V85xx_uart_ops = { +static const struct rt_uart_ops V85xx_uart_ops = +{ V85xx_configure, V85xx_control, V85xx_putc, @@ -283,7 +289,8 @@ int V85xx_hw_usart_init(void) int i; - for (i = 0; i < sizeof(uarts) / sizeof(uarts[0]); i++) { + for (i = 0; i < sizeof(uarts) / sizeof(uarts[0]); i++) + { uarts[i].serial->ops = &V85xx_uart_ops; uarts[i].serial->config = config; |
