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

📄 os_time.lst

📁 ARM仿真案例
💻 LST
📖 第 1 页 / 共 3 页
字号:
##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.40A/W32 EVALUATION    21/Jul/2006  22:36:58 #
# Copyright 1999-2005 IAR Systems. All rights reserved.                      #
# Time limited license: 21 days left                                         #
#                                                                            #
#    Cpu mode        =  interwork                                            #
#    Endian          =  little                                               #
#    Stack alignment =  4                                                    #
#    Source file     =  E:\Project\ucos-ii\pwm\uCOS-II\os_time.c             #
#    Command line    =  E:\Project\ucos-ii\pwm\uCOS-II\os_time.c -lCN        #
#                       E:\Project\ucos-ii\pwm\Debug\List\ -lA               #
#                       E:\Project\ucos-ii\pwm\Debug\List\ -o                #
#                       E:\Project\ucos-ii\pwm\Debug\Obj\ -z3 --no_cse       #
#                       --no_unroll --no_inline --no_code_motion --no_tbaa   #
#                       --no_clustering --no_scheduling --debug --cpu_mode   #
#                       thumb --endian little --cpu ARM7TDMI-S               #
#                       --stack_align 4 --interwork -e --fpu None            #
#                       --dlib_config "E:\Program Files\IAR                  #
#                       Systems\Embedded Workbench 4.0                       #
#                       Evaluation\ARM\LIB\dl4tptinl8n.h" -I                 #
#                       E:\Project\ucos-ii\pwm\ -I                           #
#                       E:\Project\ucos-ii\pwm\App\ -I                       #
#                       E:\Project\ucos-ii\pwm\ARM\ -I                       #
#                       E:\Project\ucos-ii\pwm\BSP\ -I                       #
#                       E:\Project\ucos-ii\pwm\uCOS-II\ -I "E:\Program       #
#                       Files\IAR Systems\Embedded Workbench 4.0             #
#                       Evaluation\ARM\INC\"                                 #
#    List file       =  E:\Project\ucos-ii\pwm\Debug\List\os_time.lst        #
#    Object file     =  E:\Project\ucos-ii\pwm\Debug\Obj\os_time.r79         #
#                                                                            #
#                                                                            #
##############################################################################

