HAL_ChibiOS: fixed build with older gcc

This commit is contained in:
Andrew Tridgell 2019-04-20 20:28:30 +10:00 committed by Randy Mackay
parent 4fc4573f81
commit 3bd1a08c5e

View File

@ -94,7 +94,8 @@ void stm32_watchdog_save_reason(void)
{
if (WDG_RESET_STATUS & WDG_RESET_IS_IWDG) {
was_watchdog_reset = true;
for (uint8_t i=0; i<sizeof(boot_backup_state)/sizeof(boot_backup_state[0]); i++) {
uint8_t i;
for (i=0; i<sizeof(boot_backup_state)/sizeof(boot_backup_state[0]); i++) {
boot_backup_state[i] = get_rtc_backup(i);
}
}
@ -106,7 +107,8 @@ void stm32_watchdog_save_reason(void)
void stm32_watchdog_clear_reason(void)
{
WDG_RESET_STATUS = WDG_RESET_CLEAR;
for (uint8_t i=1; i<sizeof(boot_backup_state)/sizeof(boot_backup_state[0]); i++) {
uint8_t i;
for (i=1; i<sizeof(boot_backup_state)/sizeof(boot_backup_state[0]); i++) {
set_rtc_backup(i, 0);
}
}