/*ulPortInterruptNestingConst = ulPortInterruptNestingConst +1*/
LDR r3, ulPortInterruptNestingConst /*获取ulPortInterruptNestingConst位置的内容,即ulPortInterruptNesting变量对应的地址。所有如果访问ulPortInterruptNesting,需要LDR r1, [r3] 才会将ulPortInterruptNesting放到r1*/
LDR r1, [r3]
ADD r4, r1, #1
STR r4, [r3]
/* Call the interrupt handler. */
PUSH {r0-r4, lr}
LDR r1, vApplicationIRQHandlerConst /*获取vApplicationIRQHandlerConst位置的内容,即HwiP_irq_handler_c,因为HwiP_irq_handler_c本身就是一个中断处理函数地址,所有能够使用 blx r1直接跳转到函数地址*/
BLX r1
POP {r0-r4, lr}
ADD sp, sp, r2
ulPortInterruptNestingConst: .word ulPortInterruptNesting
vApplicationIRQHandlerConst: .word HwiP_irq_handler_c
void __attribute__((section(".text.hwi"))) HwiP_irq_handler_c(void)
{
....
}
uint32_t ulPortInterruptNesting = 0UL;
总结:使用.word 关键字 分别将ulPortInterruptNesting的地址,以及HwiP_irq_handler_c(本身就是地址)按顺序放到特定位置
另外一点ulPortInterruptNesting本身是不是指针都没有影响
