📄 wait_irq.s
字号:
#------------------------------------------------------------------------------
#- ATMEL Microcontroller Software Support - ROUSSET -
#------------------------------------------------------------------------------
# The software is delivered "AS IS" without warranty or condition of any
# kind, either express, implied or statutory. This includes without
# limitation any warranty or condition with respect to merchantability or
# fitness for any particular purpose, or against the infringements of
# intellectual property rights of others.
#------------------------------------------------------------------------------
#- File source : wait_irq.mac
#- Object : Assembler Wait Interrupt Handler Macro
#-
#- 1.0 00/00/00 JCZ : Creation
#------------------------------------------------------------------------------
# AREA reset, CODE, READONLY, INTERWORK
.INCLUDE "periph/aic/aic.inc"
.INCLUDE "drivers/wait/wait_irq.mac"
#------------------------------------------------------------------------------
#- Function : wait_irq
#- Treatments : Wait Interrupt Handler
#- Operations :
#------------------------------------------------------------------------------
# wait_irq_asm_handler wait_desc, wake_up_handler
.global wake_up_handler
.extern wait_desc
wake_up_handler:
#- Adjust and save LR_irq in IRQ stack
stmfd sp!, {r0}
#- Write in the IVR to support Protect Mode
#- No effect in Normal Mode
#- De-assert the NIRQ and clear the source in Protect Mode
ldr r0, =AIC_BASE
str r0, [r0, #AIC_IVR]
#- Mark the End of Interrupt on the AIC
str r0, [r0, #AIC_EOICR]
#- Read the Status Register of the used Timer Counter
ldr r0, =wait_desc
ldr r0, [r0] /* get the Timer Counter Descriptor Address */
ldr r0, [r0] /* get the Timer Counter Channel Base Address */
ldr r0, [r0, #TC_SR]
#- Adjust and save LR_irq in IRQ stack
ldmia sp!, {r0}
#- Adjust LR_irq and return
subs pc, r14, #4
# END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -