Fix runtime crash by ARMC6 build

pull/12134/head
toyowata 2019-12-19 15:31:33 +09:00
parent 0d88ff0cfe
commit f9242d0b5c
1 changed files with 2 additions and 1 deletions

View File

@ -60,7 +60,8 @@ void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) {
// Copy and switch to dynamic vectors if first time called
if((LPC_SYSCON->SYSMEMREMAP & 0x3) != 0x1) {
uint32_t *old_vectors = (uint32_t *)0; // FLASH vectors are at 0x0
// Add volatile qualifier to avoid armclang aggressive optimization
volatile uint32_t *old_vectors = (uint32_t *)0; // FLASH vectors are at 0x0
for(i = 0; i < NVIC_NUM_VECTORS; i++) {
vectors[i] = old_vectors[i];
}