From f18dfa08500de08a175736d8973d45db8915f487 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Thu, 11 Mar 2021 13:26:54 +0800 Subject: [PATCH] auto formatted --- bsp/bluetrum/ab32vg1-ab-prougen/board/board.c | 12 +++--- bsp/bluetrum/ab32vg1-ab-prougen/board/board.h | 2 +- .../board/ports/audio/drv_sound.c | 40 +++++++++---------- bsp/bluetrum/libcpu/cpu/cpuport.c | 4 +- bsp/bluetrum/libcpu/cpu/interrupt.c | 20 +++++----- .../libraries/hal_drivers/config/adc_config.h | 2 +- .../libraries/hal_drivers/config/tim_config.h | 2 +- bsp/bluetrum/libraries/hal_drivers/drv_adc.c | 6 +-- .../libraries/hal_drivers/drv_common.h | 2 +- bsp/bluetrum/libraries/hal_drivers/drv_gpio.c | 2 +- bsp/bluetrum/libraries/hal_drivers/drv_gpio.h | 2 +- .../libraries/hal_drivers/drv_hwtimer.c | 2 +- bsp/bluetrum/libraries/hal_drivers/drv_log.h | 2 +- bsp/bluetrum/libraries/hal_drivers/drv_sdio.c | 2 +- bsp/bluetrum/libraries/hal_drivers/drv_sdio.h | 2 +- .../libraries/hal_drivers/drv_soft_i2c.c | 4 +- .../libraries/hal_drivers/drv_usart.c | 2 +- .../libraries/hal_drivers/drv_usart.h | 2 +- bsp/bluetrum/libraries/hal_drivers/drv_wdt.c | 2 +- .../ab32vg1_hal/include/ab32vg1_hal_adc.h | 12 +++--- .../ab32vg1_hal/include/ab32vg1_hal_gpio.h | 2 +- .../ab32vg1_hal/include/ab32vg1_hal_gpio_ex.h | 12 +++--- .../ab32vg1_hal/include/ab32vg1_hal_uart.h | 6 +-- .../ab32vg1_hal/source/ab32vg1_hal_gpio.c | 6 +-- .../ab32vg1_hal/source/ab32vg1_hal_sd.c | 6 +-- .../ab32vg1_hal/source/ab32vg1_hal_uart.c | 32 +++++++-------- .../hal_libraries/bmsis/include/ab32vg1.h | 14 +++---- 27 files changed, 101 insertions(+), 101 deletions(-) diff --git a/bsp/bluetrum/ab32vg1-ab-prougen/board/board.c b/bsp/bluetrum/ab32vg1-ab-prougen/board/board.c index 734b22437..01940cae2 100644 --- a/bsp/bluetrum/ab32vg1-ab-prougen/board/board.c +++ b/bsp/bluetrum/ab32vg1-ab-prougen/board/board.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, Bluetrum Development Team - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: @@ -65,16 +65,16 @@ void timer0_isr(int vector, void *param) void timer0_init(void) { - TMR0CON = BIT(7); //TIE - TMR0CNT = 0; + TMR0CON = BIT(7); //TIE + TMR0CNT = 0; - rt_hw_interrupt_install(IRQ_TMR0_VECTOR, timer0_isr, RT_NULL, "tick"); + rt_hw_interrupt_install(IRQ_TMR0_VECTOR, timer0_isr, RT_NULL, "tick"); } void timer0_cfg(uint32_t ticks) { - TMR0PR = (uint32_t)(ticks - 1UL); //1ms interrupt - TMR0CON |= BIT(0); // EN + TMR0PR = (uint32_t)(ticks - 1UL); //1ms interrupt + TMR0CON |= BIT(0); // EN } void hal_mdelay(uint32_t ms) diff --git a/bsp/bluetrum/ab32vg1-ab-prougen/board/board.h b/bsp/bluetrum/ab32vg1-ab-prougen/board/board.h index a4ad7daed..fd56ab288 100644 --- a/bsp/bluetrum/ab32vg1-ab-prougen/board/board.h +++ b/bsp/bluetrum/ab32vg1-ab-prougen/board/board.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, Bluetrum Development Team - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/bsp/bluetrum/ab32vg1-ab-prougen/board/ports/audio/drv_sound.c b/bsp/bluetrum/ab32vg1-ab-prougen/board/ports/audio/drv_sound.c index 10307cb32..10dbcf63f 100644 --- a/bsp/bluetrum/ab32vg1-ab-prougen/board/ports/audio/drv_sound.c +++ b/bsp/bluetrum/ab32vg1-ab-prougen/board/ports/audio/drv_sound.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, Bluetrum Development Team - * + * * SPDX-License-Identifier: Apache-2.0 * * Date Author Notes @@ -139,7 +139,7 @@ void saia_volume_set(rt_uint8_t volume) { if (volume > 100) volume = 100; - + uint32_t dvol = volume * 327; // max is 0x7ffff LOG_D("dvol=0x%x", dvol); DACVOLCON = dvol | (0x02 << 16); // dac fade in @@ -155,7 +155,7 @@ static rt_err_t sound_getcaps(struct rt_audio_device *audio, struct rt_audio_cap rt_err_t result = RT_EOK; struct sound_device *snd_dev = RT_NULL; - RT_ASSERT(audio != RT_NULL); + RT_ASSERT(audio != RT_NULL); snd_dev = (struct sound_device *)audio->parent.user_data; switch (caps->main_type) @@ -231,7 +231,7 @@ static rt_err_t sound_getcaps(struct rt_audio_device *audio, struct rt_audio_cap break; } - return RT_EOK; + return RT_EOK; } static rt_err_t sound_configure(struct rt_audio_device *audio, struct rt_audio_caps *caps) @@ -320,14 +320,14 @@ static rt_err_t sound_configure(struct rt_audio_device *audio, struct rt_audio_c break; } - return RT_EOK; + return RT_EOK; } static rt_err_t sound_init(struct rt_audio_device *audio) { struct sound_device *snd_dev = RT_NULL; - RT_ASSERT(audio != RT_NULL); + RT_ASSERT(audio != RT_NULL); snd_dev = (struct sound_device *)audio->parent.user_data; adpll_init(0); @@ -337,14 +337,14 @@ static rt_err_t sound_init(struct rt_audio_device *audio) saia_frequency_set(snd_dev->replay_config.samplerate); saia_channels_set(snd_dev->replay_config.channels); - return RT_EOK; + return RT_EOK; } static rt_err_t sound_start(struct rt_audio_device *audio, int stream) { struct sound_device *snd_dev = RT_NULL; - RT_ASSERT(audio != RT_NULL); + RT_ASSERT(audio != RT_NULL); snd_dev = (struct sound_device *)audio->parent.user_data; if (stream == AUDIO_STREAM_REPLAY) @@ -369,8 +369,8 @@ static rt_err_t sound_stop(struct rt_audio_device *audio, int stream) { struct sound_device *snd_dev = RT_NULL; - RT_ASSERT(audio != RT_NULL); - snd_dev = (struct sound_device *)audio->parent.user_data; + RT_ASSERT(audio != RT_NULL); + snd_dev = (struct sound_device *)audio->parent.user_data; if (stream == AUDIO_STREAM_REPLAY) { @@ -387,7 +387,7 @@ rt_size_t sound_transmit(struct rt_audio_device *audio, const void *writeBuf, vo rt_size_t tmp_size = size / 4; rt_size_t count = 0; - RT_ASSERT(audio != RT_NULL); + RT_ASSERT(audio != RT_NULL); snd_dev = (struct sound_device *)audio->parent.user_data; while (tmp_size-- > 0) { @@ -395,14 +395,14 @@ rt_size_t sound_transmit(struct rt_audio_device *audio, const void *writeBuf, vo AUBUFDATA = ((const uint32_t *)writeBuf)[count++]; } - return size; + return size; } static void sound_buffer_info(struct rt_audio_device *audio, struct rt_audio_buf_info *info) { struct sound_device *snd_dev = RT_NULL; - RT_ASSERT(audio != RT_NULL); + RT_ASSERT(audio != RT_NULL); snd_dev = (struct sound_device *)audio->parent.user_data; /** @@ -425,7 +425,7 @@ static struct rt_audio_ops ops = .init = sound_init, .start = sound_start, .stop = sound_stop, - .transmit = sound_transmit, + .transmit = sound_transmit, .buffer_info = sound_buffer_info, }; @@ -443,11 +443,11 @@ void audio_isr(int vector, void *param) static int rt_hw_sound_init(void) { - rt_uint8_t *tx_fifo = RT_NULL; - rt_uint8_t *rx_fifo = RT_NULL; + rt_uint8_t *tx_fifo = RT_NULL; + rt_uint8_t *rx_fifo = RT_NULL; - /* 分配 DMA 搬运 buffer */ - tx_fifo = rt_calloc(1, TX_FIFO_SIZE); + /* 分配 DMA 搬运 buffer */ + tx_fifo = rt_calloc(1, TX_FIFO_SIZE); if(tx_fifo == RT_NULL) { return -RT_ENOMEM; @@ -455,8 +455,8 @@ static int rt_hw_sound_init(void) snd_dev.tx_fifo = tx_fifo; - /* 分配 DMA 搬运 buffer */ - rx_fifo = rt_calloc(1, TX_FIFO_SIZE); + /* 分配 DMA 搬运 buffer */ + rx_fifo = rt_calloc(1, TX_FIFO_SIZE); if(rx_fifo == RT_NULL) { return -RT_ENOMEM; diff --git a/bsp/bluetrum/libcpu/cpu/cpuport.c b/bsp/bluetrum/libcpu/cpu/cpuport.c index ec3f9cdbc..a2d405ccd 100644 --- a/bsp/bluetrum/libcpu/cpu/cpuport.c +++ b/bsp/bluetrum/libcpu/cpu/cpuport.c @@ -41,9 +41,9 @@ rt_uint8_t *rt_hw_stack_init(void *tentry, stk--; *stk = (rt_uint32_t)0x10003; /* Start address */ stk--; - *stk = (rt_uint32_t)tentry; /* Start address */ + *stk = (rt_uint32_t)tentry; /* Start address */ stk -= 22; - *stk = (rt_uint32_t)parameter; /* Register a0 parameter*/ + *stk = (rt_uint32_t)parameter; /* Register a0 parameter*/ stk -= 6; *stk = (rt_uint32_t)tp; /* Register thread pointer */ stk --; diff --git a/bsp/bluetrum/libcpu/cpu/interrupt.c b/bsp/bluetrum/libcpu/cpu/interrupt.c index 3e7dbdb55..64fedde2f 100644 --- a/bsp/bluetrum/libcpu/cpu/interrupt.c +++ b/bsp/bluetrum/libcpu/cpu/interrupt.c @@ -24,16 +24,16 @@ void set_cpu_irq_comm(void (*irq_hook)(void)) void cpu_irq_comm_do(void) { - void (*pfnct)(void); + void (*pfnct)(void); uint32_t irq_pend = PICPND & irq_mask; - for (int i = 0; i < IRQ_TOTAL_NUM; i++) { + for (int i = 0; i < IRQ_TOTAL_NUM; i++) { if (irq_pend & BIT(i)) { pfnct = tbl_irq_vector[i]; if (pfnct) { - pfnct(); /* call ISR */ + pfnct(); /* call ISR */ } } - } + } } void rt_hw_irq_enable(int vector) @@ -56,12 +56,12 @@ void rt_hw_interrupt_init(void) /** * @brief This function will install a interrupt service routine to a interrupt. - * - * @param vector - * @param handler - * @param param - * @param name - * @return rt_isr_handler_t + * + * @param vector + * @param handler + * @param param + * @param name + * @return rt_isr_handler_t */ rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler, diff --git a/bsp/bluetrum/libraries/hal_drivers/config/adc_config.h b/bsp/bluetrum/libraries/hal_drivers/config/adc_config.h index 9fc2df3a8..22cd84da5 100644 --- a/bsp/bluetrum/libraries/hal_drivers/config/adc_config.h +++ b/bsp/bluetrum/libraries/hal_drivers/config/adc_config.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, Bluetrum Development Team - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/bsp/bluetrum/libraries/hal_drivers/config/tim_config.h b/bsp/bluetrum/libraries/hal_drivers/config/tim_config.h index c9f192a9d..b1c29ae1e 100644 --- a/bsp/bluetrum/libraries/hal_drivers/config/tim_config.h +++ b/bsp/bluetrum/libraries/hal_drivers/config/tim_config.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, Bluetrum Development Team - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_adc.c b/bsp/bluetrum/libraries/hal_drivers/drv_adc.c index 5f300ebe5..d9c5bf768 100644 --- a/bsp/bluetrum/libraries/hal_drivers/drv_adc.c +++ b/bsp/bluetrum/libraries/hal_drivers/drv_adc.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, Bluetrum Development Team - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: @@ -45,7 +45,7 @@ static rt_err_t ab32_adc_enabled(struct rt_adc_device *device, rt_uint32_t chann { RT_ASSERT(device != RT_NULL); - hal_adc_enable(enabled); + hal_adc_enable(enabled); return RT_EOK; } @@ -53,7 +53,7 @@ static rt_err_t ab32_adc_enabled(struct rt_adc_device *device, rt_uint32_t chann static rt_uint32_t ab32_adc_get_channel(rt_uint32_t channel) { rt_uint32_t ab32_channel = 0; - + switch (channel) { case 0: diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_common.h b/bsp/bluetrum/libraries/hal_drivers/drv_common.h index 93c77a9d9..0696bb17f 100644 --- a/bsp/bluetrum/libraries/hal_drivers/drv_common.h +++ b/bsp/bluetrum/libraries/hal_drivers/drv_common.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, Bluetrum Development Team - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_gpio.c b/bsp/bluetrum/libraries/hal_drivers/drv_gpio.c index d8bc51d91..4e0f96a79 100644 --- a/bsp/bluetrum/libraries/hal_drivers/drv_gpio.c +++ b/bsp/bluetrum/libraries/hal_drivers/drv_gpio.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, Bluetrum Development Team - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_gpio.h b/bsp/bluetrum/libraries/hal_drivers/drv_gpio.h index 525702e75..7955a47d1 100644 --- a/bsp/bluetrum/libraries/hal_drivers/drv_gpio.h +++ b/bsp/bluetrum/libraries/hal_drivers/drv_gpio.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, Bluetrum Development Team - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_hwtimer.c b/bsp/bluetrum/libraries/hal_drivers/drv_hwtimer.c index 0015afbc5..aaa3ddbea 100644 --- a/bsp/bluetrum/libraries/hal_drivers/drv_hwtimer.c +++ b/bsp/bluetrum/libraries/hal_drivers/drv_hwtimer.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, Bluetrum Development Team - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_log.h b/bsp/bluetrum/libraries/hal_drivers/drv_log.h index 0491ee177..398014a52 100644 --- a/bsp/bluetrum/libraries/hal_drivers/drv_log.h +++ b/bsp/bluetrum/libraries/hal_drivers/drv_log.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, Bluetrum Development Team - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_sdio.c b/bsp/bluetrum/libraries/hal_drivers/drv_sdio.c index 5fe2bf8d1..a9ca1a2b6 100644 --- a/bsp/bluetrum/libraries/hal_drivers/drv_sdio.c +++ b/bsp/bluetrum/libraries/hal_drivers/drv_sdio.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, Bluetrum Development Team - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_sdio.h b/bsp/bluetrum/libraries/hal_drivers/drv_sdio.h index 0a8360db7..09c1d04f5 100644 --- a/bsp/bluetrum/libraries/hal_drivers/drv_sdio.h +++ b/bsp/bluetrum/libraries/hal_drivers/drv_sdio.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, Bluetrum Development Team - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_soft_i2c.c b/bsp/bluetrum/libraries/hal_drivers/drv_soft_i2c.c index 94dfa6c5f..d2045b863 100644 --- a/bsp/bluetrum/libraries/hal_drivers/drv_soft_i2c.c +++ b/bsp/bluetrum/libraries/hal_drivers/drv_soft_i2c.c @@ -235,8 +235,8 @@ int rt_hw_i2c_init(void) ab32_i2c_bus_unlock(&soft_i2c_config[i]); LOG_D("software simulation %s init done, pin scl: %d, pin sda %d", - soft_i2c_config[i].bus_name, - soft_i2c_config[i].scl, + soft_i2c_config[i].bus_name, + soft_i2c_config[i].scl, soft_i2c_config[i].sda); } diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_usart.c b/bsp/bluetrum/libraries/hal_drivers/drv_usart.c index ee6c5791a..8758058c8 100644 --- a/bsp/bluetrum/libraries/hal_drivers/drv_usart.c +++ b/bsp/bluetrum/libraries/hal_drivers/drv_usart.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, Bluetrum Development Team - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_usart.h b/bsp/bluetrum/libraries/hal_drivers/drv_usart.h index 8bcf9c3bc..1c48cf77d 100644 --- a/bsp/bluetrum/libraries/hal_drivers/drv_usart.h +++ b/bsp/bluetrum/libraries/hal_drivers/drv_usart.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, Bluetrum Development Team - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_wdt.c b/bsp/bluetrum/libraries/hal_drivers/drv_wdt.c index fc2bc0279..6e99f50af 100644 --- a/bsp/bluetrum/libraries/hal_drivers/drv_wdt.c +++ b/bsp/bluetrum/libraries/hal_drivers/drv_wdt.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2020-2021, Bluetrum Development Team - * + * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: diff --git a/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/include/ab32vg1_hal_adc.h b/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/include/ab32vg1_hal_adc.h index 038355864..b1b68b844 100644 --- a/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/include/ab32vg1_hal_adc.h +++ b/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/include/ab32vg1_hal_adc.h @@ -31,28 +31,28 @@ #define ADC_CHANNEL_15 (1u << 15) /** * @} - * + * */ /** * @brief Enable ADC - * - * @param enable + * + * @param enable */ void hal_adc_enable(uint8_t enable); /** * @brief Starts conversion of the channels - * + * * @param channel @ref ADC_channels */ void hal_adc_start(uint32_t channel); /** * @brief Poll for conversion complete - * + * * @param timeout Timeout value in millisecond - * @return hal_error_t + * @return hal_error_t */ hal_error_t hal_adc_poll_for_conversion(uint32_t timeout); diff --git a/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/include/ab32vg1_hal_gpio.h b/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/include/ab32vg1_hal_gpio.h index ea039cbbd..0202566e7 100644 --- a/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/include/ab32vg1_hal_gpio.h +++ b/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/include/ab32vg1_hal_gpio.h @@ -13,7 +13,7 @@ struct gpio_init { uint8_t pin; uint8_t dir; - uint8_t de; + uint8_t de; uint8_t pull; uint32_t alternate; uint32_t af_con; /*!< Alternate function control diff --git a/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/include/ab32vg1_hal_gpio_ex.h b/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/include/ab32vg1_hal_gpio_ex.h index f2a94d65a..9f41619be 100644 --- a/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/include/ab32vg1_hal_gpio_ex.h +++ b/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/include/ab32vg1_hal_gpio_ex.h @@ -28,7 +28,7 @@ * G5: tx:PA1 rx:PA0 * G6: tx:PE0 rx:PE1 * G7: tx:PF2 rx:map to tx - * + * * UART1: * G1: tx:PA7 rx:PA6 * G2: tx:PA4 rx:PA3 @@ -52,17 +52,17 @@ * G1: PE7 * G2: PF2 * G3: PA3 - * + * * LPWM2: * G1: PE6 * G2: PE0 * G3: PA2 - * + * * LPWM1: * G1: PE5 * G2: PB4 * G3: PA1 - * + * * LPWM0: * G1: PE4 * G2: PB3 @@ -76,10 +76,10 @@ /** * TMR5: * G1: PE1 PE2 PE3 - * + * * TMR4: * G1: PA5 PA6 PA7 - * + * * TMR3: * G1: PB0 PB1 PB2 */ diff --git a/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/include/ab32vg1_hal_uart.h b/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/include/ab32vg1_hal_uart.h index 6802bfc61..c2eed3c51 100644 --- a/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/include/ab32vg1_hal_uart.h +++ b/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/include/ab32vg1_hal_uart.h @@ -39,7 +39,7 @@ struct uart_init /** * @brief UART handle struction definition - * + * */ struct uart_handle { @@ -76,8 +76,8 @@ struct uart_handle /** @defgroup UART_Mode UART Transfer Mode * @{ */ -#define UART_MODE_TX (0x00u) /*!< TX mode */ -#define UART_MODE_TX_RX (0x01u) /*!< RX and TX mode */ +#define UART_MODE_TX (0x00u) /*!< TX mode */ +#define UART_MODE_TX_RX (0x01u) /*!< RX and TX mode */ /** * @} diff --git a/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/source/ab32vg1_hal_gpio.c b/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/source/ab32vg1_hal_gpio.c index 3e0659598..0a3fe3184 100644 --- a/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/source/ab32vg1_hal_gpio.c +++ b/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/source/ab32vg1_hal_gpio.c @@ -105,7 +105,7 @@ void hal_gpio_init(hal_sfr_t gpiox, gpio_init_t gpio_init) /** * @brief Read the specified input port pin. - * + * * @param port GPIO port(GPIOAN, GPIOBN, GPIOEN, GPIOFN). * @param pin This parameter can be GPIO_PIN_x where x can be (0.15). * @return uint8_t The input port pin value. @@ -117,7 +117,7 @@ uint8_t hal_gpio_read(hal_sfr_t gpiox, uint8_t pin) /** * @brief Set or clear the selected data port bit. - * + * * @param port GPIO port(GPIOAN, GPIOBN, GPIOEN, GPIOFN). * @param pin This parameter can be GPIO_PIN_x where x can be (0.15). * @param state specifies the value to be written to the selected bit. @@ -135,7 +135,7 @@ void hal_gpio_write(hal_sfr_t gpiox, uint8_t pin, uint8_t state) /** * @brief Toggle the specified GPIO pin. - * + * * @param port GPIO port(GPIOAN, GPIOBN, GPIOEN, GPIOFN). * @param pin This parameter can be GPIO_PIN_x where x can be (0.15). */ diff --git a/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/source/ab32vg1_hal_sd.c b/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/source/ab32vg1_hal_sd.c index 6ed02005d..e0d3a5495 100644 --- a/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/source/ab32vg1_hal_sd.c +++ b/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/source/ab32vg1_hal_sd.c @@ -232,7 +232,7 @@ static bool sd_go_ready_try(sd_handle_t hsd) case CARD_V1: sdmmc_acmd_op_cond(hsd, 0x00ff8000); break; - + case CARD_V2: sdmmc_acmd_op_cond(hsd, 0x40ff8000); break; @@ -389,8 +389,8 @@ bool hal_sd_read(sd_handle_t hsd, void *buf, uint32_t lba) return true; } } - hsd->sdcard.state = HAL_SD_STATE_INVAL; - + hsd->sdcard.state = HAL_SD_STATE_INVAL; + hal_mdelay(20); } diff --git a/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/source/ab32vg1_hal_uart.c b/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/source/ab32vg1_hal_uart.c index bef740f89..3d3ecc3fe 100644 --- a/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/source/ab32vg1_hal_uart.c +++ b/bsp/bluetrum/libraries/hal_libraries/ab32vg1_hal/source/ab32vg1_hal_uart.c @@ -18,7 +18,7 @@ enum /** * @brief Set the UART baud rate. - * + * * @param uartx This parameter can be UARTxN where x can be (0.2). * @param baud Baud rate. */ @@ -33,9 +33,9 @@ void hal_uart_setbaud(hal_sfr_t uartx, uint32_t baud) /** * @brief Initialize the UART mode. - * + * * @param huart UART handle. - * @return hal_error_t + * @return hal_error_t */ hal_error_t hal_uart_init(struct uart_handle *huart) { @@ -51,7 +51,7 @@ hal_error_t hal_uart_init(struct uart_handle *huart) /** * @brief DeInitialize the UART peripheral. - * + * * @param uartx This parameter can be UARTxN where x can be (0.2). */ void hal_uart_deinit(hal_sfr_t uartx) @@ -61,7 +61,7 @@ void hal_uart_deinit(hal_sfr_t uartx) /** * @brief Initialize the UART MSP. - * + * * @param huart UART handle. */ WEAK void HAL_UART_MspInit(struct uart_handle *huart) @@ -69,9 +69,9 @@ WEAK void HAL_UART_MspInit(struct uart_handle *huart) /** * @brief Control the UART peripheral. - * + * * @param uartx This parameter can be UARTxN where x can be (0.2). - * @param cntl + * @param cntl * @arg UART_MODULE_ENABLE * @arg UART_BIT9_ENABLE * @arg UART_RXIT_ENABLE @@ -80,7 +80,7 @@ WEAK void HAL_UART_MspInit(struct uart_handle *huart) * @arg UART_CLK_SRC1 * @arg UART_1LINE_ENABLE * @arg UART_RX_ENABLE - * @param param + * @param param * @arg HAL_DISABLE * @arg HAL_ENABLE */ @@ -95,7 +95,7 @@ void hal_uart_control(hal_sfr_t uartx, uint32_t cntl, uint32_t param) /** * @brief Send a character - * + * * @param uartx This parameter can be UARTxN where x can be (0.2). * @param data The characters that need to be sent */ @@ -106,7 +106,7 @@ void hal_uart_write(hal_sfr_t uartx, uint8_t data) /** * @brief Receive a character. - * + * * @param uartx This parameter can be UARTxN where x can be (0.2). * @return uint8_t Received character. */ @@ -117,12 +117,12 @@ uint8_t hal_uart_read(hal_sfr_t uartx) /** * @brief Get the UART flag. - * + * * @param uartx This parameter can be UARTxN where x can be (0.2). - * @param flag + * @param flag * @arg UART_FLAG_RXPND * @arg UART_FLAG_TXPND - * @return uint32_t + * @return uint32_t */ uint32_t hal_uart_getflag(hal_sfr_t uartx, uint32_t flag) { @@ -132,9 +132,9 @@ uint32_t hal_uart_getflag(hal_sfr_t uartx, uint32_t flag) /** * @brief Clear the UART flag. - * + * * @param uartx This parameter can be UARTxN where x can be (0.2). - * @param flag + * @param flag * @arg UART_FLAG_RXPND * @arg UART_FLAG_TXPND */ @@ -145,7 +145,7 @@ void hal_uart_clrflag(hal_sfr_t uartx, uint32_t flag) /** * @brief Configure the UART peripheral. - * + * * @param huart UART handle. */ void uart_config_all(struct uart_handle *huart) diff --git a/bsp/bluetrum/libraries/hal_libraries/bmsis/include/ab32vg1.h b/bsp/bluetrum/libraries/hal_libraries/bmsis/include/ab32vg1.h index 983036928..c436572b3 100644 --- a/bsp/bluetrum/libraries/hal_libraries/bmsis/include/ab32vg1.h +++ b/bsp/bluetrum/libraries/hal_libraries/bmsis/include/ab32vg1.h @@ -17,18 +17,18 @@ typedef enum IRQ_SW_VECTOR = 2, IRQ_TMR0_VECTOR = 3, IRQ_TMR1_VECTOR = 4, - IRQ_TMR2_4_5_VECTOR = 5, /*!< Timer 2, 4 and 5 Interrupt */ - IRQ_IRRX_VECTOR = 6, /*!< Timer 3 and IR receiver Interrupt */ + IRQ_TMR2_4_5_VECTOR = 5, /*!< Timer 2, 4 and 5 Interrupt */ + IRQ_IRRX_VECTOR = 6, /*!< Timer 3 and IR receiver Interrupt */ IRQ_USB_VECTOR = 7, IRQ_SD_VECTOR = 8, - IRQ_AUBUF0_1_VECTOR = 9, /*!< Audio buffer 0 and 1 Interrupt */ + IRQ_AUBUF0_1_VECTOR = 9, /*!< Audio buffer 0 and 1 Interrupt */ IRQ_SDADC_VECTOR = 10, IRQ_AUDEC_VECTOR = 11, /*!< Audio codec, SBC encode and AEC FFT Interrupt */ - IRQ_SRC_VECTOR = 12, /*!< SRC, PLC and CVSD Interrupt */ - IRQ_FM_SPDIF_VECTOR = 13, /*!< FM TX, RX and SPDIF RX Interrupt */ - IRQ_UART0_2_VECTOR = 14, /*!< UART 0 to 2 Interrupt */ + IRQ_SRC_VECTOR = 12, /*!< SRC, PLC and CVSD Interrupt */ + IRQ_FM_SPDIF_VECTOR = 13, /*!< FM TX, RX and SPDIF RX Interrupt */ + IRQ_UART0_2_VECTOR = 14, /*!< UART 0 to 2 Interrupt */ IRQ_HSUART_VECTOR = 15, - IRQ_RTC_VECTOR = 16, /*!< RTC, LVD and WDT Interrupt */ + IRQ_RTC_VECTOR = 16, /*!< RTC, LVD and WDT Interrupt */ IRQ_I2S_VECTOR = 17, IRQ_TOTAL_NUM = 23, } irq_type; -- GitLab