📄 os_tmr.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_tmr #
# .c #
# Command line = F:\stm32\我的程序\Micrium\Software\uCOS-II\Source\os_tmr #
# .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_tmr.lst #
# Object file = F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Obj #
# \os_tmr.o #
# #
# #
###############################################################################
F:\stm32\我的程序\Micrium\Software\uCOS-II\Source\os_tmr.c
1 /*
2 ************************************************************************************************************************
3 * uC/OS-II
4 * The Real-Time Kernel
5 * TIMER MANAGEMENT
6 *
7 * (c) Copyright 1992-2010, Micrium, Weston, FL
8 * All Rights Reserved
9 *
10 *
11 * File : OS_TMR.C
12 * By : Jean J. Labrosse
13 * Version : V2.92
14 *
15 * LICENSING TERMS:
16 * ---------------
17 * uC/OS-II is provided in source form for FREE evaluation, for educational use or for peaceful research.
18 * If you plan on using uC/OS-II in a commercial product you need to contact Micri祄 to properly license
19 * its use in your product. We provide ALL the source code for your convenience and to help you experience
20 * uC/OS-II. The fact that the source is provided does NOT mean that you can use it without paying a
21 * licensing fee.
22 ************************************************************************************************************************
23 */
24
25 #include <ucos_ii.h>
26
27 /*
28 ************************************************************************************************************************
29 * NOTES
30 *
31 * 1) Your application MUST define the following #define constants:
32 *
33 * OS_TASK_TMR_PRIO The priority of the Timer management task
34 * OS_TASK_TMR_STK_SIZE The size of the Timer management task's stack
35 *
36 * 2) You must call OSTmrSignal() to notify the Timer management task that it's time to update the timers.
37 ************************************************************************************************************************
38 */
39
40 /*
41 ************************************************************************************************************************
42 * CONSTANTS
43 ************************************************************************************************************************
44 */
45
46 #define OS_TMR_LINK_DLY 0u
47 #define OS_TMR_LINK_PERIODIC 1u
48
49 /*
50 ************************************************************************************************************************
51 * LOCAL PROTOTYPES
52 ************************************************************************************************************************
53 */
54
55 #if OS_TMR_EN > 0u
56 static OS_TMR *OSTmr_Alloc (void);
57 static void OSTmr_Free (OS_TMR *ptmr);
58 static void OSTmr_InitTask (void);
59 static void OSTmr_Link (OS_TMR *ptmr, INT8U type);
60 static void OSTmr_Unlink (OS_TMR *ptmr);
61 static void OSTmr_Task (void *p_arg);
62 #endif
63
64 /*$PAGE*/
65 /*
66 ************************************************************************************************************************
67 * CREATE A TIMER
68 *
69 * Description: This function is called by your application code to create a timer.
70 *
71 * Arguments : dly Initial delay.
72 * If the timer is configured for ONE-SHOT mode, this is the timeout used
73 * If the timer is configured for PERIODIC mode, this is the first timeout to wait for
74 * before the timer starts entering periodic mode
75 *
76 * period The 'period' being repeated for the timer.
77 * If you specified 'OS_TMR_OPT_PERIODIC' as an option, when the timer expires, it will
78 * automatically restart with the same period.
79 *
80 * opt Specifies either:
81 * OS_TMR_OPT_ONE_SHOT The timer counts down only once
82 * OS_TMR_OPT_PERIODIC The timer counts down and then reloads itself
83 *
84 * callback Is a pointer to a callback function that will be called when the timer expires. The
85 * callback function must be declared as follows:
86 *
87 * void MyCallback (OS_TMR *ptmr, void *p_arg);
88 *
89 * callback_arg Is an argument (a pointer) that is passed to the callback function when it is called.
90 *
91 * pname Is a pointer to an ASCII string that is used to name the timer. Names are useful for
92 * debugging.
93 *
94 * perr Is a pointer to an error code. '*perr' will contain one of the following:
95 * OS_ERR_NONE
96 * OS_ERR_TMR_INVALID_DLY you specified an invalid delay
97 * OS_ERR_TMR_INVALID_PERIOD you specified an invalid period
98 * OS_ERR_TMR_INVALID_OPT you specified an invalid option
99 * OS_ERR_TMR_ISR if the call was made from an ISR
100 * OS_ERR_TMR_NON_AVAIL if there are no free timers from the timer pool
101 *
102 * Returns : A pointer to an OS_TMR data structure.
103 * This is the 'handle' that your application will use to reference the timer created.
104 ************************************************************************************************************************
105 */
106
107 #if OS_TMR_EN > 0u
\ In section .text, align 2, keep-with-next
108 OS_TMR *OSTmrCreate (INT32U dly,
109 INT32U period,
110 INT8U opt,
111 OS_TMR_CALLBACK callback,
112 void *callback_arg,
113 INT8U *pname,
114 INT8U *perr)
115 {
\ OSTmrCreate:
\ 00000000 2DE9F84F PUSH {R3-R11,LR}
\ 00000004 0400 MOVS R4,R0
\ 00000006 0D00 MOVS R5,R1
\ 00000008 1600 MOVS R6,R2
\ 0000000A 1F00 MOVS R7,R3
\ 0000000C DDF82880 LDR R8,[SP, #+40]
\ 00000010 DDF82C90 LDR R9,[SP, #+44]
\ 00000014 DDF830A0 LDR R10,[SP, #+48]
116 OS_TMR *ptmr;
117
118
119 #ifdef OS_SAFETY_CRITICAL
120 if (perr == (INT8U *)0) {
121 OS_SAFETY_CRITICAL_EXCEPTION();
122 return ((OS_TMR *)0);
123 }
124 #endif
125
126 #ifdef OS_SAFETY_CRITICAL_IEC61508
127 if (OSSafetyCriticalStartFlag == OS_TRUE) {
128 OS_SAFETY_CRITICAL_EXCEPTION();
129 return ((OS_TMR *)0);
130 }
131 #endif
132
133 #if OS_ARG_CHK_EN > 0u
134 switch (opt) { /* Validate arguments */
135 case OS_TMR_OPT_PERIODIC:
136 if (period == 0u) {
137 *perr = OS_ERR_TMR_INVALID_PERIOD;
138 return ((OS_TMR *)0);
139 }
140 break;
141
142 case OS_TMR_OPT_ONE_SHOT:
143 if (dly == 0u) {
144 *perr = OS_ERR_TMR_INVALID_DLY;
145 return ((OS_TMR *)0);
146 }
147 break;
148
149 default:
150 *perr = OS_ERR_TMR_INVALID_OPT;
151 return ((OS_TMR *)0);
152 }
153 #endif
154 if (OSIntNesting > 0u) { /* See if trying to call from an ISR */
\ 00000018 ........ LDR.W R0,??DataTable18_1
\ 0000001C 0078 LDRB R0,[R0, #+0]
\ 0000001E 0028 CMP R0,#+0
\ 00000020 04D0 BEQ.N ??OSTmrCreate_0
155 *perr = OS_ERR_TMR_ISR;
\ 00000022 8B20 MOVS R0,#+139
\ 00000024 8AF80000 STRB R0,[R10, #+0]
156 return ((OS_TMR *)0);
\ 00000028 0020 MOVS R0,#+0
\ 0000002A 2AE0 B.N ??OSTmrCreate_1
157 }
158 OSSchedLock();
\ ??OSTmrCreate_0:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -