📄 os_flag.lst
字号:
\ ??OSFlagAccept_4:
\ 0000002A 4846 MOV R0,R9
\ 0000002C 3070 STRB R0,[R6, #+0]
125 OS_ENTER_CRITICAL();
\ 0000002E ........ _BLF OS_CPU_SR_Save,??OS_CPU_SR_Save??rT
126 switch (wait_type) {
\ 00000032 032D CMP R5,#+3
\ 00000034 38D8 BHI.N ??OSFlagAccept_5
\ 00000036 DFE805F0 TBB [PC, R5]
\ ??OSFlagAccept_0:
\ 0000003A 1F2D0215 DC8 +31,+45,+2,+21
127 case OS_FLAG_WAIT_SET_ALL: /* See if all required flags are set */
128 flags_rdy = (OS_FLAGS)(pgrp->OSFlagFlags & flags); /* Extract only the bits we want */
\ ??OSFlagAccept_6:
\ 0000003E 2189 LDRH R1,[R4, #+8]
\ 00000040 18EA0105 ANDS R5,R8,R1
129 if (flags_rdy == flags) { /* Must match ALL the bits that we want */
\ 00000044 2900 MOVS R1,R5
\ 00000046 4246 MOV R2,R8
\ 00000048 9142 CMP R1,R2
\ 0000004A 06D1 BNE.N ??OSFlagAccept_7
130 if (consume == OS_TRUE) { /* See if we need to consume the flags */
\ 0000004C 012F CMP R7,#+1
\ 0000004E 06D1 BNE.N ??OSFlagAccept_8
131 pgrp->OSFlagFlags &= ~flags_rdy; /* Clear ONLY the flags that we wanted */
\ 00000050 2189 LDRH R1,[R4, #+8]
\ 00000052 2A00 MOVS R2,R5
\ 00000054 9143 BICS R1,R1,R2
\ 00000056 2181 STRH R1,[R4, #+8]
\ 00000058 01E0 B.N ??OSFlagAccept_8
132 }
133 } else {
134 *perr = OS_ERR_FLAG_NOT_RDY;
\ ??OSFlagAccept_7:
\ 0000005A 7021 MOVS R1,#+112
\ 0000005C 3170 STRB R1,[R6, #+0]
135 }
136 OS_EXIT_CRITICAL();
\ ??OSFlagAccept_8:
\ 0000005E ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rT
\ 00000062 26E0 B.N ??OSFlagAccept_9
137 break;
138
139 case OS_FLAG_WAIT_SET_ANY:
140 flags_rdy = (OS_FLAGS)(pgrp->OSFlagFlags & flags); /* Extract only the bits we want */
\ ??OSFlagAccept_10:
\ 00000064 2189 LDRH R1,[R4, #+8]
\ 00000066 18EA0105 ANDS R5,R8,R1
141 if (flags_rdy != (OS_FLAGS)0) { /* See if any flag set */
\ 0000006A F6D0 BEQ.N ??OSFlagAccept_7
142 if (consume == OS_TRUE) { /* See if we need to consume the flags */
\ 0000006C 012F CMP R7,#+1
\ 0000006E F6D1 BNE.N ??OSFlagAccept_8
143 pgrp->OSFlagFlags &= ~flags_rdy; /* Clear ONLY the flags that we got */
\ 00000070 2A00 MOVS R2,R5
\ 00000072 9143 BICS R1,R1,R2
\ 00000074 2181 STRH R1,[R4, #+8]
\ 00000076 F2E7 B.N ??OSFlagAccept_8
144 }
145 } else {
146 *perr = OS_ERR_FLAG_NOT_RDY;
147 }
148 OS_EXIT_CRITICAL();
149 break;
150
151 #if OS_FLAG_WAIT_CLR_EN > 0
152 case OS_FLAG_WAIT_CLR_ALL: /* See if all required flags are cleared */
153 flags_rdy = (OS_FLAGS)(~pgrp->OSFlagFlags & flags); /* Extract only the bits we want */
\ ??OSFlagAccept_11:
\ 00000078 2189 LDRH R1,[R4, #+8]
\ 0000007A 4546 MOV R5,R8
\ 0000007C 8D43 BICS R5,R5,R1
154 if (flags_rdy == flags) { /* Must match ALL the bits that we want */
\ 0000007E 2900 MOVS R1,R5
\ 00000080 4246 MOV R2,R8
\ 00000082 9142 CMP R1,R2
\ 00000084 E9D1 BNE.N ??OSFlagAccept_7
155 if (consume == OS_TRUE) { /* See if we need to consume the flags */
\ 00000086 012F CMP R7,#+1
\ 00000088 E9D1 BNE.N ??OSFlagAccept_8
156 pgrp->OSFlagFlags |= flags_rdy; /* Set ONLY the flags that we wanted */
\ 0000008A 2189 LDRH R1,[R4, #+8]
\ 0000008C 2A00 MOVS R2,R5
\ 0000008E 0A43 ORRS R2,R2,R1
\ 00000090 2281 STRH R2,[R4, #+8]
\ 00000092 E4E7 B.N ??OSFlagAccept_8
157 }
158 } else {
159 *perr = OS_ERR_FLAG_NOT_RDY;
160 }
161 OS_EXIT_CRITICAL();
162 break;
163
164 case OS_FLAG_WAIT_CLR_ANY:
165 flags_rdy = (OS_FLAGS)(~pgrp->OSFlagFlags & flags); /* Extract only the bits we want */
\ ??OSFlagAccept_12:
\ 00000094 2189 LDRH R1,[R4, #+8]
\ 00000096 4546 MOV R5,R8
\ 00000098 8D43 BICS R5,R5,R1
166 if (flags_rdy != (OS_FLAGS)0) { /* See if any flag cleared */
\ 0000009A DED0 BEQ.N ??OSFlagAccept_7
167 if (consume == OS_TRUE) { /* See if we need to consume the flags */
\ 0000009C 012F CMP R7,#+1
\ 0000009E DED1 BNE.N ??OSFlagAccept_8
168 pgrp->OSFlagFlags |= flags_rdy; /* Set ONLY the flags that we got */
\ 000000A0 2A00 MOVS R2,R5
\ 000000A2 0A43 ORRS R2,R2,R1
\ 000000A4 2281 STRH R2,[R4, #+8]
\ 000000A6 DAE7 B.N ??OSFlagAccept_8
169 }
170 } else {
171 *perr = OS_ERR_FLAG_NOT_RDY;
172 }
173 OS_EXIT_CRITICAL();
174 break;
175 #endif
176
177 default:
178 OS_EXIT_CRITICAL();
\ ??OSFlagAccept_5:
\ 000000A8 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rT
179 flags_rdy = (OS_FLAGS)0;
\ 000000AC 4D46 MOV R5,R9
180 *perr = OS_ERR_FLAG_WAIT_TYPE;
\ 000000AE 6F20 MOVS R0,#+111
\ 000000B0 3070 STRB R0,[R6, #+0]
181 break;
182 }
183 return (flags_rdy);
\ ??OSFlagAccept_9:
\ 000000B2 2800 MOVS R0,R5
\ ??OSFlagAccept_2:
\ 000000B4 BDE8F083 POP {R4-R9,PC} ;; return
184 }
185 #endif
186
187 /*$PAGE*/
188 /*
189 *********************************************************************************************************
190 * CREATE AN EVENT FLAG
191 *
192 * Description: This function is called to create an event flag group.
193 *
194 * Arguments : flags Contains the initial value to store in the event flag group.
195 *
196 * perr is a pointer to an error code which will be returned to your application:
197 * OS_ERR_NONE if the call was successful.
198 * OS_ERR_CREATE_ISR if you attempted to create an Event Flag from an
199 * ISR.
200 * OS_ERR_FLAG_GRP_DEPLETED if there are no more event flag groups
201 *
202 * Returns : A pointer to an event flag group or a NULL pointer if no more groups are available.
203 *
204 * Called from: Task ONLY
205 *********************************************************************************************************
206 */
207
\ In segment CODE, align 4, keep-with-next
208 OS_FLAG_GRP *OSFlagCreate (OS_FLAGS flags, INT8U *perr)
209 {
\ OSFlagCreate:
\ 00000000 70B5 PUSH {R4-R6,LR}
\ 00000002 0600 MOVS R6,R0
\ 00000004 0C00 MOVS R4,R1
210 OS_FLAG_GRP *pgrp;
211 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
212 OS_CPU_SR cpu_sr = 0;
213 #endif
214
215
216
217 #if OS_ARG_CHK_EN > 0
218 if (perr == (INT8U *)0) { /* Validate 'perr' */
219 return ((OS_FLAG_GRP *)0);
220 }
221 #endif
222 if (OSIntNesting > 0) { /* See if called from ISR ... */
\ 00000006 .... LDR.N R0,??DataTable6 ;; OSIntNesting
\ 00000008 0078 LDRB R0,[R0, #+0]
\ 0000000A 0028 CMP R0,#+0
\ 0000000C 03D0 BEQ.N ??OSFlagCreate_0
223 *perr = OS_ERR_CREATE_ISR; /* ... can't CREATE from an ISR */
\ 0000000E 1020 MOVS R0,#+16
\ 00000010 2070 STRB R0,[R4, #+0]
224 return ((OS_FLAG_GRP *)0);
\ 00000012 0020 MOVS R0,#+0
\ 00000014 70BD POP {R4-R6,PC}
225 }
226 OS_ENTER_CRITICAL();
\ ??OSFlagCreate_0:
\ 00000016 ........ _BLF OS_CPU_SR_Save,??OS_CPU_SR_Save??rT
227 pgrp = OSFlagFreeList; /* Get next free event flag */
\ 0000001A .... LDR.N R1,??DataTable3 ;; OSFlagFreeList
\ 0000001C 0A68 LDR R2,[R1, #+0]
\ 0000001E 1500 MOVS R5,R2
228 if (pgrp != (OS_FLAG_GRP *)0) { /* See if we have event flag groups available */
\ 00000020 0ED0 BEQ.N ??OSFlagCreate_1
229 /* Adjust free list */
230 OSFlagFreeList = (OS_FLAG_GRP *)OSFlagFreeList->OSFlagWaitList;
\ 00000022 5268 LDR R2,[R2, #+4]
\ 00000024 0A60 STR R2,[R1, #+0]
231 pgrp->OSFlagType = OS_EVENT_TYPE_FLAG; /* Set to event flag group type */
\ 00000026 0521 MOVS R1,#+5
\ 00000028 2970 STRB R1,[R5, #+0]
232 pgrp->OSFlagFlags = flags; /* Set to desired initial value */
\ 0000002A 2E81 STRH R6,[R5, #+8]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -