⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wait_irq.s

📁 AT9140800 跑马灯例程
💻 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
#- 2.0 02/11/00  EL     : Include files path modification
#------------------------------------------------------------------------------

#            AREA        reset, CODE, READONLY, INTERWORK

            .INCLUDE    "../../periph/aic/aic.inc"
            .INCLUDE    "../../drivers/wait/wait_irq.mac"
           
#------------------------------------------------------------------------------
#- Function         : wait_irq
#- Treatments       : Wait Interrupt Handler
#- Operations       :
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
#  	armasm(arm sdt 汇编器)预处理将wait_desc替代$WaitDesc, wake_up_handler替代
#	$IrqHandler, arm_elf_as无相应处理, 因此注释以下宏, 并将该宏代码在以下复制修改
#------------------------------------------------------------------------------
#            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 + -