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

📄 bsp_a.s

📁 Proteus在MCS-51%26ARM7系统中的应用百例 Proteus在MCS-51%26ARM7系统中的应用百例
💻 S
字号:
;********************************************************************************************************
;                                               uC/OS-II
;                                         The Real-Time Kernel
;
;                          (c) Copyright 1992-2004, Jean J. Labrosse, Weston, FL
;                                          All Rights Reserved
;
;                                       AT91 BOARD SUPPORT PACKAGE
;                                            IAR C Compiler
;
; File : BSP_A.ASM
; By   : Jean J. Labrosse
;********************************************************************************************************

        EXTERN  OSIntCtxSwFlag

        EXTERN  OSIntEnter
        EXTERN  OSIntExit
        EXTERN  OS_IntCtxSw

        EXTERN  Tmr_TickISR_Handler


        PUBLIC  Tmr_TickISR


;*********************************************************************************************************
;                                            TICK HANDLER
;
; Description:  This handles all the Timer #0 interrupt which is used to generate the uC/OS-II tick.
;*********************************************************************************************************

        RSEG CODE:CODE:NOROOT(2)
        CODE32

Tmr_TickISR

        STMFD   SP!,{R0-R3,R12,LR}

        BL      OSIntEnter              ; Indicate beginning of ISR
        BL      Tmr_TickISR_Handler     ; Handle interrupt (see BSP.C)
        BL      OSIntExit               ; Indicate end of ISR

        LDR     R0,??OS_IntCtxSwFlag    ; See if we need to do a context switch
        LDR     R1,[R0]
        CMP     R1,#1
        BEQ     OS_IntCtxSw             ; Yes, Switch to Higher Priority Task

        LDMFD   SP!,{R0-R3,R12,LR}      ; No,  Restore registers of interrupted task's stack
        SUBS    PC,LR,#4                ; Return from IRQ

;*********************************************************************************************************
;                                     POINTERS TO VARIABLES
;*********************************************************************************************************

        DATA
             
??OS_IntCtxSwFlag:
        DC32    OSIntCtxSwFlag

        END

⌨️ 快捷键说明

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