E:\Project\ucos-ii\pwm\uCOS-II\os_time.c
      1          /*
      2          *********************************************************************************************************
      3          *                                                uC/OS-II
      4          *                                          The Real-Time Kernel
      5          *                                             TIME MANAGEMENT
      6          *
      7          *                          (c) Copyright 1992-2003, 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 <ucos_ii.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          

   \                                 In segment CODE, align 4, keep-with-next
     35          void  OSTimeDly (INT16U ticks)
     36          {
   \                     OSTimeDly:
   \   00000000   30B5               PUSH     {R4,R5,LR}
   \   00000002   0400               MOVS     R4,R0
     37          #if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
     38              OS_CPU_SR  cpu_sr;
     39          #endif    
     40              INT8U      y;
     41          
     42          
     43              if (ticks > 0) {                             /* 0 means no delay!                                  */
   \   00000004   012C               CMP      R4,#+1
   \   00000006   26D3               BCC      ??OSTimeDly_0
     44                  OS_ENTER_CRITICAL();
   \   00000008   ........           _BLF     OS_CPU_SR_Save,??OS_CPU_SR_Save??rT
     45                  y            =  OSTCBCur->OSTCBY;        /* Delay current task                                 */
   \   0000000C   1349               LDR      R1,??OSTimeDly_1  ;; OSTCBCur
   \   0000000E   0968               LDR      R1,[R1, #+0]
   \   00000010   2F31               ADDS     R1,R1,#+47
   \   00000012   0978               LDRB     R1,[R1, #+0]
     46                  OSRdyTbl[y] &= ~OSTCBCur->OSTCBBitX;
   \   00000014   0906               LSLS     R1,R1,#+24       ;; ZeroExtS R1,R1,#+24,#+24
   \   00000016   090E               LSRS     R1,R1,#+24
   \   00000018   ....               LDR      R2,??DataTable8  ;; OSRdyTbl
   \   0000001A   0906               LSLS     R1,R1,#+24       ;; ZeroExtS R1,R1,#+24,#+24
   \   0000001C   090E               LSRS     R1,R1,#+24
   \   0000001E   ....               LDR      R3,??DataTable8  ;; OSRdyTbl
   \   00000020   5B5C               LDRB     R3,[R3, R1]
   \   00000022   0E4D               LDR      R5,??OSTimeDly_1  ;; OSTCBCur
   \   00000024   2D68               LDR      R5,[R5, #+0]
   \   00000026   3035               ADDS     R5,R5,#+48
   \   00000028   2D78               LDRB     R5,[R5, #+0]
   \   0000002A   AB43               BICS     R3,R3,R5
   \   0000002C   5354               STRB     R3,[R2, R1]
     47                  if (OSRdyTbl[y] == 0) {  
   \   0000002E   ....               LDR      R2,??DataTable8  ;; OSRdyTbl
   \   00000030   515C               LDRB     R1,[R2, R1]
   \   00000032   0029               CMP      R1,#+0
   \   00000034   08D1               BNE      ??OSTimeDly_2
     48                      OSRdyGrp &= ~OSTCBCur->OSTCBBitY;
   \   00000036   ....               LDR      R1,??DataTable6  ;; OSRdyGrp
   \   00000038   ....               LDR      R2,??DataTable6  ;; OSRdyGrp
   \   0000003A   1278               LDRB     R2,[R2, #+0]
   \   0000003C   074B               LDR      R3,??OSTimeDly_1  ;; OSTCBCur
   \   0000003E   1B68               LDR      R3,[R3, #+0]
   \   00000040   3133               ADDS     R3,R3,#+49
   \   00000042   1B78               LDRB     R3,[R3, #+0]
   \   00000044   9A43               BICS     R2,R2,R3
   \   00000046   0A70               STRB     R2,[R1, #+0]
     49                  }
     50                  OSTCBCur->OSTCBDly = ticks;              /* Load ticks in TCB                                  */
   \                     ??OSTimeDly_2:
   \   00000048   0449               LDR      R1,??OSTimeDly_1  ;; OSTCBCur
   \   0000004A   0968               LDR      R1,[R1, #+0]
   \   0000004C   4C85               STRH     R4,[R1, #+42]
     51                  OS_EXIT_CRITICAL();
   \   0000004E   ........           _BLF     OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rT
     52                  OS_Sched();                              /* Find next task to run!                             */
   \   00000052   ........           _BLF     OS_Sched,??OS_Sched??rT
     53              }
     54          }
   \                     ??OSTimeDly_0:
   \   00000056   30BC               POP      {R4,R5}
   \   00000058   01BC               POP      {R0}
   \   0000005A   0047               BX       R0               ;; return
   \                     ??OSTimeDly_1:
   \   0000005C   ........           DC32     OSTCBCur
     55          /*$PAGE*/
     56          /*
     57          *********************************************************************************************************
     58          *                                     DELAY TASK FOR SPECIFIED TIME
     59          *
     60          * Description: This function is called to delay execution of the currently running task until some time
     61          *              expires.  This call allows you to specify the delay time in HOURS, MINUTES, SECONDS and
     62          *              MILLISECONDS instead of ticks.
     63          *
     64          * Arguments  : hours     specifies the number of hours that the task will be delayed (max. is 255)
     65          *              minutes   specifies the number of minutes (max. 59)
     66          *              seconds   specifies the number of seconds (max. 59)
     67          *              milli     specifies the number of milliseconds (max. 999)
     68          *
     69          * Returns    : OS_NO_ERR
     70          *              OS_TIME_INVALID_MINUTES
     71          *              OS_TIME_INVALID_SECONDS
     72          *              OS_TIME_INVALID_MS
     73          *              OS_TIME_ZERO_DLY
     74          *
     75          * Note(s)    : The resolution on the milliseconds depends on the tick rate.  For example, you can't do
     76          *              a 10 mS delay if the ticker interrupts every 100 mS.  In this case, the delay would be
     77          *              set to 0.  The actual delay is rounded to the nearest tick.
     78          *********************************************************************************************************
     79          */
     80          
     81          #if OS_TIME_DLY_HMSM_EN > 0

   \                                 In segment CODE, align 4, keep-with-next
     82          INT8U  OSTimeDlyHMSM (INT8U hours, INT8U minutes, INT8U seconds, INT16U milli)
     83          {
   \                     OSTimeDlyHMSM:
   \   00000000   10B5               PUSH     {R4,LR}
     84              INT32U ticks;
     85              INT16U loops;
     86          
     87          
     88              if (hours == 0) {

⌨️ 快捷键说明

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