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

📄 os_time.lst

📁 ucos2.52在msp430上移植
💻 LST
📖 第 1 页 / 共 4 页
字号:
##############################################################################
#                                                                            #
# IAR MSP430 C-Compiler V1.26A/WIN                                           #
#                                                                            #
# Time limited license: 29 days left                                         #
#                                                                            #
#       Compile time  =  30/Sep/2002  18:04:15                               #
#       Target option =  SP430x31x                                           #
#       Memory model  =  small                                               #
#       Source file   =  c:\software\ucos-ii\source\os_time.c                #
#       List file     =  j:\software\ucos-ii\ti-msp430\iar\source\debug\list\os_time.lst#
#       Object file   =  j:\software\ucos-ii\ti-msp430\iar\source\debug\obj\os_time.r43#
#       ASM file      =  j:\software\ucos-ii\ti-msp430\iar\source\debug\list\os_time.s43#
#       Command line  =  -OJ:\SOFTWARE\UCOS-II\TI-MSP430\IAR\SOURCE\Debug\Obj\ #
#                        -e -K -gA -s6 -RCODE -r0                            #
#                        -LJ:\SOFTWARE\UCOS-II\TI-MSP430\IAR\SOURCE\Debug\List\ #
#                        -q -t8 -x                                           #
#                        -AJ:\SOFTWARE\UCOS-II\TI-MSP430\IAR\SOURCE\Debug\List\ #
#                        -X -IC:\PROGRA~1\IARSYS~1\ew23\430\inc\             #
#                        -I\software\ucos-ii\ti-msp430\iar\source\           #
#                        -I\software\ucos-ii\source\                         #
#                        C:\SOFTWARE\uCOS-II\SOURCE\OS_TIME.C                #
#                                                                            #
#                           Copyright 1996-2002 IAR Systems. All rights reserved. #
##############################################################################


extern  INT8U  const      OSMapTbl[];               /* Priority->Bit Mask lookup table                 */
-----------------------------------^
"c:\software\ucos-ii\source\ucos_ii.h",481  Warning[27]: Size of "extern" object 'OSMapTbl' is unknown

