HAL_ChibiOS: fixed build with our old compiler

gcc 4.9 doesn't like static_assert() in C code
This commit is contained in:
Andrew Tridgell 2020-06-07 12:24:15 +10:00
parent 7415a714bc
commit a15108fee4
1 changed files with 2 additions and 0 deletions

View File

@ -127,10 +127,12 @@ static const uint32_t flash_memmap[STM32_FLASH_NPAGES] = { KB(32), KB(32), KB(32
#error "Unsupported processor for flash.c"
#endif
#if defined(__GNUC__) && __GNUC__ >= 6
#ifdef STORAGE_FLASH_PAGE
static_assert(STORAGE_FLASH_PAGE < STM32_FLASH_NPAGES,
"STORAGE_FLASH_PAGE out of range");
#endif
#endif
// keep a cache of the page addresses
#ifndef STM32_FLASH_FIXED_PAGE_SIZE