os_time.lst
来自「称植到lpc2124上的UCOS2.85版 是本人初学移植和ARM的成果 可」· LST 代码 · 共 748 行 · 第 1/3 页
LST
748 行
119:../OSsrc/os_time.c **** return (OS_ERR_TIME_INVALID_SECONDS);
263 .LM23:
264 00aa 82E5 ldi r24,lo8(82)
265 00ac 90E0 ldi r25,hi8(82)
266 00ae 6BC0 rjmp .L5
267 .L12:
120:../OSsrc/os_time.c **** }
121:../OSsrc/os_time.c **** if (ms > 999) {
269 .LM24:
270 00b0 B3E0 ldi r27,hi8(1000)
271 00b2 C83E cpi r28,lo8(1000)
272 00b4 DB07 cpc r29,r27
273 00b6 18F0 brlo .L13
122:../OSsrc/os_time.c **** return (OS_ERR_TIME_INVALID_MS);
275 .LM25:
276 00b8 83E5 ldi r24,lo8(83)
277 00ba 90E0 ldi r25,hi8(83)
278 00bc 64C0 rjmp .L5
279 .L13:
123:../OSsrc/os_time.c **** }
124:../OSsrc/os_time.c **** #endif
125:../OSsrc/os_time.c **** /* Compute the total number of clock ticks require
126:../OSsrc/os_time.c **** /* .. (rounded to the nearest tick)
127:../OSsrc/os_time.c **** ticks = ((INT32U)hours * 3600L + (INT32U)minutes * 60L + (INT32U)seconds) * OS_TICKS_PER_SEC
281 .LM26:
282 00be 892F mov r24,r25
283 00c0 9927 clr r25
284 00c2 AA27 clr r26
285 00c4 BB27 clr r27
286 00c6 BC01 movw r22,r24
287 00c8 CD01 movw r24,r26
288 00ca 20E1 ldi r18,lo8(3600)
289 00cc 3EE0 ldi r19,hi8(3600)
290 00ce 40E0 ldi r20,hlo8(3600)
291 00d0 50E0 ldi r21,hhi8(3600)
292 00d2 0E94 0000 call __mulsi3
293 00d6 7B01 movw r14,r22
294 00d8 8C01 movw r16,r24
295 00da 8A2D mov r24,r10
296 00dc 9927 clr r25
297 00de AA27 clr r26
298 00e0 BB27 clr r27
299 00e2 BC01 movw r22,r24
300 00e4 CD01 movw r24,r26
301 00e6 2CE3 ldi r18,lo8(60)
302 00e8 30E0 ldi r19,hi8(60)
303 00ea 40E0 ldi r20,hlo8(60)
304 00ec 50E0 ldi r21,hhi8(60)
305 00ee 0E94 0000 call __mulsi3
306 00f2 DC01 movw r26,r24
307 00f4 CB01 movw r24,r22
308 00f6 E80E add r14,r24
309 00f8 F91E adc r15,r25
310 00fa 0A1F adc r16,r26
311 00fc 1B1F adc r17,r27
312 00fe ED0C add r14,r13
313 0100 F11C adc r15,__zero_reg__
314 0102 011D adc r16,__zero_reg__
315 0104 111D adc r17,__zero_reg__
316 0106 C801 movw r24,r16
317 0108 B701 movw r22,r14
318 010a 28EC ldi r18,lo8(200)
319 010c 30E0 ldi r19,hi8(200)
320 010e 40E0 ldi r20,hlo8(200)
321 0110 50E0 ldi r21,hhi8(200)
322 0112 0E94 0000 call __mulsi3
323 0116 7B01 movw r14,r22
324 0118 8C01 movw r16,r24
325 011a CE01 movw r24,r28
326 011c AA27 clr r26
327 011e BB27 clr r27
328 0120 BC01 movw r22,r24
329 0122 CD01 movw r24,r26
330 0124 0E94 0000 call __mulsi3
331 0128 DC01 movw r26,r24
332 012a CB01 movw r24,r22
333 012c 8057 subi r24,lo8(-(400))
334 012e 9E4F sbci r25,hi8(-(400))
335 0130 AF4F sbci r26,hlo8(-(400))
336 0132 BF4F sbci r27,hhi8(-(400))
337 0134 BC01 movw r22,r24
338 0136 CD01 movw r24,r26
339 0138 28EE ldi r18,lo8(1000)
340 013a 33E0 ldi r19,hi8(1000)
341 013c 40E0 ldi r20,hlo8(1000)
342 013e 50E0 ldi r21,hhi8(1000)
343 0140 0E94 0000 call __udivmodsi4
344 0144 E20E add r14,r18
345 0146 F31E adc r15,r19
346 0148 041F adc r16,r20
347 014a 151F adc r17,r21
128:../OSsrc/os_time.c **** + OS_TICKS_PER_SEC * ((INT32U)ms + 500L / OS_TICKS_PER_SEC) / 1000L;
129:../OSsrc/os_time.c **** loops = (INT16U)(ticks >> 16); /* Compute the integral number of 65536 tick delay
349 .LM27:
350 014c 5801 movw r10,r16
351 014e CC24 clr r12
352 0150 DD24 clr r13
353 0152 E501 movw r28,r10
130:../OSsrc/os_time.c **** ticks = ticks & 0xFFFFL; /* Obtain the fractional number of ticks
355 .LM28:
356 0154 8FEF ldi r24,lo8(65535)
357 0156 9FEF ldi r25,hi8(65535)
358 0158 A0E0 ldi r26,hlo8(65535)
359 015a B0E0 ldi r27,hhi8(65535)
360 015c E822 and r14,r24
361 015e F922 and r15,r25
362 0160 0A23 and r16,r26
363 0162 1B23 and r17,r27
131:../OSsrc/os_time.c **** OSTimeDly((INT16U)ticks);
365 .LM29:
366 0164 C701 movw r24,r14
367 0166 0E94 0000 call OSTimeDly
132:../OSsrc/os_time.c **** while (loops > 0) {
133:../OSsrc/os_time.c **** OSTimeDly((INT16U)32768u);
134:../OSsrc/os_time.c **** OSTimeDly((INT16U)32768u);
135:../OSsrc/os_time.c **** loops--;
369 .LM30:
370 016a AB28 or r10,r11
371 016c 51F0 breq .L18
372 .L16:
374 .LM31:
375 016e 80E0 ldi r24,lo8(-32768)
376 0170 90E8 ldi r25,hi8(-32768)
377 0172 0E94 0000 call OSTimeDly
379 .LM32:
380 0176 80E0 ldi r24,lo8(-32768)
381 0178 90E8 ldi r25,hi8(-32768)
382 017a 0E94 0000 call OSTimeDly
384 .LM33:
385 017e 2197 sbiw r28,1
386 0180 B1F7 brne .L16
387 .L18:
136:../OSsrc/os_time.c **** }
137:../OSsrc/os_time.c **** return (OS_ERR_NONE);
389 .LM34:
390 0182 80E0 ldi r24,lo8(0)
391 0184 90E0 ldi r25,hi8(0)
392 .L5:
393 /* epilogue: frame size=0 */
394 0186 DF91 pop r29
395 0188 CF91 pop r28
396 018a 1F91 pop r17
397 018c 0F91 pop r16
398 018e FF90 pop r15
399 0190 EF90 pop r14
400 0192 DF90 pop r13
401 0194 CF90 pop r12
402 0196 BF90 pop r11
403 0198 AF90 pop r10
404 019a 0895 ret
405 /* epilogue end (size=11) */
406 /* function OSTimeDlyHMSM size 163 (142) */
412 .Lscope1:
415 .global OSTimeDlyResume
417 OSTimeDlyResume:
138:../OSsrc/os_time.c **** }
139:../OSsrc/os_time.c **** #endif
140:../OSsrc/os_time.c **** /*$PAGE*/
141:../OSsrc/os_time.c **** /*
142:../OSsrc/os_time.c **** ***************************************************************************************************
143:../OSsrc/os_time.c **** * RESUME A DELAYED TASK
144:../OSsrc/os_time.c **** *
145:../OSsrc/os_time.c **** * Description: This function is used resume a task that has been delayed through a call to either
146:../OSsrc/os_time.c **** * OSTimeDly() or OSTimeDlyHMSM(). Note that you can call this function to resume a
147:../OSsrc/os_time.c **** * task that is waiting for an event with timeout. This would make the task look
148:../OSsrc/os_time.c **** * like a timeout occurred.
149:../OSsrc/os_time.c **** *
150:../OSsrc/os_time.c **** * Also, you cannot resume a task that has called OSTimeDlyHMSM() with a combined time
151:../OSsrc/os_time.c **** * exceeds 65535 clock ticks. In other words, if the clock tick runs at 100 Hz then, y
152:../OSsrc/os_time.c **** * not be able to resume a delayed task that called OSTimeDlyHMSM(0, 10, 55, 350) or hi
153:../OSsrc/os_time.c **** *
154:../OSsrc/os_time.c **** * (10 Minutes * 60 + 55 Seconds + 0.35) * 100 ticks/second.
155:../OSsrc/os_time.c **** *
156:../OSsrc/os_time.c **** * Arguments : prio specifies the priority of the task to resume
157:../OSsrc/os_time.c **** *
158:../OSsrc/os_time.c **** * Returns : OS_ERR_NONE Task has been resumed
159:../OSsrc/os_time.c **** * OS_ERR_PRIO_INVALID if the priority you specify is higher that the maximum all
160:../OSsrc/os_time.c **** * (i.e. >= OS_LOWEST_PRIO)
161:../OSsrc/os_time.c **** * OS_ERR_TIME_NOT_DLY Task is not waiting for time to expire
162:../OSsrc/os_time.c **** * OS_ERR_TASK_NOT_EXIST The desired task has not been created or has been assigned
163:../OSsrc/os_time.c **** ***************************************************************************************************
164:../OSsrc/os_time.c **** */
165:../OSsrc/os_time.c ****
166:../OSsrc/os_time.c **** #if OS_TIME_DLY_RESUME_EN > 0
167:../OSsrc/os_time.c **** INT8U OSTimeDlyResume (INT8U prio)
168:../OSsrc/os_time.c **** {
419 .LM35:
420 /* prologue: frame size=0 */
421 019c CF93 push r28
422 019e DF93 push r29
423 /* prologue end (size=2) */
169:../OSsrc/os_time.c **** OS_TCB *ptcb;
170:../OSsrc/os_time.c **** #if OS_CRITICAL_METHOD == 3 /* Storage for CPU status register
171:../OSsrc/os_time.c **** OS_CPU_SR cpu_sr = 0;
172:../OSsrc/os_time.c **** #endif
173:../OSsrc/os_time.c ****
174:../OSsrc/os_time.c ****
175:../OSsrc/os_time.c ****
176:../OSsrc/os_time.c **** if (prio >= OS_LOWEST_PRIO) {
425 .LM36:
426 01a0 8F33 cpi r24,lo8(63)
427 01a2 18F0 brlo .L20
177:../OSsrc/os_time.c **** return (OS_ERR_PRIO_INVALID);
429 .LM37:
430 01a4 8AE2 ldi r24,lo8(42)
431 01a6 90E0 ldi r25,hi8(42)
432 01a8 49C0 rjmp .L19
433 .L20:
178:../OSsrc/os_time.c **** }
179:../OSsrc/os_time.c **** OS_ENTER_CRITICAL();
435 .LM38:
436 /* #APP */
437 01aa F894 cli
180:../OSsrc/os_time.c **** ptcb = OSTCBPrioTbl[prio]; /* Make sure that task exist
439 .LM39:
440 /* #NOAPP */
441 01ac E82F mov r30,r24
442 01ae FF27 clr r31
443 01b0 EE0F add r30,r30
444 01b2 FF1F adc r31,r31
445 01b4 E050 subi r30,lo8(-(OSTCBPrioTbl))
446 01b6 F040 sbci r31,hi8(-(OSTCBPrioTbl))
447 01b8 A081 ld r26,Z
448 01ba B181 ldd r27,Z+1
181:../OSsrc/os_time.c **** if (ptcb == (OS_TCB *)0) {
450 .LM40:
451 01bc 1097 sbiw r26,0
452 01be 11F4 brne .L21
182:../OSsrc/os_time.c **** OS_EXIT_CRITICAL();
454 .LM41:
455 /* #APP */
456 01c0 7894 sei
457 /* #NOAPP */
458 01c2 04C0 rjmp .L28
459 .L21:
183:../OSsrc/os_time.c **** return (OS_ERR_TASK_NOT_EXIST); /* The task does not exist
184:../OSsrc/os_time.c **** }
185:../OSsrc/os_time.c **** if (ptcb == OS_TCB_RESERVED) {
461 .LM42:
462 01c4 A130 cpi r26,1
463 01c6 B105 cpc r27,__zero_reg__
464 01c8 21F4 brne .L22
186:../OSsrc/os_time.c **** OS_EXIT_CRITICAL();
466 .LM43:
467 /* #APP */
468 01ca 7894 sei
469 /* #NOAPP */
470 .L28:
187:../OSsrc/os_time.c **** return (OS_ERR_TASK_NOT_EXIST); /* The task does not exist
472 .LM44:
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?