From 8da1479a1bc47ed77a26a54a1b1f169aa6663a1b Mon Sep 17 00:00:00 2001 From: jzlv Date: Mon, 7 Jun 2021 19:05:29 +0800 Subject: [PATCH] [fix] fix pinmux_init and while(1) process --- bsp/board/bl602_iot/board.c | 2 +- bsp/board/bl602_iot/peripheral_config.h | 4 +++- bsp/board/bl706_avb/board.c | 2 +- bsp/board/bl706_avb/peripheral_config.h | 16 +++------------- bsp/board/bl706_iot/board.c | 2 +- bsp/board/bl706_iot/peripheral_config.h | 3 ++- bsp/board/bl706_lp/board.c | 2 +- bsp/board/bl706_lp/peripheral_config.h | 4 +++- examples/pwm/pwm_breath_led/main.c | 2 -- examples/pwm/pwm_it/main.c | 3 +-- examples/systick/main.c | 1 + examples/uart/uart_echo/main.c | 6 +++++- 12 files changed, 22 insertions(+), 25 deletions(-) diff --git a/bsp/board/bl602_iot/board.c b/bsp/board/bl602_iot/board.c index 5998f217..fce6a045 100644 --- a/bsp/board/bl602_iot/board.c +++ b/bsp/board/bl602_iot/board.c @@ -174,7 +174,7 @@ static void board_pin_mux_init(void) { gpio_cfg.pullType = GPIO_PULL_DOWN; } - // else if((af_pin_table[i].func == GPIO_FUN_DAC)|| (af_pin_table[i].func == GPIO_FUN_DAC)) + // else if((af_pin_table[i].func == GPIO_FUN_DAC)|| (af_pin_table[i].func == GPIO_FUN_ADC)) // { // gpio_cfg.gpioFun = GPIO_FUN_ANALOG; // gpio_cfg.gpioMode = GPIO_MODE_ANALOG; diff --git a/bsp/board/bl602_iot/peripheral_config.h b/bsp/board/bl602_iot/peripheral_config.h index 6b371120..4f6d6bf6 100644 --- a/bsp/board/bl602_iot/peripheral_config.h +++ b/bsp/board/bl602_iot/peripheral_config.h @@ -35,8 +35,10 @@ #define BSP_USING_DMA0_CH2 #define BSP_USING_DMA0_CH3 #define BSP_USING_DMA0_CH4 -#define BSP_USING_DMA0_CH2 +#define BSP_USING_DMA0_CH5 #define BSP_USING_DMA0_CH6 +#define BSP_USING_DMA0_CH7 + /* PERIPHERAL CONFIG */ #if defined(BSP_USING_ADC0) diff --git a/bsp/board/bl706_avb/board.c b/bsp/board/bl706_avb/board.c index f51ba403..d6d81b74 100644 --- a/bsp/board/bl706_avb/board.c +++ b/bsp/board/bl706_avb/board.c @@ -188,7 +188,7 @@ static void board_pin_mux_init(void) { gpio_cfg.pullType = GPIO_PULL_DOWN; } - else if((af_pin_table[i].func == GPIO_FUN_DAC)|| (af_pin_table[i].func == GPIO_FUN_DAC)) + else if((af_pin_table[i].func == GPIO_FUN_DAC)|| (af_pin_table[i].func == GPIO_FUN_ADC)) { gpio_cfg.gpioFun = GPIO_FUN_ANALOG; gpio_cfg.gpioMode = GPIO_MODE_ANALOG; diff --git a/bsp/board/bl706_avb/peripheral_config.h b/bsp/board/bl706_avb/peripheral_config.h index f3aadece..cf5b0143 100644 --- a/bsp/board/bl706_avb/peripheral_config.h +++ b/bsp/board/bl706_avb/peripheral_config.h @@ -14,29 +14,19 @@ #define BSP_USING_TIMER_CH0 #define BSP_USING_TIMER_CH1 #define BSP_USING_CAM + /* ----------------------*/ /* PERIPHERAL With DMA LIST */ #define BSP_USING_DMA0_CH0 #define BSP_USING_DMA0_CH1 - -#ifdef BSP_USING_UART1 #define BSP_USING_DMA0_CH2 -#endif - -#ifdef BSP_USING_SPI0 #define BSP_USING_DMA0_CH3 #define BSP_USING_DMA0_CH4 -#endif - -#ifdef BSP_USING_I2S0 -#define BSP_USING_DMA0_CH2 -#endif - -#ifdef BSP_USING_DAC0 +#define BSP_USING_DMA0_CH5 #define BSP_USING_DMA0_CH6 -#endif +#define BSP_USING_DMA0_CH7 /* PERIPHERAL CONFIG */ diff --git a/bsp/board/bl706_iot/board.c b/bsp/board/bl706_iot/board.c index 61dc1130..58f43904 100644 --- a/bsp/board/bl706_iot/board.c +++ b/bsp/board/bl706_iot/board.c @@ -211,7 +211,7 @@ static void board_pin_mux_init(void) { gpio_cfg.pullType = GPIO_PULL_DOWN; } - else if((af_pin_table[i].func == GPIO_FUN_DAC)|| (af_pin_table[i].func == GPIO_FUN_DAC)) + else if((af_pin_table[i].func == GPIO_FUN_DAC)|| (af_pin_table[i].func == GPIO_FUN_ADC)) { gpio_cfg.gpioFun = GPIO_FUN_ANALOG; gpio_cfg.gpioMode = GPIO_MODE_ANALOG; diff --git a/bsp/board/bl706_iot/peripheral_config.h b/bsp/board/bl706_iot/peripheral_config.h index 51629e49..32792249 100644 --- a/bsp/board/bl706_iot/peripheral_config.h +++ b/bsp/board/bl706_iot/peripheral_config.h @@ -45,8 +45,9 @@ #define BSP_USING_DMA0_CH2 #define BSP_USING_DMA0_CH3 #define BSP_USING_DMA0_CH4 -#define BSP_USING_DMA0_CH2 +#define BSP_USING_DMA0_CH5 #define BSP_USING_DMA0_CH6 +#define BSP_USING_DMA0_CH7 /* PERIPHERAL CONFIG */ #if defined(BSP_USING_ADC0) diff --git a/bsp/board/bl706_lp/board.c b/bsp/board/bl706_lp/board.c index 61dc1130..58f43904 100644 --- a/bsp/board/bl706_lp/board.c +++ b/bsp/board/bl706_lp/board.c @@ -211,7 +211,7 @@ static void board_pin_mux_init(void) { gpio_cfg.pullType = GPIO_PULL_DOWN; } - else if((af_pin_table[i].func == GPIO_FUN_DAC)|| (af_pin_table[i].func == GPIO_FUN_DAC)) + else if((af_pin_table[i].func == GPIO_FUN_DAC)|| (af_pin_table[i].func == GPIO_FUN_ADC)) { gpio_cfg.gpioFun = GPIO_FUN_ANALOG; gpio_cfg.gpioMode = GPIO_MODE_ANALOG; diff --git a/bsp/board/bl706_lp/peripheral_config.h b/bsp/board/bl706_lp/peripheral_config.h index 45d597dc..b17f6a6f 100644 --- a/bsp/board/bl706_lp/peripheral_config.h +++ b/bsp/board/bl706_lp/peripheral_config.h @@ -44,8 +44,10 @@ #define BSP_USING_DMA0_CH2 #define BSP_USING_DMA0_CH3 #define BSP_USING_DMA0_CH4 -#define BSP_USING_DMA0_CH2 +#define BSP_USING_DMA0_CH5 #define BSP_USING_DMA0_CH6 +#define BSP_USING_DMA0_CH7 + /* PERIPHERAL CONFIG */ #if defined(BSP_USING_ADC0) diff --git a/examples/pwm/pwm_breath_led/main.c b/examples/pwm/pwm_breath_led/main.c index 2c0063e9..0438c249 100644 --- a/examples/pwm/pwm_breath_led/main.c +++ b/examples/pwm/pwm_breath_led/main.c @@ -63,6 +63,4 @@ int main(void) bflb_platform_delay_ms(10); } } - - BL_CASE_SUCCESS; } diff --git a/examples/pwm/pwm_it/main.c b/examples/pwm/pwm_it/main.c index 7c64434a..63680a63 100644 --- a/examples/pwm/pwm_it/main.c +++ b/examples/pwm/pwm_it/main.c @@ -52,7 +52,6 @@ int main(void) while (1) { + __asm volatile ("nop"); } - - BL_CASE_SUCCESS; } diff --git a/examples/systick/main.c b/examples/systick/main.c index b11d1a38..98e20ed0 100644 --- a/examples/systick/main.c +++ b/examples/systick/main.c @@ -36,6 +36,7 @@ int main(void) bflb_platform_set_alarm_time(1000000,systick_isr); while(1) { + __asm volatile ("nop"); } } diff --git a/examples/uart/uart_echo/main.c b/examples/uart/uart_echo/main.c index f364b01c..f58cede6 100644 --- a/examples/uart/uart_echo/main.c +++ b/examples/uart/uart_echo/main.c @@ -46,5 +46,9 @@ int main(void) device_control(uart, DEVICE_CTRL_SET_INT, (void *)(UART_RX_FIFO_IT|UART_RTO_IT)); } - BL_CASE_SUCCESS; + while (1) + { + __asm volatile ("nop"); + } + }