extern  INT8U  const      OSUnMapTbl[];             /* Priority->Index    lookup table                 */
-------------------------------------^
"c:\software\ucos-ii\source\ucos_ii.h",482  Warning[27]: Size of "extern" object 'OSUnMapTbl' is unknown
   \   0000                    NAME    os_time(16)
   \   0000                    RSEG    CODE(1)
   \   0000                    EXTERN  OSRdyGrp
   \   0000                    EXTERN  OSRdyTbl
   \   0000                    EXTERN  OSTCBCur
   \   0000                    EXTERN  OSTCBPrioTbl
   \   0000                    EXTERN  OSTime
   \   0000                    PUBLIC  OSTimeDly
   \   0000                    PUBLIC  OSTimeDlyHMSM
   \   0000                    PUBLIC  OSTimeDlyResume
   \   0000                    PUBLIC  OSTimeGet
   \   0000                    PUBLIC  OSTimeSet
   \   0000                    EXTERN  OS_Sched
   \   0000                    EXTERN  ?CL430_1_26_L08
   \   0000                    EXTERN  ?L_MUL_L03
   \   0000                    EXTERN  ?UL_DIVMOD_L03
   \   0000                    RSEG    CODE
   \   0000            OSTimeDly:
      1          /*
      2          *********************************************************************************************************
      3          *                                                uC/OS-II
      4          *                                          The Real-Time Kernel
      5          *                                             TIME MANAGEMENT
      6          *
      7          *                          (c) Copyright 1992-2002, Jean J. Labrosse, Weston, FL
      8          *                                           All Rights Reserved
      9          *
     10          * File : OS_TIME.C
     11          * By   : Jean J. Labrosse
     12          *********************************************************************************************************
     13          */
     14          
     15          #ifndef  OS_MASTER_FILE
     16          #include "includes.h"
     17          #endif
     18          
     19          /*
     20          *********************************************************************************************************
     21          *                                DELAY TASK 'n' TICKS   (n from 0 to 65535)
     22          *
     23          * Description: This function is called to delay execution of the currently running task until the
     24          *              specified number of system ticks expires.  This, of course, directly equates to delaying
     25          *              the current task for some time to expire.  No delay will result If the specified delay is
     26          *              0.  If the specified delay is greater than 0 then, a context switch will result.
     27          *
     28          * Arguments  : ticks     is the time delay that the task will be suspended in number of clock 'ticks'.
     29          *                        Note that by specifying 0, the task will not be delayed.
     30          *
     31          * Returns    : none
     32          *********************************************************************************************************
     33          */
     34          
     35          void  OSTimeDly (INT16U ticks)
     36          {
     37          #if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
     38              OS_CPU_SR  cpu_sr;
     39          #endif    
     40          
     41          
     42              if (ticks > 0) {                                                      /* 0 means no delay!         */
   \   0000  0C93              CMP     #0,R12  
   \   0002  1D24              JEQ     (?0057) 
     43                  OS_ENTER_CRITICAL();
   \   0004  32C2              DINT            
     44                  if ((OSRdyTbl[OSTCBCur->OSTCBY] &= ~OSTCBCur->OSTCBBitX) == 0) {  /* Delay current task        */
   \   0006  1D420000          MOV     &OSTCBCur,R13   
   \   000A  5D4D1F00          MOV.B   31(R13),R13     
   \   000E  1E420000          MOV     &OSTCBCur,R14   
   \   0012  5E4E2000          MOV.B   32(R14),R14     
   \   0016  7EE3              XOR.B   #-1,R14 
   \   0018  CDFE0000          AND.B   R14,OSRdyTbl(R13)       
   \   001C  CD930000          CMP.B   #0,OSRdyTbl(R13)        
   \   0020  0720              JNE     (?0059) 
     45                      OSRdyGrp &= ~OSTCBCur->OSTCBBitY;
   \   0022  1D420000          MOV     &OSTCBCur,R13   
   \   0026  5D4D2100          MOV.B   33(R13),R13     
   \   002A  7DE3              XOR.B   #-1,R13 
   \   002C  C2FD0000          AND.B   R13,&OSRdyGrp   
   \   0030            ?0059:
     46                  }
     47                  OSTCBCur->OSTCBDly = ticks;                                       /* Load ticks in TCB         */
   \   0030  1D420000          MOV     &OSTCBCur,R13   
   \   0034  8D4C1A00          MOV     R12,26(R13)     
     48                  OS_EXIT_CRITICAL();
   \   0038  32D2              EINT            
     49                  OS_Sched();                                                       /* Find next task to run!    */
   \   003A  B0120000          CALL    #OS_Sched       
   \   003E            ?0057:
     50              }
     51          }
   \   003E  3041              RET             
   \   0040            OSTimeDlyHMSM:
     52          /*$PAGE*/
     53          /*
     54          *********************************************************************************************************
     55          *                                     DELAY TASK FOR SPECIFIED TIME
     56          *
     57          * Description: This function is called to delay execution of the currently running task until some time
     58          *              expires.  This call allows you to specify the delay time in HOURS, MINUTES, SECONDS and
     59          *              MILLISECONDS instead of ticks.
     60          *
     61          * Arguments  : hours     specifies the number of hours that the task will be delayed (max. is 255)
     62          *              minutes   specifies the number of minutes (max. 59)
     63          *              seconds   specifies the number of seconds (max. 59)
     64          *              milli     specifies the number of milliseconds (max. 999)
     65          *
     66          * Returns    : OS_NO_ERR
     67          *              OS_TIME_INVALID_MINUTES
     68          *              OS_TIME_INVALID_SECONDS
     69          *              OS_TIME_INVALID_MS
     70          *              OS_TIME_ZERO_DLY
     71          *
     72          * Note(s)    : The resolution on the milliseconds depends on the tick rate.  For example, you can't do
     73          *              a 10 mS delay if the ticker interrupts every 100 mS.  In this case, the delay would be
     74          *              set to 0.  The actual delay is rounded to the nearest tick.
     75          *********************************************************************************************************
     76          */
     77          
     78          #if OS_TIME_DLY_HMSM_EN > 0
     79          INT8U  OSTimeDlyHMSM (INT8U hours, INT8U minutes, INT8U seconds, INT16U milli)
     80          {
   \   0040  0A12              PUSH    R10     
   \   0042  0B12              PUSH    R11     
   \   0044  0812              PUSH    R8      
   \   0046  0912              PUSH    R9      
   \   0048  0612              PUSH    R6      
   \   004A  0712              PUSH    R7      
   \   004C  4B4C              MOV.B   R12,R11 
   \   004E  4A4E              MOV.B   R14,R10 
   \   0050  1C411000          MOV     16(SP),R12      
   \   0054  56410E00          MOV.B   14(SP),R6       
     81              INT32U ticks;
     82              INT16U loops;
     83          
     84          
     85              if (hours > 0 || minutes > 0 || seconds > 0 || milli > 0) {
   \   0058  4B93              CMP.B   #0,R11  
   \   005A  0620              JNE     (?0062) 
   \   005C  4A93              CMP.B   #0,R10  
   \   005E  0420              JNE     (?0062) 
   \   0060  4693              CMP.B   #0,R6   
   \   0062  0220              JNE     (?0062) 
   \   0064  0C93              CMP     #0,R12  
   \   0066  5024              JEQ     (?0061) 
   \   0068            ?0062:
     86                  if (minutes > 59) {
   \   0068  7A903C00          CMP.B   #60,R10 
   \   006C  0328              JNC     (?0065) 
     87                      return (OS_TIME_INVALID_MINUTES);    /* Validate arguments to be within range              */
   \   006E  7C405100          MOV.B   #81,R12 
     88                  }
   \   0072  4C3C              JMP     (?0073) 
   \   0074            ?0065:
     89                  if (seconds > 59) {
   \   0074  76903C00          CMP.B   #60,R6  
   \   0078  0328              JNC     (?0067) 
     90                      return (OS_TIME_INVALID_SECONDS);
   \   007A  7C405200          MOV.B   #82,R12 
     91                  }
   \   007E  463C              JMP     (?0073) 

⌨️ 快捷键说明

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