📄 os_time.lst
字号:
##############################################################################
# #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 KICKSTART 13/Mar/2009 16:01:04 #
# Copyright 1999-2005 IAR Systems. All rights reserved. #
# #
# Cpu mode = thumb #
# Endian = little #
# Stack alignment = 4 #
# Source file = E:\UC_OS\Micrium\Software\uCOS-II\Source\os_time.c #
# Command line = E:\UC_OS\Micrium\Software\uCOS-II\Source\os_time.c #
# -lCN E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210 #
# B-EVAL\IAR\OS-Probe\Flash\List\ -o #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\Flash\Obj\ -z6 --no_unroll #
# --no_inline --no_tbaa --no_scheduling --debug #
# --cpu_mode thumb --endian little --cpu cortex-M3 #
# --stack_align 4 -e --fpu None --dlib_config #
# "C:\Program Files\IAR Systems\Embedded Workbench #
# 4.0 Kickstart\arm\LIB\dl7mptnnl8n.h" -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\ -I E:\UC_OS\Micrium\Software\EvalBoa #
# rds\ST\STM3210B-EVAL\IAR\OS-Probe\..\..\..\..\..\uco #
# s-ii\ports\arm-cortex-m3\generic\iar\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\ucos-ii\source\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uc-lib\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uc-cpu\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uc-cpu\ARM-Cortex-M3\I #
# AR\ -I E:\UC_OS\Micrium\Software\EvalBoards\ST\STM32 #
# 10B-EVAL\IAR\OS-Probe\..\..\..\..\..\cpu\st\stm32\in #
# c\ -I E:\UC_OS\Micrium\Software\EvalBoards\ST\STM321 #
# 0B-EVAL\IAR\OS-Probe\..\BSP\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
# ication\Generic\RS-232\Source\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
# ication\Generic\RS-232\Ports\ST\STM32\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
# ication\Generic\Source\ -I #
# E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Plugin #
# s\uCOS-II\ -I "C:\Program Files\IAR #
# Systems\Embedded Workbench 4.0 Kickstart\arm\INC\" #
# List file = E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\Flash\List\os_time.lst #
# Object file = E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
# L\IAR\OS-Probe\Flash\Obj\os_time.r79 #
# #
# #
##############################################################################
E:\UC_OS\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-2007, Jean J. Labrosse, Weston, FL
8 * All Rights Reserved
9 *
10 * File : OS_TIME.C
11 * By : Jean J. Labrosse
12 * Version : V2.85
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 (n from 0 to 65535)
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 segment CODE, align 4, keep-with-next
44 void OSTimeDly (INT16U ticks)
45 {
\ OSTimeDly:
\ 00000000 30B5 PUSH {R4,R5,LR}
\ 00000002 0400 MOVS R4,R0
46 INT8U y;
47 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
48 OS_CPU_SR cpu_sr = 0;
49 #endif
50
51
52
53 if (OSIntNesting > 0) { /* See if trying to call from an ISR */
\ 00000004 .... LDR.N R0,??DataTable3 ;; OSIntNesting
\ 00000006 0078 LDRB R0,[R0, #+0]
\ 00000008 0028 CMP R0,#+0
\ 0000000A 18D1 BNE.N ??OSTimeDly_0
54 return;
55 }
56 if (ticks > 0) { /* 0 means no delay! */
\ 0000000C 002C CMP R4,#+0
\ 0000000E 16D0 BEQ.N ??OSTimeDly_0
57 OS_ENTER_CRITICAL();
\ 00000010 ........ _BLF OS_CPU_SR_Save,??OS_CPU_SR_Save??rT
58 y = OSTCBCur->OSTCBY; /* Delay current task */
\ 00000014 0A49 LDR.N R1,??OSTimeDly_1 ;; OSTCBCur
\ 00000016 0968 LDR R1,[R1, #+0]
\ 00000018 2A31 ADDS R1,R1,#+42
\ 0000001A 8A79 LDRB R2,[R1, #+6]
59 OSRdyTbl[y] &= ~OSTCBCur->OSTCBBitX;
\ 0000001C .... LDR.N R3,??DataTable5 ;; OSRdyTbl
\ 0000001E 9A18 ADDS R2,R3,R2
\ 00000020 1378 LDRB R3,[R2, #+0]
\ 00000022 CD79 LDRB R5,[R1, #+7]
\ 00000024 AB43 BICS R3,R3,R5
\ 00000026 1370 STRB R3,[R2, #+0]
60 if (OSRdyTbl[y] == 0) {
\ 00000028 04D1 BNE.N ??OSTimeDly_2
61 OSRdyGrp &= ~OSTCBCur->OSTCBBitY;
\ 0000002A .... LDR.N R2,??DataTable4 ;; OSRdyGrp
\ 0000002C 1378 LDRB R3,[R2, #+0]
\ 0000002E 0D7A LDRB R5,[R1, #+8]
\ 00000030 AB43 BICS R3,R3,R5
\ 00000032 1370 STRB R3,[R2, #+0]
62 }
63 OSTCBCur->OSTCBDly = ticks; /* Load ticks in TCB */
\ ??OSTimeDly_2:
\ 00000034 0C80 STRH R4,[R1, #+0]
64 OS_EXIT_CRITICAL();
\ 00000036 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rT
65 OS_Sched(); /* Find next task to run! */
\ 0000003A ........ _BLF OS_Sched,??OS_Sched??rT
\ ??OSTimeDly_0:
\ 0000003E 30BD POP {R4,R5,PC} ;; return
\ ??OSTimeDly_1:
\ 00000040 ........ DC32 OSTCBCur
66 }
67 }
68 /*$PAGE*/
69 /*
70 *********************************************************************************************************
71 * DELAY TASK FOR SPECIFIED TIME
72 *
73 * Description: This function is called to delay execution of the currently running task until some time
74 * expires. This call allows you to specify the delay time in HOURS, MINUTES, SECONDS and
75 * MILLISECONDS instead of ticks.
76 *
77 * Arguments : hours specifies the number of hours that the task will be delayed (max. is 255)
78 * minutes specifies the number of minutes (max. 59)
79 * seconds specifies the number of seconds (max. 59)
80 * milli specifies the number of milliseconds (max. 999)
81 *
82 * Returns : OS_ERR_NONE
83 * OS_ERR_TIME_INVALID_MINUTES
84 * OS_ERR_TIME_INVALID_SECONDS
85 * OS_ERR_TIME_INVALID_MS
86 * OS_ERR_TIME_ZERO_DLY
87 * OS_ERR_TIME_DLY_ISR
88 *
89 * Note(s) : The resolution on the milliseconds depends on the tick rate. For example, you can't do
90 * a 10 mS delay if the ticker interrupts every 100 mS. In this case, the delay would be
91 * set to 0. The actual delay is rounded to the nearest tick.
92 *********************************************************************************************************
93 */
94
95 #if OS_TIME_DLY_HMSM_EN > 0
\ In segment CODE, align 4, keep-with-next
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -