uarttx.s90

来自「移植到Atmega8515的uc/os,可应用于一些低端产品」· S90 代码 · 共 85 行

S90
85
字号
;********************************************************************************************************
;                                               uC/OS-II
;                                         The Real-Time Kernel
;
;                                          AVR Specific code
;                                      (IAR AA90 V1.30 or later)
;
;
; File     : UARTTX.S90
; By       : Ole Saether
;
; $Modtime: 12.06.01 16:56 $ 
; $Revision: 2 $
;
;********************************************************************************************************
;                                           I/O PORT ADDRESSES
;********************************************************************************************************

SREG    = 0x3F
SPH     = 0x3E
SPL     = 0x3D
TCNT0   = 0x32

;********************************************************************************************************
;                                          PUBLIC DECLARATIONS
;********************************************************************************************************

                NAME  UARTTX

;********************************************************************************************************
;                                         EXTERNAL DECLARATIONS
;********************************************************************************************************

                EXTERN  OSIntExit
                EXTERN  OSIntNesting
                EXTERN  UartTxHandler


#include        "ATMACRO.S90"

                RSEG    CODE

;********************************************************************************************************
;                                    Uart Transmit Complete ISR
;
; Description : This function is the Uart Transmit Complete handler. The actual work is done by the
;               function UartTxHandler in the file "test.c".
;
;
;********************************************************************************************************

UartTxIsr:      PUSHRS                              ; Save interrupted task's context
                IN      R16,SREG
                SBR     R16,0x80                    ; Set interrupt bit in status reg and save
                ST      -Y,R16
                PUSHSP
                
                LDS     R16,OSIntNesting            ; Notify uC/OS-II of ISR
                INC     R16                         ;
                STS     OSIntNesting,R16            ;             
                SEI
                
                RCALL   UartTxHandler

                RCALL   OSIntExit                   ; Notify uC/OS-II about end of ISR

                POPSP                               ; Restore interrupted task's context
                POPSREG
                POPRS
                RET                                 ; Note: RET instead of RETI                        

;********************************************************************************************************
;                                           INTVEC
;
; Description : Set up the AVR interrupt vector table so that the Uart Transmit Complete interrupt
;               vectors to the function above.
;
;********************************************************************************************************

                COMMON  INTVEC
                DS      22
                RJMP    UartTxIsr

                END

⌨️ 快捷键说明

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