diff --git a/components/hal_drv/bl602_hal/bl_adc.c b/components/hal_drv/bl602_hal/bl_adc.c index 183978800..67b8ea23a 100644 --- a/components/hal_drv/bl602_hal/bl_adc.c +++ b/components/hal_drv/bl602_hal/bl_adc.c @@ -486,7 +486,7 @@ int bl_adc_start(void) int bl_adc_gpio_init(int gpio_num) { - uint8_t adc_pin = gpio_num; + GLB_GPIO_Type adc_pin = gpio_num; GLB_GPIO_Func_Init(GPIO_FUN_ANALOG, &adc_pin, 1); diff --git a/components/hal_drv/bl602_hal/bl_dac_audio.c b/components/hal_drv/bl602_hal/bl_dac_audio.c index 092584170..3db8b8c4c 100644 --- a/components/hal_drv/bl602_hal/bl_dac_audio.c +++ b/components/hal_drv/bl602_hal/bl_dac_audio.c @@ -27,6 +27,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include "bl_dac_audio.h" #include "bl602_common.h" diff --git a/components/hal_drv/bl602_hal/bl_i2c.c b/components/hal_drv/bl602_hal/bl_i2c.c index 3e74067f6..af48c8bd8 100644 --- a/components/hal_drv/bl602_hal/bl_i2c.c +++ b/components/hal_drv/bl602_hal/bl_i2c.c @@ -56,7 +56,7 @@ void i2c_set_freq(int freq, int i2cx) void i2c_gpio_init(int i2cx) { - uint8_t gpiopins[2]; + GLB_GPIO_Type gpiopins[2]; if (i2cx == I2C0) { gpiopins[0] = GLB_GPIO_PIN_4; gpiopins[1] = GLB_GPIO_PIN_3; diff --git a/components/hal_drv/bl602_hal/hal_button.c b/components/hal_drv/bl602_hal/hal_button.c index 5ce0d7dc8..f718a95ac 100644 --- a/components/hal_drv/bl602_hal/hal_button.c +++ b/components/hal_drv/bl602_hal/hal_button.c @@ -338,7 +338,7 @@ void fdt_button_module_init(const void *fdt, int button_offset) for (i = 0; i < GPIO_MODULE_MAX; i++) { memset(gpio_node, 0, sizeof(gpio_node)); - sprintf(gpio_node, "gpio%d", i); + snprintf(gpio_node, sizeof(gpio_node), "gpio%d", i); offset1 = fdt_subnode_offset(fdt, button_offset, gpio_node); if (0 > offset1) { //log_warn("gpio[%d] %s NULL. \r\n", i, gpio_node); diff --git a/components/hal_drv/bl602_hal/hal_ir.c b/components/hal_drv/bl602_hal/hal_ir.c index 60bf96cb1..5479a86a1 100644 --- a/components/hal_drv/bl602_hal/hal_ir.c +++ b/components/hal_drv/bl602_hal/hal_ir.c @@ -60,7 +60,7 @@ int hal_ir_init_from_dts(uint32_t fdt_input, uint32_t dtb_offset) int ctrltype = 0; uint8_t pin = 0; - uint16_t interval = NULL; + uint16_t interval = 0; addr_prop = fdt_getprop(fdt, dtb_offset, "ctrltype", &lentmp); if (addr_prop == NULL) { diff --git a/components/hal_drv/bl602_hal/hal_spi.c b/components/hal_drv/bl602_hal/hal_spi.c index c9fa5458b..529787f20 100644 --- a/components/hal_drv/bl602_hal/hal_spi.c +++ b/components/hal_drv/bl602_hal/hal_spi.c @@ -89,7 +89,7 @@ void bl_spi0_dma_int_handler_rx(void); static void hal_gpio_init(spi_hw_t *arg) { - uint8_t gpiopins[4]; + GLB_GPIO_Type gpiopins[4]; if (!arg) { blog_error("arg err.\r\n"); diff --git a/components/hal_drv/bl602_hal/hal_sys.c b/components/hal_drv/bl602_hal/hal_sys.c index 68b6bdb75..23ee76ccc 100644 --- a/components/hal_drv/bl602_hal/hal_sys.c +++ b/components/hal_drv/bl602_hal/hal_sys.c @@ -55,7 +55,7 @@ static uint32_t user_clz(uint32_t priorities) struct romapi_freertos_map* hal_sys_romapi_get(void) { - extern uint8_t __global_pointer_head$; + extern uint8_t __global_pointer_head$[0x498]; uint32_t *gp_data_start = (uint32_t*)(&__global_pointer_head$); struct romapi_freertos_map* romapi_freertos; diff --git a/components/hal_drv/bl602_hal/hal_wifi.c b/components/hal_drv/bl602_hal/hal_wifi.c index 23dba59ff..3db7de338 100644 --- a/components/hal_drv/bl602_hal/hal_wifi.c +++ b/components/hal_drv/bl602_hal/hal_wifi.c @@ -27,6 +27,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include #include "hal_wifi.h"