[bsp/stm32]fix compile warning (#10108)

* [bsp/stm32]fix compile warning
This commit is contained in:
dongly 2025-03-15 21:41:49 +08:00 committed by GitHub
parent fbe6563922
commit 9b05fc5913
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 40 additions and 36 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@ -341,7 +341,7 @@ static int stm32_adc_init(void)
int result = RT_EOK;
/* save adc name */
char name_buf[5] = {'a', 'd', 'c', '0', 0};
int i = 0;
rt_uint32_t i = 0;
for (i = 0; i < sizeof(adc_config) / sizeof(adc_config[0]); i++)
{

View File

@ -388,6 +388,7 @@ const struct fal_flash_dev stm32_onchip_flash_16k =
fal_flash_erase_16k,
},
8,
{},
};
const struct fal_flash_dev stm32_onchip_flash_64k =
{
@ -402,6 +403,7 @@ const struct fal_flash_dev stm32_onchip_flash_64k =
fal_flash_erase_64k,
},
8,
{},
};
const struct fal_flash_dev stm32_onchip_flash_128k =
{
@ -416,6 +418,7 @@ const struct fal_flash_dev stm32_onchip_flash_128k =
fal_flash_erase_128k,
},
8,
{},
};
static int fal_flash_read_16k(long offset, rt_uint8_t *buf, size_t size)

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
* Copyright (c) 2006-2025, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@ -524,6 +524,7 @@ static const struct rt_pin_ops _stm32_pin_ops =
stm32_pin_dettach_irq,
stm32_pin_irq_enable,
stm32_pin_get,
RT_NULL,
};
rt_inline void pin_irq_hdr(int irqno)

View File

@ -858,7 +858,7 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
static int stm32_hwtimer_init(void)
{
int i = 0;
rt_uint32_t i = 0;
int result = RT_EOK;
for (i = 0; i < sizeof(stm32_hwtimer_obj) / sizeof(stm32_hwtimer_obj[0]); i++)

View File

@ -1315,7 +1315,7 @@ int rt_hw_usart_init(void)
rt_size_t obj_num = sizeof(uart_obj) / sizeof(struct stm32_uart);
stm32_uart_get_config();
for (int i = 0; i < obj_num; i++)
for (rt_uint32_t i = 0; i < obj_num; i++)
{
/* init UART object */
uart_obj[i].config = &uart_config[i];