嗯,去楼上的博客里看了下,是使用软中断的方式来进行关中断处理。
而目前UCOS官方的方法是使用如下方法:
CPU_SR_Save
MRS R0, CPSR
CPU_SR_Save_Loop
; Set IRQ & FIQ bits in CPSR to DISABLE all interrupts
ORR R1, R0, #CPU_ARM_CTRL_INT_DIS
MSR CPSR_c, R1
MRS R1, CPSR ; Confirm that CPSR contains the proper interrupt disable flags
AND R1, R1, #CPU_ARM_CTRL_INT_DIS
CMP R1, #CPU_ARM_CTRL_INT_DIS
BNE CPU_SR_Save_Loop ; NOT properly DISABLED (try again)
BX LR ; DISABLED, return the original CPSR contents in R0
CPU_SR_Restore ; See Note #2
MSR CPSR_c, R0
BX LR
UCOS官方的这种方法确实可以解决关中断的问题,但是对于向量中断器可能还会无法识别中断源!
对于伪中断程序不知如何去写?
|