From 26e76e51ed2edb167f991e67fe5ca6736425c2a4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 23 Feb 2019 09:05:59 +1100 Subject: [PATCH] HAL_ChibiOS: fixed H7 build with older compilers --- libraries/AP_HAL_ChibiOS/hwdef/common/flash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/common/flash.c b/libraries/AP_HAL_ChibiOS/hwdef/common/flash.c index 43ad25e94c..9b01cdeaa9 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/common/flash.c +++ b/libraries/AP_HAL_ChibiOS/hwdef/common/flash.c @@ -398,7 +398,8 @@ static bool stm32h7_flash_write32(uint32_t addr, const void *buf) *CR |= FLASH_CR_PG; const uint32_t *v = (const uint32_t *)buf; - for (uint8_t i=0; i<8; i++) { + uint8_t i; + for (i=0; i<8; i++) { while (*SR & (FLASH_SR_BSY|FLASH_SR_QW)) ; putreg32(*v, addr); v++;