mirror of https://github.com/ARMmbed/mbed-os.git
Fix runtime crash by ARMC6 build
parent
0d88ff0cfe
commit
f9242d0b5c
|
@ -60,7 +60,8 @@ void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) {
|
||||||
|
|
||||||
// Copy and switch to dynamic vectors if first time called
|
// Copy and switch to dynamic vectors if first time called
|
||||||
if((LPC_SYSCON->SYSMEMREMAP & 0x3) != 0x1) {
|
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++) {
|
for(i = 0; i < NVIC_NUM_VECTORS; i++) {
|
||||||
vectors[i] = old_vectors[i];
|
vectors[i] = old_vectors[i];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue