📄 os_time.txt
字号:
0000a0 2c1f CMP r4,#0x1f
0000a2 d301 BCC |L1.168|
;;;177 return (OS_ERR_PRIO_INVALID);
0000a4 202a MOVS r0,#0x2a
;;;178 }
;;;179 OS_ENTER_CRITICAL();
;;;180 ptcb = OSTCBPrioTbl[prio]; /* Make sure that task exist */
;;;181 if (ptcb == (OS_TCB *)0) {
;;;182 OS_EXIT_CRITICAL();
;;;183 return (OS_ERR_TASK_NOT_EXIST); /* The task does not exist */
;;;184 }
;;;185 if (ptcb == OS_TCB_RESERVED) {
;;;186 OS_EXIT_CRITICAL();
;;;187 return (OS_ERR_TASK_NOT_EXIST); /* The task does not exist */
;;;188 }
;;;189 if (ptcb->OSTCBDly == 0) { /* See if task is delayed */
;;;190 OS_EXIT_CRITICAL();
;;;191 return (OS_ERR_TIME_NOT_DLY); /* Indicate that task was not delayed */
;;;192 }
;;;193
;;;194 ptcb->OSTCBDly = 0; /* Clear the time delay */
;;;195 if ((ptcb->OSTCBStat & OS_STAT_PEND_ANY) != OS_STAT_RDY) {
;;;196 ptcb->OSTCBStat &= ~OS_STAT_PEND_ANY; /* Yes, Clear status flag */
;;;197 ptcb->OSTCBStatPend = OS_STAT_PEND_TO; /* Indicate PEND timeout */
;;;198 } else {
;;;199 ptcb->OSTCBStatPend = OS_STAT_PEND_OK;
;;;200 }
;;;201 if ((ptcb->OSTCBStat & OS_STAT_SUSPEND) == OS_STAT_RDY) { /* Is task suspended? */
;;;202 OSRdyGrp |= ptcb->OSTCBBitY; /* No, Make ready */
;;;203 OSRdyTbl[ptcb->OSTCBY] |= ptcb->OSTCBBitX;
;;;204 OS_EXIT_CRITICAL();
;;;205 OS_Sched(); /* See if this is new highest priority */
;;;206 } else {
;;;207 OS_EXIT_CRITICAL(); /* Task may be suspended */
;;;208 }
;;;209 return (OS_ERR_NONE);
;;;210 }
0000a6 bd10 POP {r4,pc}
|L1.168|
0000a8 f7fff7ff BL OS_CPU_SR_Save
0000ac 492c LDR r1,|L1.352|
0000ae f851f851 LDR r1,[r1,r4,LSL #2] ;180
0000b2 b919 CBNZ r1,|L1.188|
0000b4 f7fff7ff BL OS_CPU_SR_Restore
0000b8 2043 MOVS r0,#0x43 ;183
0000ba bd10 POP {r4,pc}
|L1.188|
0000bc 2901 CMP r1,#1 ;185
0000be d103 BNE |L1.200|
0000c0 f7fff7ff BL OS_CPU_SR_Restore
0000c4 2043 MOVS r0,#0x43 ;187
0000c6 bd10 POP {r4,pc}
|L1.200|
0000c8 8dca LDRH r2,[r1,#0x2e] ;189
0000ca b91a CBNZ r2,|L1.212|
0000cc f7fff7ff BL OS_CPU_SR_Restore
0000d0 2050 MOVS r0,#0x50 ;191
0000d2 bd10 POP {r4,pc}
|L1.212|
0000d4 2300 MOVS r3,#0 ;194
0000d6 85cb STRH r3,[r1,#0x2e] ;194
0000d8 f891f891 LDRB r2,[r1,#0x30] ;195
0000dc f012f012 TST r2,#0x37 ;195
0000e0 d007 BEQ |L1.242|
0000e2 f022f022 BIC r2,r2,#0x37 ;196
0000e6 f881f881 STRB r2,[r1,#0x30] ;196
0000ea 2201 MOVS r2,#1 ;197
0000ec f881f881 STRB r2,[r1,#0x31] ;197
0000f0 e001 B |L1.246|
|L1.242|
0000f2 f881f881 STRB r3,[r1,#0x31] ;199
|L1.246|
0000f6 f891f891 LDRB r2,[r1,#0x30] ;201
0000fa 0712 LSLS r2,r2,#28 ;201
0000fc d410 BMI |L1.288|
0000fe 4b17 LDR r3,|L1.348|
000100 3134 ADDS r1,r1,#0x34 ;202
000102 788a LDRB r2,[r1,#2] ;202
000104 781c LDRB r4,[r3,#0] ;202 ; OSRdyGrp
000106 4322 ORRS r2,r2,r4 ;202
000108 701a STRB r2,[r3,#0] ;202 ; OSRdyGrp
00010a 780a LDRB r2,[r1,#0] ;203
00010c 4b12 LDR r3,|L1.344|
00010e 7849 LDRB r1,[r1,#1] ;203
000110 5c9c LDRB r4,[r3,r2] ;203
000112 430c ORRS r4,r4,r1 ;203
000114 549c STRB r4,[r3,r2] ;203
000116 f7fff7ff BL OS_CPU_SR_Restore
00011a f7fff7ff BL OS_Sched
00011e e001 B |L1.292|
|L1.288|
000120 f7fff7ff BL OS_CPU_SR_Restore
|L1.292|
000124 2000 MOVS r0,#0 ;209
000126 bd10 POP {r4,pc}
;;;211 #endif
ENDP
OSTimeGet PROC
;;;227 INT32U OSTimeGet (void)
;;;228 {
000128 b510 PUSH {r4,lr}
;;;229 INT32U ticks;
;;;230 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
;;;231 OS_CPU_SR cpu_sr = 0;
;;;232 #endif
;;;233
;;;234
;;;235
;;;236 OS_ENTER_CRITICAL();
00012a f7fff7ff BL OS_CPU_SR_Save
;;;237 ticks = OSTime;
00012e 490d LDR r1,|L1.356|
000130 680c LDR r4,[r1,#0] ; OSTime
;;;238 OS_EXIT_CRITICAL();
000132 f7fff7ff BL OS_CPU_SR_Restore
;;;239 return (ticks);
000136 4620 MOV r0,r4
;;;240 }
000138 bd10 POP {r4,pc}
;;;241 #endif
ENDP
OSTimeSet PROC
;;;256 void OSTimeSet (INT32U ticks)
;;;257 {
00013a b510 PUSH {r4,lr}
00013c 4604 MOV r4,r0
;;;258 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
;;;259 OS_CPU_SR cpu_sr = 0;
;;;260 #endif
;;;261
;;;262
;;;263
;;;264 OS_ENTER_CRITICAL();
00013e f7fff7ff BL OS_CPU_SR_Save
;;;265 OSTime = ticks;
000142 4908 LDR r1,|L1.356|
000144 600c STR r4,[r1,#0] ; OSTime
;;;266 OS_EXIT_CRITICAL();
000146 e8bde8bd POP {r4,lr}
00014a f7fff7ff B.W OS_CPU_SR_Restore
;;;267 }
;;;268 #endif
ENDP
00014e 0000 DCW 0x0000
|L1.336|
000150 00000000 DCD OSIntNesting
|L1.340|
000154 00000000 DCD OSTCBCur
|L1.344|
000158 00000000 DCD OSRdyTbl
|L1.348|
00015c 00000000 DCD OSRdyGrp
|L1.352|
000160 00000000 DCD OSTCBPrioTbl
|L1.356|
000164 00000000 DCD OSTime
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -