📄 os_time.lst
字号:
###############################################################################
# #
# IAR ANSI C/C++ Compiler V6.10.2.52244/W32 for ARM 07/Aug/2011 12:10:31 #
# Copyright 1999-2010 IAR Systems AB. #
# #
# Cpu mode = thumb #
# Endian = little #
# Source file = F:\stm32\我的程序\Micrium\Software\uCOS-II\Source\os_tim #
# e.c #
# Command line = F:\stm32\我的程序\Micrium\Software\uCOS-II\Source\os_tim #
# e.c -D USE_STDPERIPH_DRIVER -D STM32F10X_CL -lCN #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Lis #
# t\ -o F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Fla #
# sh\Obj\ --no_cse --no_unroll --no_inline #
# --no_code_motion --no_tbaa --no_clustering #
# --no_scheduling --debug --endian=little --cpu=Cortex-M3 #
# -e --fpu=None --dlib_config #
# D:\arm\INC\c\DLib_Config_Normal.h -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\APP\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\ #
# -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP #
# \ST\CMSIS\CM3\CoreSupport\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\ST #
# \CMSIS\CM3\DeviceSupport\ST\STM32F10x\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\ST #
# \STM32F10x_StdPeriph_Driver\inc\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\uC #
# OS-II\ -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II #
# \..\..\uCOS-II\Ports\ARM-Cortex-M3\Generic\IAR\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\..\uCO #
# S-II\Source\ -I F:\stm32\我的程序\Micrium\Software\EWARM #
# \OS-II\..\..\uC-LIB\ -I F:\stm32\我的程序\Micrium\Softwa #
# re\EWARM\OS-II\..\..\uC-LIB\Ports\ARM-Cortex-M3\IAR\ -I #
# F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\..\uC- #
# CPU\ -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\. #
# .\..\uC-CPU\ARM-Cortex-M3\IAR\ -On --use_c++_inline #
# List file = F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Lis #
# t\os_time.lst #
# Object file = F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Obj #
# \os_time.o #
# #
# #
###############################################################################
F:\stm32\我的程序\Micrium\Software\uCOS-II\Source\os_time.c
1 /*
2 *********************************************************************************************************
3 * uC/OS-II
4 * The Real-Time Kernel
5 * TIME MANAGEMENT
6 *
7 * (c) Copyright 1992-2010, Micrium, Weston, FL
8 * All Rights Reserved
9 *
10 * File : OS_TIME.C
11 * By : Jean J. Labrosse
12 * Version : V2.92
13 *
14 * LICENSING TERMS:
15 * ---------------
16 * uC/OS-II is provided in source form for FREE evaluation, for educational use or for peaceful research.
17 * If you plan on using uC/OS-II in a commercial product you need to contact Micri祄 to properly license
18 * its use in your product. We provide ALL the source code for your convenience and to help you experience
19 * uC/OS-II. The fact that the source is provided does NOT mean that you can use it without paying a
20 * licensing fee.
21 *********************************************************************************************************
22 */
23
24 #ifndef OS_MASTER_FILE
25 #include <ucos_ii.h>
26 #endif
27
28 /*
29 *********************************************************************************************************
30 * DELAY TASK 'n' TICKS
31 *
32 * Description: This function is called to delay execution of the currently running task until the
33 * specified number of system ticks expires. This, of course, directly equates to delaying
34 * the current task for some time to expire. No delay will result If the specified delay is
35 * 0. If the specified delay is greater than 0 then, a context switch will result.
36 *
37 * Arguments : ticks is the time delay that the task will be suspended in number of clock 'ticks'.
38 * Note that by specifying 0, the task will not be delayed.
39 *
40 * Returns : none
41 *********************************************************************************************************
42 */
43
\ In section .text, align 2, keep-with-next
44 void OSTimeDly (INT32U ticks)
45 {
\ OSTimeDly:
\ 00000000 70B5 PUSH {R4-R6,LR}
\ 00000002 0400 MOVS R4,R0
46 INT8U y;
47 #if OS_CRITICAL_METHOD == 3u /* Allocate storage for CPU status register */
48 OS_CPU_SR cpu_sr = 0u;
\ 00000004 0026 MOVS R6,#+0
49 #endif
50
51
52
53 if (OSIntNesting > 0u) { /* See if trying to call from an ISR */
\ 00000006 .... LDR.N R0,??DataTable4
\ 00000008 0078 LDRB R0,[R0, #+0]
\ 0000000A 0028 CMP R0,#+0
\ 0000000C 2ED1 BNE.N ??OSTimeDly_0
54 return;
55 }
56 if (OSLockNesting > 0u) { /* See if called with scheduler locked */
\ ??OSTimeDly_1:
\ 0000000E .... LDR.N R0,??DataTable4_1
\ 00000010 0078 LDRB R0,[R0, #+0]
\ 00000012 0028 CMP R0,#+0
\ 00000014 2AD1 BNE.N ??OSTimeDly_0
57 return;
58 }
59 if (ticks > 0u) { /* 0 means no delay! */
\ ??OSTimeDly_2:
\ 00000016 002C CMP R4,#+0
\ 00000018 28D0 BEQ.N ??OSTimeDly_3
60 OS_ENTER_CRITICAL();
\ 0000001A ........ BL OS_CPU_SR_Save
\ 0000001E 0600 MOVS R6,R0
61 y = OSTCBCur->OSTCBY; /* Delay current task */
\ 00000020 .... LDR.N R0,??DataTable4_2
\ 00000022 0068 LDR R0,[R0, #+0]
\ 00000024 90F83800 LDRB R0,[R0, #+56]
\ 00000028 0500 MOVS R5,R0
62 OSRdyTbl[y] &= (OS_PRIO)~OSTCBCur->OSTCBBitX;
\ 0000002A EDB2 UXTB R5,R5 ;; ZeroExt R5,R5,#+24,#+24
\ 0000002C .... LDR.N R0,??DataTable4_3
\ 0000002E 285C LDRB R0,[R5, R0]
\ 00000030 .... LDR.N R1,??DataTable4_2
\ 00000032 0968 LDR R1,[R1, #+0]
\ 00000034 91F83910 LDRB R1,[R1, #+57]
\ 00000038 8843 BICS R0,R0,R1
\ 0000003A EDB2 UXTB R5,R5 ;; ZeroExt R5,R5,#+24,#+24
\ 0000003C .... LDR.N R1,??DataTable4_3
\ 0000003E 6854 STRB R0,[R5, R1]
63 if (OSRdyTbl[y] == 0u) {
\ 00000040 EDB2 UXTB R5,R5 ;; ZeroExt R5,R5,#+24,#+24
\ 00000042 .... LDR.N R0,??DataTable4_3
\ 00000044 285C LDRB R0,[R5, R0]
\ 00000046 0028 CMP R0,#+0
\ 00000048 08D1 BNE.N ??OSTimeDly_4
64 OSRdyGrp &= (OS_PRIO)~OSTCBCur->OSTCBBitY;
\ 0000004A .... LDR.N R0,??DataTable4_4
\ 0000004C 0078 LDRB R0,[R0, #+0]
\ 0000004E .... LDR.N R1,??DataTable4_2
\ 00000050 0968 LDR R1,[R1, #+0]
\ 00000052 91F83A10 LDRB R1,[R1, #+58]
\ 00000056 8843 BICS R0,R0,R1
\ 00000058 .... LDR.N R1,??DataTable4_4
\ 0000005A 0870 STRB R0,[R1, #+0]
65 }
66 OSTCBCur->OSTCBDly = ticks; /* Load ticks in TCB */
\ ??OSTimeDly_4:
\ 0000005C .... LDR.N R0,??DataTable4_2
\ 0000005E 0068 LDR R0,[R0, #+0]
\ 00000060 0463 STR R4,[R0, #+48]
67 OS_EXIT_CRITICAL();
\ 00000062 3000 MOVS R0,R6
\ 00000064 ........ BL OS_CPU_SR_Restore
68 OS_Sched(); /* Find next task to run! */
\ 00000068 ........ BL OS_Sched
69 }
70 }
\ ??OSTimeDly_3:
\ ??OSTimeDly_0:
\ 0000006C 70BD POP {R4-R6,PC} ;; return
71 /*$PAGE*/
72 /*
73 *********************************************************************************************************
74 * DELAY TASK FOR SPECIFIED TIME
75 *
76 * Description: This function is called to delay execution of the currently running task until some time
77 * expires. This call allows you to specify the delay time in HOURS, MINUTES, SECONDS and
78 * MILLISECONDS instead of ticks.
79 *
80 * Arguments : hours specifies the number of hours that the task will be delayed (max. is 255)
81 * minutes specifies the number of minutes (max. 59)
82 * seconds specifies the number of seconds (max. 59)
83 * ms specifies the number of milliseconds (max. 999)
84 *
85 * Returns : OS_ERR_NONE
86 * OS_ERR_TIME_INVALID_MINUTES
87 * OS_ERR_TIME_INVALID_SECONDS
88 * OS_ERR_TIME_INVALID_MS
89 * OS_ERR_TIME_ZERO_DLY
90 * OS_ERR_TIME_DLY_ISR
91 *
92 * Note(s) : The resolution on the milliseconds depends on the tick rate. For example, you can't do
93 * a 10 mS delay if the ticker interrupts every 100 mS. In this case, the delay would be
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -