call_int.s

来自「在arm9实现了一个简单的触摸屏演示实验,可以实现了简单触摸功能.」· S 代码 · 共 43 行

S
43
字号
/* For the fault of GNU GCC for ARM compiler to compile the interrupt function as:
    void user_handle(void) __attribute__ ((interrupt ("IRQ"))); // NOT RECOMMEND
    void user_handle(void); // RECOMMEND
#------------------------------------------------------------------------------
#- Entry function:	void	irqEntry(void)
#- Extern function:	void	isrHandle(void)
#------------------------------------------------------------------------------
#		.INCLUDE	"include.x"
*/
		.macro IRQHandle isrHandle:
		stmdb	sp!, {r0-r11, ip, lr}	/* save r0-r11, ip, lr */
		ldr		r0, =\isrHandle
		mov		lr, pc
		bx		r0						/* jump to user_handle(void) */
		ldmia	sp!, {r0-r11, ip, lr}	/* restore r0, ip, lr */
		subs	pc, r14, #4				/* return from interrupt */
		.endm

/* Examples showed as following:
@ void TSInt (void); ---> The interrupt handle function write as C program, it is user application func.
@ isrEINT2           ---> It is the interrupt vactor entry function to jump here, call by INTERRUPT  VECTOR TABLE.
@ TSP_INT            ---> modify Project ->Settings >Assembler >General category >Predefines: set as
								TSP_INT=1 
						  OR '#define TSP_INT' or '.EQU TSP_INT' in source file (except this file).
       .extern TSInt
       .global isrEINT2	
isrEINT2:
.ifdef TSP_INT
       IRQHandle TSInt
.endif
*/
@--------------------------------------------
       .extern tsp_int_normal
       .global isrADC_normal
isrADC_normal:
.ifdef TSP_INT
       IRQHandle tsp_int_normal
.endif


@-------------------------------------------- if no isr, return directly
		subs	pc, r14, #4				/* return from interrupt */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?