; addition, IRQ interrupts may be re-enabled - with certain restrictions -
; if nested IRQ interrupts are desired. Interrupts may be re-enabled over
; small code sequences where lr is saved before enabling interrupts and
; restored after interrupts are again disabled. */
;
;
; The myIrqHander is written without support for nested interrupts, so it
; is called before the nested interrupt support code.
;
BLX myIrqHander
;
; /* Interrupt nesting is allowed after calling _tx_thread_irq_nesting_start
; from IRQ mode with interrupts disabled. This routine switches to the
; system mode and returns with IRQ interrupts enabled.
;
; NOTE: It is very important to ensure all IRQ interrupts are cleared
; prior to enabling nested IRQ interrupts. */
IF :DEF:TX_ENABLE_IRQ_NESTING
BL _tx_thread_irq_nesting_start
ENDIF
;
;
; /* Application IRQ handlers can be called here! */
;
; /* If interrupt nesting was started earlier, the end of interrupt nesting
; service must be called before returning to _tx_thread_context_restore.
; This routine returns in processing in IRQ mode with interrupts disabled. */
IF :DEF:TX_ENABLE_IRQ_NESTING
BL _tx_thread_irq_nesting_end
ENDIF
;
; /* Jump to context restore to restore system context. */
B _tx_thread_context_restore
; end of _irq_handler
其中myIrqHander为C代码的入口函数,在IRQ中断发生时执行上面的汇编代码,保存上下文,
最后跳转到 BLX myIrqHander,开始myIrqHander()函数的执行。
/**
*
* @Name: myIrqHander()
*
* @Description: This is the 'C' entry for the IRQ interrupt handler. This is
* called from assembly to process all ARM IRQ interrupts and all
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-40032-3.html
入台湾之日
试试DF21和DF26的实战