nxp: fix vector redefinition from CMSIS

Since 5.7 CMSIS update to Mbed OS, __VECTOR_TABLE is defined in cmsis_gcc header
file. Many MCU in NXP uses this symbol as linker definition, therefore we should
check if already defined and undefined it.

Fixes #13062
pull/13064/head
Martin Kojtal 2020-06-04 08:41:48 +01:00
parent 165be79392
commit 41995a7427
1 changed files with 6 additions and 0 deletions

View File

@ -29,6 +29,12 @@
*/
#include "fsl_common.h"
/* At least CMSIS 5.7 introduced vector table and define this GCC linker symbol to
__Vectors - not valid for many NXP MCU. To fix this, we undefine it if already defined
as it comes from a linker */
#undef __VECTOR_TABLE
void InstallIRQHandler(IRQn_Type irq, uint32_t irqHandler)
{
/* Addresses for VECTOR_TABLE and VECTOR_RAM come from the linker file */