handle_rtcostimer.s

来自「ARM嵌入式系统关于IRQ中断处理基于c语言的实验代码」· S 代码 · 共 106 行

S
106
字号
	IMPORT	osTimer_OSMR0
	IMPORT	osTimer_OSSR
	IMPORT	osTimer_OSCR


	IMPORT	ledStatusBuffer
	IMPORT	osScanInterval

	IMPORT	button_statusFetch
	IMPORT	led_statusSet
	IMPORT	rtc_functionConfigure



	EXPORT	handle_osTimer0New

	AREA handle_osTimer0New ,CODE ,READONLY

	stmfd r13!,{r14}
	
	mov r14,pc
	;$$$$$
	;input:null
	;
	ldr pc,=button_statusFetch
	;
	;output:r0--0 means no input, --!0 input value
	;$$$$$


	cmp r0,#0x40
	beq rtcRecountBranch

	cmp r0,#0x80
	beq rtcCountStartBranch

	b handleRtcEnd

;////////

rtcCountStartBranch
	mov r0,#0x1

	b xx
;////////

rtcRecountBranch
	ldr r11,=ledStatusBuffer	
	mov r0,#0x0
	str r0,[r11]

	mov r14,pc
	;$$$$$
	;input:r0--value 
	;
	ldr pc,=led_statusSet
	;
	;output:null
	;$$$$$	

	mov r0,#0x0


xx
	mov r14,pc
	;$$$$$
	;input:r0--1 enable trim function;--0 disable trim function
	;
	ldr pc,=rtc_functionConfigure
	;
	;output:null
	;$$$$$

	b handleRtcEnd

;/////////

handleRtcEnd
	ldr r10,=osTimer_OSMR0
	ldr r4,=osScanInterval
	ldr r11,=osTimer_OSCR
	ldr r5,[r11]
	add r4,r4,r5
	str r4,[r10]

	ldr r11,=osTimer_OSSR
	ldr r4,[r11]
	and r4,r4,#0x1
	str r4,[r11]				;clear OSTimer0 status.

	ldmfd r13!,{pc}

	END




	ldmfd r13!,{pc}

	END





⌨️ 快捷键说明

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