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

📄 ostimeisr.s

📁 uc_os II__PIC24fj128ga010
💻 S
字号:
;
;*******************************************************************************************
;
;                                        uC/OS-II
;                                  The Real-Time Kernel
;
;                         (c) Copyright 2006, Micrium, Weston, FL
;                                  All Rights Reserved
;
;
;                                   dsPIC33 MPLab Port
;
;
; File : OSTimeISR.s
; By : 不负责任的天使(^_^)
; Port Version : V2.51 
;*******************************************************************************************




;*******************************************************************************************
;                                     INCLUDES
;.equ     __24FJ128GA010, 1                                          ; Inform the p24FJ128GA010 header file that we are using a p24FJ128GA010
;*******************************************************************************************
.ifndef ostimeisr_s
.include "p24fj128ga010.inc"                            ; Include assembly equates for various CPU registersand bit masks
.include "\UCOS-II V2.52\OS_CPU_REG_A.S"                ; Include an assembly utility files with macros for savingand 
                                                        ; restoring the CPU registers
.endif
.text                    ; Locate this file in the text region of the build


.global __T1Interupt


;********************************************时钟中断*************************************************
;                                    OSTickISR(__T1Interrupt)
;
;Description:这个函数是一个ISR型由硬件中断的函数,目的为了实现在每一个时钟节拍中断处理TCB中的有延时
;			 需要的的任务提供OSTCB->OSTCBDly --操作,实现对延时的控制
;*****************************************************************************************************
__T1Interrupt:
OS_REGS_SAVE                    ;保存寄存器值
call _OSIntEnter			    ;调用记录中断嵌套函数OSIntEnter()
mov  _OSTCBCur, w3			    ;将OSTCBCur地址赋值w3寄存器
mov  #1, w0						;将立即数1赋值给w0
mov  _OSIntNesting, w1			;将中断嵌套层数变量OSIntNesting赋值给w1
cpsne  w0, w1					;比较OSIntNesting和1的大小关系,如果不相等跳过下一条语句
mov  w15, [w3]					;相等的条件下,将OSTCBCur->OSTCBStkPrt赋值个堆栈SP
call _OSTimeTick				;调用函数OSTimeTick()
bclr IFS0, #4					;清楚中断标志位T1IF标志位
call _OSIntExit					;调用函数OSIntExit()
OS_REGS_RESTORE					;恢复中断时寄存器的值
retfie							;返回

⌨️ 快捷键说明

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