diff --git a/bsp/at32/libraries/rt_drivers/drv_gpio.c b/bsp/at32/libraries/rt_drivers/drv_gpio.c index 344ba77a95..1858bb5112 100644 --- a/bsp/at32/libraries/rt_drivers/drv_gpio.c +++ b/bsp/at32/libraries/rt_drivers/drv_gpio.c @@ -260,10 +260,10 @@ static void at32_pin_mode(rt_device_t dev, rt_base_t pin, rt_uint8_t mode) rt_inline rt_int32_t bit2bitno(rt_uint32_t bit) { - int i; + rt_int32_t i; for (i = 0; i < 32; i++) { - if ((0x01 << i) == bit) + if (((rt_uint32_t)0x01 << i) == bit) { return i; }