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

📄 os_tmr.lst

📁 stm32+ucos-ii
💻 LST
📖 第 1 页 / 共 5 页
字号:
   \   0000002C   ........           BL       OSSchedLock
    159              ptmr = OSTmr_Alloc();                                   /* Obtain a timer from the free pool                      */
   \   00000030   ........           BL       OSTmr_Alloc
   \   00000034   8346               MOV      R11,R0
    160              if (ptmr == (OS_TMR *)0) {
   \   00000036   BBF1000F           CMP      R11,#+0
   \   0000003A   06D1               BNE.N    ??OSTmrCreate_2
    161                  OSSchedUnlock();
   \   0000003C   ........           BL       OSSchedUnlock
    162                  *perr = OS_ERR_TMR_NON_AVAIL;
   \   00000040   8620               MOVS     R0,#+134
   \   00000042   8AF80000           STRB     R0,[R10, #+0]
    163                  return ((OS_TMR *)0);
   \   00000046   0020               MOVS     R0,#+0
   \   00000048   1BE0               B.N      ??OSTmrCreate_1
    164              }
    165              ptmr->OSTmrState       = OS_TMR_STATE_STOPPED;          /* Indicate that timer is not running yet                 */
   \                     ??OSTmrCreate_2:
   \   0000004A   0120               MOVS     R0,#+1
   \   0000004C   8BF82500           STRB     R0,[R11, #+37]
    166              ptmr->OSTmrDly         = dly;
   \   00000050   CBF81840           STR      R4,[R11, #+24]
    167              ptmr->OSTmrPeriod      = period;
   \   00000054   CBF81C50           STR      R5,[R11, #+28]
    168              ptmr->OSTmrOpt         = opt;
   \   00000058   8BF82460           STRB     R6,[R11, #+36]
    169              ptmr->OSTmrCallback    = callback;
   \   0000005C   CBF80470           STR      R7,[R11, #+4]
    170              ptmr->OSTmrCallbackArg = callback_arg;
   \   00000060   CBF80880           STR      R8,[R11, #+8]
    171          #if OS_TMR_CFG_NAME_EN > 0u
    172              if (pname == (INT8U *)0) {                              /* Is 'pname' a NULL pointer?                             */
   \   00000064   B9F1000F           CMP      R9,#+0
   \   00000068   03D1               BNE.N    ??OSTmrCreate_3
    173                  ptmr->OSTmrName    = (INT8U *)(void *)"?";
   \   0000006A   ....               ADR.N    R0,??DataTable9  ;; "\?"
   \   0000006C   CBF82000           STR      R0,[R11, #+32]
   \   00000070   01E0               B.N      ??OSTmrCreate_4
    174              } else {
    175                  ptmr->OSTmrName    = pname;
   \                     ??OSTmrCreate_3:
   \   00000072   CBF82090           STR      R9,[R11, #+32]
    176              }
    177          #endif
    178              OSSchedUnlock();
   \                     ??OSTmrCreate_4:
   \   00000076   ........           BL       OSSchedUnlock
    179              *perr = OS_ERR_NONE;
   \   0000007A   0020               MOVS     R0,#+0
   \   0000007C   8AF80000           STRB     R0,[R10, #+0]
    180              return (ptmr);
   \   00000080   5846               MOV      R0,R11
   \                     ??OSTmrCreate_1:
   \   00000082   BDE8F28F           POP      {R1,R4-R11,PC}   ;; return
    181          }
    182          #endif
    183          
    184          /*$PAGE*/
    185          /*
    186          ************************************************************************************************************************
    187          *                                                   DELETE A TIMER
    188          *
    189          * Description: This function is called by your application code to delete a timer.
    190          *
    191          * Arguments  : ptmr          Is a pointer to the timer to stop and delete.
    192          *
    193          *              perr          Is a pointer to an error code.  '*perr' will contain one of the following:
    194          *                               OS_ERR_NONE
    195          *                               OS_ERR_TMR_INVALID        'ptmr'  is a NULL pointer
    196          *                               OS_ERR_TMR_INVALID_TYPE   'ptmr'  is not pointing to an OS_TMR
    197          *                               OS_ERR_TMR_ISR            if the function was called from an ISR
    198          *                               OS_ERR_TMR_INACTIVE       if the timer was not created
    199          *                               OS_ERR_TMR_INVALID_STATE  the timer is in an invalid state
    200          *
    201          * Returns    : OS_TRUE       If the call was successful
    202          *              OS_FALSE      If not
    203          ************************************************************************************************************************
    204          */
    205          
    206          #if OS_TMR_EN > 0u

   \                                 In section .text, align 2, keep-with-next
    207          BOOLEAN  OSTmrDel (OS_TMR  *ptmr,
    208                             INT8U   *perr)
    209          {
   \                     OSTmrDel:
   \   00000000   38B5               PUSH     {R3-R5,LR}
   \   00000002   0400               MOVS     R4,R0
   \   00000004   0D00               MOVS     R5,R1
    210          #ifdef OS_SAFETY_CRITICAL
    211              if (perr == (INT8U *)0) {
    212                  OS_SAFETY_CRITICAL_EXCEPTION();
    213                  return (OS_FALSE);
    214              }
    215          #endif
    216          
    217          #if OS_ARG_CHK_EN > 0u
    218              if (ptmr == (OS_TMR *)0) {
    219                  *perr = OS_ERR_TMR_INVALID;
    220                  return (OS_FALSE);
    221              }
    222          #endif
    223              if (ptmr->OSTmrType != OS_TMR_TYPE) {                   /* Validate timer structure                               */
   \   00000006   2078               LDRB     R0,[R4, #+0]
   \   00000008   6428               CMP      R0,#+100
   \   0000000A   03D0               BEQ.N    ??OSTmrDel_0
    224                  *perr = OS_ERR_TMR_INVALID_TYPE;
   \   0000000C   8920               MOVS     R0,#+137
   \   0000000E   2870               STRB     R0,[R5, #+0]
    225                  return (OS_FALSE);
   \   00000010   0020               MOVS     R0,#+0
   \   00000012   33E0               B.N      ??OSTmrDel_1
    226              }
    227              if (OSIntNesting > 0u) {                                /* See if trying to call from an ISR                      */
   \                     ??OSTmrDel_0:
   \   00000014   ........           LDR.W    R0,??DataTable18_1
   \   00000018   0078               LDRB     R0,[R0, #+0]
   \   0000001A   0028               CMP      R0,#+0
   \   0000001C   03D0               BEQ.N    ??OSTmrDel_2
    228                  *perr  = OS_ERR_TMR_ISR;
   \   0000001E   8B20               MOVS     R0,#+139
   \   00000020   2870               STRB     R0,[R5, #+0]
    229                  return (OS_FALSE);
   \   00000022   0020               MOVS     R0,#+0
   \   00000024   2AE0               B.N      ??OSTmrDel_1
    230              }
    231              OSSchedLock();
   \                     ??OSTmrDel_2:
   \   00000026   ........           BL       OSSchedLock
    232              switch (ptmr->OSTmrState) {
   \   0000002A   94F82500           LDRB     R0,[R4, #+37]
   \   0000002E   0028               CMP      R0,#+0
   \   00000030   19D0               BEQ.N    ??OSTmrDel_3
   \   00000032   0228               CMP      R0,#+2
   \   00000034   0ED0               BEQ.N    ??OSTmrDel_4
   \   00000036   0DD3               BCC.N    ??OSTmrDel_4
   \   00000038   0328               CMP      R0,#+3
   \   0000003A   1AD1               BNE.N    ??OSTmrDel_5
    233                  case OS_TMR_STATE_RUNNING:
    234                       OSTmr_Unlink(ptmr);                            /* Remove from current wheel spoke                        */
   \                     ??OSTmrDel_6:
   \   0000003C   2000               MOVS     R0,R4
   \   0000003E   ........           BL       OSTmr_Unlink
    235                       OSTmr_Free(ptmr);                              /* Return timer to free list of timers                    */
   \   00000042   2000               MOVS     R0,R4
   \   00000044   ........           BL       OSTmr_Free
    236                       OSSchedUnlock();
   \   00000048   ........           BL       OSSchedUnlock
    237                       *perr = OS_ERR_NONE;
   \   0000004C   0020               MOVS     R0,#+0
   \   0000004E   2870               STRB     R0,[R5, #+0]
    238                       return (OS_TRUE);
   \   00000050   0120               MOVS     R0,#+1
   \   00000052   13E0               B.N      ??OSTmrDel_1
    239          
    240                  case OS_TMR_STATE_STOPPED:                          /* Timer has not started or ...                           */
    241                  case OS_TMR_STATE_COMPLETED:                        /* ... timer has completed the ONE-SHOT time              */
    242                       OSTmr_Free(ptmr);                              /* Return timer to free list of timers                    */
   \                     ??OSTmrDel_4:
   \   00000054   2000               MOVS     R0,R4
   \   00000056   ........           BL       OSTmr_Free
    243                       OSSchedUnlock();
   \   0000005A   ........           BL       OSSchedUnlock
    244                       *perr = OS_ERR_NONE;
   \   0000005E   0020               MOVS     R0,#+0
   \   00000060   2870               STRB     R0,[R5, #+0]
    245                       return (OS_TRUE);
   \   00000062   0120               MOVS     R0,#+1
   \   00000064   0AE0               B.N      ??OSTmrDel_1
    246          
    247                  case OS_TMR_STATE_UNUSED:                           /* Already deleted                                        */
    248                       OSSchedUnlock();
   \                     ??OSTmrDel_3:
   \   00000066   ........           BL       OSSchedUnlock
    249                       *perr = OS_ERR_TMR_INACTIVE;
   \   0000006A   8720               MOVS     R0,#+135
   \   0000006C   2870               STRB     R0,[R5, #+0]
    250                       return (OS_FALSE);
   \   0000006E   0020               MOVS     R0,#+0
   \   00000070   04E0               B.N      ??OSTmrDel_1
    251          
    252                  default:
    253                       OSSchedUnlock();
   \                     ??OSTmrDel_5:
   \   00000072   ........           BL       OSSchedUnlock
    254                       *perr = OS_ERR_TMR_INVALID_STATE;
   \   00000076   8D20               MOVS     R0,#+141
   \   00000078   2870               STRB     R0,[R5, #+0]
    255                       return (OS_FALSE);
   \   0000007A   0020               MOVS     R0,#+0
   \                     ??OSTmrDel_1:
   \   0000007C   32BD               POP      {R1,R4,R5,PC}    ;; return
    256              }
    257          }
    258          #endif
    259          
    260          /*$PAGE*/
    261          /*
    262          ************************************************************************************************************************
    263          *                                             GET THE NAME OF A TIMER
    264          *
    265          * Description: This function is called to obtain the name of a timer.
    266          *
    267          * Arguments  : ptmr          Is a pointer to the timer to obtain the name for
    268          *
    269          *              pdest         Is a pointer to pointer to where the name of the timer will be placed.
    270          *
    271          *              perr          Is a pointer to an error code.  '*perr' will contain one of the following:
    272          *                               OS_ERR_NONE               The call was successful
    273          *                               OS_ERR_TMR_INVALID_DEST   'pdest' is a NULL pointer
    274          *                               OS_ERR_TMR_INVALID        'ptmr'  is a NULL pointer
    275          *                               OS_ERR_TMR_INVALID_TYPE   'ptmr'  is not pointing to an OS_TMR
    276          *                               OS_ERR_NAME_GET_ISR       if the call was made from an ISR
    277          *                               OS_ERR_TMR_INACTIVE       'ptmr'  points to a timer that is not active
    278          *                               OS_ERR_TMR_INVALID_STATE  the timer is in an invalid state
    279          *
    280          * Returns    : The length of the string or 0 if the timer does not exist.
    281          ************************************************************************************************************************
    282          */
    283          
    284          #if OS_TMR_EN > 0u && OS_TMR_CFG_NAME_EN > 0u

   \                                 In section .text, align 2, keep-with-next

⌨️ 快捷键说明

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