diff --git a/components/amp_adapter/platform/linux/peripheral/aos_hal_lcd.c b/components/amp_adapter/platform/linux/peripheral/aos_hal_lcd.c index c2913cef29..8e8ae4b2ad 100644 --- a/components/amp_adapter/platform/linux/peripheral/aos_hal_lcd.c +++ b/components/amp_adapter/platform/linux/peripheral/aos_hal_lcd.c @@ -23,7 +23,7 @@ int32_t aos_hal_lcd_uninit(void) int32_t aos_hal_lcd_show(int x, int y, int w, int h, uint8_t *buf, bool rotate) { printf("aos_hal_lcd_show x: %d, y: %d, w: %d, h: %d, rotate: %d\n", x, y, w, h, rotate); - for (int i; i < w * h * 2; i++) + for (int i = 0; i < w * h * 2; i++) printf("buf: 0x%x", buf[i]); return 0; diff --git a/hardware/chip/rtl872xd/sdk/component/common/mbed/targets/hal/rtl8721d/i2c_api.c b/hardware/chip/rtl872xd/sdk/component/common/mbed/targets/hal/rtl8721d/i2c_api.c index e37f62f848..7c81111b24 100644 --- a/hardware/chip/rtl872xd/sdk/component/common/mbed/targets/hal/rtl8721d/i2c_api.c +++ b/hardware/chip/rtl872xd/sdk/component/common/mbed/targets/hal/rtl8721d/i2c_api.c @@ -669,7 +669,7 @@ void i2c_reset(i2c_t *obj) */ void i2c_restart_enable(i2c_t *obj) { - uint32_t i2cen; + uint32_t i2cen = 0; if (obj->I2Cx->IC_ENABLE & BIT_CTRL_IC_ENABLE) { I2C_Cmd(obj->I2Cx, DISABLE); @@ -692,7 +692,7 @@ void i2c_restart_enable(i2c_t *obj) */ void i2c_restart_disable(i2c_t *obj) { - uint32_t i2cen; + uint32_t i2cen = 0; if (obj->I2Cx->IC_ENABLE & BIT_CTRL_IC_ENABLE) { I2C_Cmd(obj->I2Cx, DISABLE);