📄 71x_vect.s
字号:
SaveContext r0,r12 ; Save the workspace plus the current
; return address lr_abt and spsr_abt.
ldr r0,=Prefetch_Handler
ldr lr,=Prefetch_Handler_end
bx r0 ; Branch to Prefetch_Handler.
Prefetch_Handler_end:
RestoreContext r0,r12 ; Return to the instruction following that...
; ...has generated the prefetch abort exception.
;*******************************************************************************
;* Function Name : DataAbortHandler
;* Description : This function is called when Data Abort
; exception is entered.
;* Input : none
;* Output : none
;*******************************************************************************
DataAbortHandler
SUB lr,lr,#8 ; Update the link register.
SaveContext r0,r12 ; Save the workspace plus the current
; return address lr_ abt and spsr_abt.
ldr r0,=Abort_Handler
ldr lr,=Abort_Handler_end
bx r0 ; Branch to Abort_Handler.
Abort_Handler_end:
RestoreContext r0,r12 ; Return to the instruction following that...
; ...has generated the data abort exception.
;*******************************************************************************
;* Function Name : FIQHandler
;* Description : This function is called when FIQ
; exception is entered.
;* Input : none
;* Output : none
;*******************************************************************************
FIQHandler
SUB lr,lr,#4 ; Update the link register.
SaveContext r0,r7 ; Save the workspace plus the current
; return address lr_ fiq and spsr_fiq.
ldr r0,=FIQ_Handler
ldr lr,=FIQ_Handler_end
bx r0 ; Branch to FIQ_Handler.
FIQ_Handler_end:
RestoreContext r0,r7 ; Restore the context and return to the...
; ...program execution.
;*******************************************************************************
;* Macro Name : IRQ_to_SYS
;* Description : This macro used to switch form IRQ mode to SYS mode
;* Input : none.
;* Output : none
;*******************************************************************************
IRQ_to_SYS MACRO
MSR cpsr_c,#0x1F ; Switch to SYS mode
STMFD sp!,{lr} ; Save the link register.
ENDM
;*******************************************************************************
;* Macro Name : SYS_to_IRQ
;* Description : This macro used to switch from SYS mode to IRQ mode
; then to return to IRQHnadler routine.
;* Input : none.
;* Output : none.
;*******************************************************************************
SYS_to_IRQ MACRO
LDMFD sp!,{lr} ; Restore the link register.
MSR cpsr_c,#0xD2 ; Switch to IRQ mode.
MOV pc,lr ; Return to IRQHandler routine to clear the
; pending bit.
ENDM
;*******************************************************************************
;* Function Name : T0TIMIIRQHandler
;* Description : This function used to switch to SYS mode before entering
; the T0TIMI_IRQHandler function located in 71x_it.c.
; Then to return to IRQ mode after the
; T0TIMI_IRQHandler function termination.
;* Input : none.
;* Output : none.
;*******************************************************************************
T0TIMIIRQHandler
IRQ_to_SYS
ldr r0,=T0TIMI_IRQHandler
ldr lr,=T0TIMI_IRQHandler_end
bx r0
T0TIMI_IRQHandler_end:
SYS_to_IRQ
;*******************************************************************************
;* Function Name : FLASHIRQHandler
;* Description : This function used to switch to SYS mode before entering
; the FLASH_IRQHandler function located in 71x_it.c.
; Then to return to IRQ mode after the
; FLASH_IRQHandler function termination.
;* Input : none
;* Output : none
;*******************************************************************************
FLASHIRQHandler
IRQ_to_SYS
ldr r0,=FLASH_IRQHandler
ldr lr,=FLASH_IRQHandler_end
bx r0
FLASH_IRQHandler_end:
SYS_to_IRQ
;*******************************************************************************
;* Function Name : RCCUIRQHandler
;* Description : This function used to switch to SYS mode before entering
; the RCCU_IRQHandler function located in 71x_it.c.
; Then to return to IRQ mode after the
; RCCU_IRQHandler function termination.
;* Input : none
;* Output : none
;*******************************************************************************
RCCUIRQHandler
IRQ_to_SYS
ldr r0,=RCCU_IRQHandler
ldr lr,=RCCU_IRQHandler_end
bx r0
RCCU_IRQHandler_end:
SYS_to_IRQ
;*******************************************************************************
;* Function Name : RTCIRQHandler
;* Description : This function used to switch to SYS mode before entering
; the RTC_IRQHandler function located in 71x_it.c.
; Then to return to IRQ mode after the
; RTC_IRQHandler function termination.
;* Input : none
;* Output : none
;*******************************************************************************
RTCIRQHandler
IRQ_to_SYS
ldr r0,=RTC_IRQHandler
ldr lr,=RTC_IRQHandler_end
bx r0
RTC_IRQHandler_end:
SYS_to_IRQ
;*******************************************************************************
;* Function Name : WDGIRQHandler
;* Description : This function used to switch to SYS mode before entering
; the WDG_IRQHandler function located in 71x_it.c.
; Then to return to IRQ mode after the
; WDG_IRQHandler function termination.
;* Input : none
;* Output : none
;*******************************************************************************
WDGIRQHandler
IRQ_to_SYS
ldr r0,=WDG_IRQHandler
ldr lr,=WDG_IRQHandler_end
bx r0
WDG_IRQHandler_end:
SYS_to_IRQ
;*******************************************************************************
;* Function Name : XTIIRQHandler
;* Description : This function used to switch to SYS mode before entering
; the XTI_IRQHandler function located in 71x_it.c.
; Then to return to IRQ mode after the
; XTI_IRQHandler function termination.
;* Input : none
;* Output : none
;*******************************************************************************
XTIIRQHandler
IRQ_to_SYS
ldr r0,=XTI_IRQHandler
ldr lr,=XTI_IRQHandler_end
bx r0
XTI_IRQHandler_end:
SYS_to_IRQ
;*******************************************************************************
;* Function Name : USBHPIRQHandler
;* Description : This function used to switch to SYS mode before entering
; the USBHP_IRQHandler function located in 71x_it.c.
; Then to return to IRQ mode after the
; USBHP_IRQHandler function termination.
;* Input : none
;* Output : none
;*******************************************************************************
USBHPIRQHandler
IRQ_to_SYS
ldr r0,=USBHP_IRQHandler
ldr lr,=USBHP_IRQHandler_end
bx r0
USBHP_IRQHandler_end:
SYS_to_IRQ
;*******************************************************************************
;* Function Name : I2C0ITERRIRQHandler
;* Description : This function used to switch to SYS mode before entering
; the I2C0ITERR_IRQHandler function located in 71x_it.c.
; Then to return to IRQ mode after the
; I2C0ITERR_IRQHandler function termination.
;* Input : none
;* Output : none
;*******************************************************************************
I2C0ITERRIRQHandler
IRQ_to_SYS
ldr r0,=I2C0ITERR_IRQHandler
ldr lr,=I2C0ITERR_IRQHandler_end
bx r0
I2C0ITERR_IRQHandler_end:
SYS_to_IRQ
;*******************************************************************************
;* Function Name : I2C1ITERRIRQHandler
;* Description : This function used to switch to SYS mode before entering
; the I2C1ITERR_IRQHandler function located in 71x_it.c.
; Then to return to IRQ mode after the
; I2C1ITERR_IRQHandler function termination.
;* Input : none
;* Output : none
;*******************************************************************************
I2C1ITERRIRQHandler
IRQ_to_SYS
ldr r0,=I2C1ITERR_IRQHandler
ldr lr,=I2C1ITERR_IRQHandler_end
bx r0
I2C1ITERR_IRQHandler_end:
SYS_to_IRQ
;*******************************************************************************
;* Function Name : UART0IRQHandler
;* Description : This function used to switch to SYS mode before entering
; the UART0_IRQHandler function located in 71x_it.c.
; Then to return to IRQ mode after the
; UART0_IRQHandler function termination.
;* Input : none
;* Output : none
;*******************************************************************************
UART0IRQHandler
IRQ_to_SYS
ldr r0,=UART0_IRQHandler
ldr lr,=UART0_IRQHandler_end
bx r0
UART0_IRQHandler_end:
SYS_to_IRQ
;*******************************************************************************
;* Function Name : UART1IRQHandler
;* Description : This function used to switch to SYS mode before entering
; the UART1_IRQHandler function located in 71x_it.c.
; Then to return to IRQ mode after the
; UART1_IRQHandler function termination.
;* Input : none
;* Output : none
;*******************************************************************************
UART1IRQHandler
IRQ_to_SYS
ldr r0,=UART1_IRQHandler
ldr lr,=UART1_IRQHandler_end
bx r0
UART1_IRQHandler_end:
SYS_to_IRQ
;*******************************************************************************
;* Function Name : UART2IRQHandler
;* Description : This function used to switch to SYS mode before entering
; the UART2_IRQHandler function located in 71x_it.c.
; Then to return to IRQ mode after the
; UART2_IRQHandler function termination.
;* Input : none
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -