在KSDK1.2的库文件中有这样一个函数:
void * INT_SYS_InstallHandler(IRQn_Type irqNumber, void (*handler)(void))
{
#if (defined(__CC_ARM))
extern uint32_t Image$$VECTOR_RAM$$Base[];
#define __VECTOR_RAM Image$$VECTOR_RAM$$Base
#else
extern uint32_t __VECTOR_RAM[];
#endif
/* Check IRQ number */
assert(FSL_FEATURE_INTERRUPT_IRQ_MIN <= irqNumber);
assert(irqNumber <= FSL_FEATURE_INTERRUPT_IRQ_MAX);
/* Check whether there is vector table in RAM */
assert(__VECTOR_RAM != 0U);
/* Save the former handler pointer */
void * retVal = (void *)__VECTOR_RAM[irqNumber + 16];
/* Set handler into vector table */
__VECTOR_RAM[irqNumber + 16] = (uint32_t)handler;
return retVal;
}
看函数名字及介绍应该是中断注册,但看其实现貌似需要中断向量表在RAM中,
那么,该函数具体怎么使用呢?
|
|