⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 os_time.txt

📁 ucos2.86版本结合STM板极支持包
💻 TXT
📖 第 1 页 / 共 2 页
字号:
;;;167    INT8U  OSTimeDlyResume (INT8U prio)
;;;168    {
0000de  b510              PUSH     {r4,lr}
0000e0  4604              MOV      r4,r0
;;;169        OS_TCB    *ptcb;
;;;170    #if OS_CRITICAL_METHOD == 3                                    /* Storage for CPU status register      */
;;;171        OS_CPU_SR  cpu_sr = 0;
;;;172    #endif
;;;173    
;;;174    
;;;175    
;;;176        if (prio >= OS_LOWEST_PRIO) {
0000e2  2c1f              CMP      r4,#0x1f
0000e4  d301              BCC      |L1.234|
;;;177            return (OS_ERR_PRIO_INVALID);
0000e6  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    }
0000e8  bd10              POP      {r4,pc}
                  |L1.234|
0000ea  f7fff7ff          BL       OS_CPU_SR_Save
0000ee  4930              LDR      r1,|L1.432|
0000f0  f851f851          LDR      r1,[r1,r4,LSL #2]
0000f4  b919              CBNZ     r1,|L1.254|
0000f6  f7fff7ff          BL       OS_CPU_SR_Restore
0000fa  2043              MOVS     r0,#0x43
0000fc  bd10              POP      {r4,pc}
                  |L1.254|
0000fe  2901              CMP      r1,#1
000100  d103              BNE      |L1.266|
000102  f7fff7ff          BL       OS_CPU_SR_Restore
000106  2043              MOVS     r0,#0x43
000108  bd10              POP      {r4,pc}
                  |L1.266|
00010a  8d4a              LDRH     r2,[r1,#0x2a]
00010c  b91a              CBNZ     r2,|L1.278|
00010e  f7fff7ff          BL       OS_CPU_SR_Restore
000112  2050              MOVS     r0,#0x50
000114  bd10              POP      {r4,pc}
                  |L1.278|
000116  2300              MOVS     r3,#0
000118  854b              STRH     r3,[r1,#0x2a]
00011a  f891f891          LDRB     r2,[r1,#0x2c]
00011e  f012f012          TST      r2,#0x37
000122  d007              BEQ      |L1.308|
000124  f022f022          BIC      r2,r2,#0x37
000128  f881f881          STRB     r2,[r1,#0x2c]
00012c  2201              MOVS     r2,#1
00012e  f881f881          STRB     r2,[r1,#0x2d]
000132  e001              B        |L1.312|
                  |L1.308|
000134  f881f881          STRB     r3,[r1,#0x2d]
                  |L1.312|
000138  f891f891          LDRB     r2,[r1,#0x2c]
00013c  f012f012          TST      r2,#8
000140  d116              BNE      |L1.368|
000142  4a1a              LDR      r2,|L1.428|
000144  f891f891          LDRB     r3,[r1,#0x32]
000148  f892f892          LDRB     r12,[r2,#0]  ; OSRdyGrp
00014c  ea43ea43          ORR      r3,r3,r12
000150  7013              STRB     r3,[r2,#0]  ; OSRdyGrp
000152  f891f891          LDRB     r2,[r1,#0x30]
000156  4b14              LDR      r3,|L1.424|
000158  f891f891          LDRB     r1,[r1,#0x31]
00015c  f813f813          LDRB     r12,[r3,r2]
000160  ea4cea4c          ORR      r1,r12,r1
000164  5499              STRB     r1,[r3,r2]
000166  f7fff7ff          BL       OS_CPU_SR_Restore
00016a  f7fff7ff          BL       OS_Sched
00016e  e001              B        |L1.372|
                  |L1.368|
000170  f7fff7ff          BL       OS_CPU_SR_Restore
                  |L1.372|
000174  2000              MOVS     r0,#0
000176  bd10              POP      {r4,pc}
;;;211    #endif
                          ENDP

                  OSTimeGet PROC
;;;227    INT32U  OSTimeGet (void)
;;;228    {
000178  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();
00017a  f7fff7ff          BL       OS_CPU_SR_Save
;;;237        ticks = OSTime;
00017e  490d              LDR      r1,|L1.436|
000180  680c              LDR      r4,[r1,#0]  ; OSTime
;;;238        OS_EXIT_CRITICAL();
000182  f7fff7ff          BL       OS_CPU_SR_Restore
;;;239        return (ticks);
000186  4620              MOV      r0,r4
;;;240    }
000188  bd10              POP      {r4,pc}
;;;241    #endif
                          ENDP

                  OSTimeSet PROC
;;;256    void  OSTimeSet (INT32U ticks)
;;;257    {
00018a  b510              PUSH     {r4,lr}
00018c  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();
00018e  f7fff7ff          BL       OS_CPU_SR_Save
;;;265        OSTime = ticks;
000192  4908              LDR      r1,|L1.436|
000194  600c              STR      r4,[r1,#0]  ; OSTime
;;;266        OS_EXIT_CRITICAL();
000196  e8bde8bd          POP      {r4,lr}
00019a  f7fff7ff          B.W      OS_CPU_SR_Restore
;;;267    }
;;;268    #endif
                          ENDP

00019e  0000              DCW      0x0000
                  |L1.416|
0001a0  00000000          DCD      OSIntNesting
                  |L1.420|
0001a4  00000000          DCD      OSTCBCur
                  |L1.424|
0001a8  00000000          DCD      OSRdyTbl
                  |L1.428|
0001ac  00000000          DCD      OSRdyGrp
                  |L1.432|
0001b0  00000000          DCD      OSTCBPrioTbl
                  |L1.436|
0001b4  00000000          DCD      OSTime

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -