?? port2_isr.asm
字號:
;********************************************************************************************************
; uC/OS-II
; The Real-Time Kernel
;
; (c) Copyright 2002, Micrium, Inc., Weston, FL
; All Rights Reserved
;
; TI MSP430
;
;
; File : OS_PORT1_ISR.S43
; By Written By Liu Yongfu
;
;********************************************************************************************************
#include <msp430x16x.h>
;********************************************************************************************************
; MACRO DEFINITIONS
;********************************************************************************************************
EXTERN PORT2_INT
PUBLIC PORT2_ISR
EXTERN OSIntNesting //用來看是否來至中斷
EXTERN OSTCBCur //當前任務控制塊
EXTERN OSISRStkPtr //
EXTERN OSIntExit //脫離中斷服務函數
EXTERN OSTCBHighRdy
PUSHALL MACRO
push r4
push r5
push r6
push r7
push r8
push r9
push r10
push r11
push r12
push r13
push r14
push r15
ENDM
POPALL MACRO
pop r15
pop r14
pop r13
pop r12
pop r11
pop r10
pop r9
pop r8
pop r7
pop r6
pop r5
pop r4
ENDM
;********************************************************************************************************
; PUBLIC AND EXTERNAL DECLARATIONS
;********************************************************************************************************
RSEG CODE ; Program code
PORT2_ISR
PUSHALL
DINT ; general interrupt is not allowed
cmp.b #0, &OSIntNesting ;if (OSIntNesting == 0)
jne PORT2_ISR_1
mov.w &OSTCBCur, R13 ; save task stackMOV [.W] 源操作數移至目的操作數
mov.w SP, 0(R13)
mov.w &OSISRStkPtr, SP ; load interrupt stack
PORT2_ISR_1
inc.b &OSIntNesting ; increase OSIntNesting
call #PORT2_INT
EINT ; enable general interrupt to allow for interrupt nesting
call #OSIntExit ; call ticks routine脫離中斷服務函數
cmp.b #0, &OSIntNesting ; if (OSIntNesting == 0)
jne PORT2_ISR_2
mov.w &OSTCBHighRdy, R13 ; restore task stack SP
mov.w @R13, SP
PORT2_ISR_2
POPALL
reti ; return from interrupt
COMMON INTVEC
ORG PORT2_VECTOR
PORT2_VEC DW PORT2_ISR
END
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -