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

📄 os_flag.lst

📁 IAR project for MSP430 and uC/OS. All configured to start filling with tasks.
💻 LST
📖 第 1 页 / 共 5 页
字号:
##############################################################################
#                                                                            #
# IAR MSP430 C-Compiler V1.26A/WIN                                           #
#                                                                            #
# Time limited license: 29 days left                                         #
#                                                                            #
#       Compile time  =  30/Sep/2002  18:04:10                               #
#       Target option =  SP430x31x                                           #
#       Memory model  =  small                                               #
#       Source file   =  c:\software\ucos-ii\source\os_flag.c                #
#       List file     =  j:\software\ucos-ii\ti-msp430\iar\source\debug\list\os_flag.lst#
#       Object file   =  j:\software\ucos-ii\ti-msp430\iar\source\debug\obj\os_flag.r43#
#       ASM file      =  j:\software\ucos-ii\ti-msp430\iar\source\debug\list\os_flag.s43#
#       Command line  =  -OJ:\SOFTWARE\UCOS-II\TI-MSP430\IAR\SOURCE\Debug\Obj\ #
#                        -e -K -gA -s6 -RCODE -r0                            #
#                        -LJ:\SOFTWARE\UCOS-II\TI-MSP430\IAR\SOURCE\Debug\List\ #
#                        -q -t8 -x                                           #
#                        -AJ:\SOFTWARE\UCOS-II\TI-MSP430\IAR\SOURCE\Debug\List\ #
#                        -X -IC:\PROGRA~1\IARSYS~1\ew23\430\inc\             #
#                        -I\software\ucos-ii\ti-msp430\iar\source\           #
#                        -I\software\ucos-ii\source\                         #
#                        C:\SOFTWARE\uCOS-II\SOURCE\OS_FLAG.C                #
#                                                                            #
#                           Copyright 1996-2002 IAR Systems. All rights reserved. #
##############################################################################


extern  INT8U  const      OSMapTbl[];               /* Priority->Bit Mask lookup table                 */
-----------------------------------^
"c:\software\ucos-ii\source\ucos_ii.h",481  Warning[27]: Size of "extern" object 'OSMapTbl' is unknown

extern  INT8U  const      OSUnMapTbl[];             /* Priority->Index    lookup table                 */
-------------------------------------^
"c:\software\ucos-ii\source\ucos_ii.h",482  Warning[27]: Size of "extern" object 'OSUnMapTbl' is unknown
   \   0000                    NAME    os_flag(16)
   \   0000                    RSEG    CODE(1)
   \   0000                    PUBLIC  OSFlagAccept
   \   0000                    PUBLIC  OSFlagCreate
   \   0000                    PUBLIC  OSFlagDel
   \   0000                    EXTERN  OSFlagFreeList
   \   0000                    PUBLIC  OSFlagPend
   \   0000                    PUBLIC  OSFlagPost
   \   0000                    PUBLIC  OSFlagQuery
   \   0000                    EXTERN  OSFlagTbl
   \   0000                    EXTERN  OSIntNesting
   \   0000                    EXTERN  OSRdyGrp
   \   0000                    EXTERN  OSRdyTbl
   \   0000                    EXTERN  OSTCBCur
   \   0000                    PUBLIC  OS_FlagInit
   \   0000                    PUBLIC  OS_FlagUnlink
   \   0000                    EXTERN  OS_Sched
   \   0000                    EXTERN  ?CL430_1_26_L08
   \   0000                    RSEG    CODE
   \   0000            OSFlagAccept:
      1          /*
      2          *********************************************************************************************************
      3          *                                                uC/OS-II
      4          *                                          The Real-Time Kernel
      5          *                                         EVENT FLAG  MANAGEMENT
      6          *
      7          *                          (c) Copyright 2001-2002, Jean J. Labrosse, Weston, FL
      8          *                                           All Rights Reserved
      9          *
     10          * File : OS_FLAG.C
     11          * By   : Jean J. Labrosse
     12          *********************************************************************************************************
     13          */
     14          
     15          #ifndef  OS_MASTER_FILE
     16          #include "INCLUDES.H"
     17          #endif
     18          
     19          #if (OS_VERSION >= 251) && (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
     20          /*
     21          *********************************************************************************************************
     22          *                                            LOCAL PROTOTYPES
     23          *********************************************************************************************************
     24          */
     25          
     26          static  void     OS_FlagBlock(OS_FLAG_GRP *pgrp, OS_FLAG_NODE *pnode, OS_FLAGS flags, INT8U wait_type, INT16U timeout);
     27          static  BOOLEAN  OS_FlagTaskRdy(OS_FLAG_NODE *pnode, OS_FLAGS flags_rdy);
     28          
     29          /*$PAGE*/
     30          /*
     31          *********************************************************************************************************
     32          *                              CHECK THE STATUS OF FLAGS IN AN EVENT FLAG GROUP
     33          *
     34          * Description: This function is called to check the status of a combination of bits to be set or cleared
     35          *              in an event flag group.  Your application can check for ANY bit to be set/cleared or ALL
     36          *              bits to be set/cleared.
     37          *
     38          *              This call does not block if the desired flags are not present.
     39          *
     40          * Arguments  : pgrp          is a pointer to the desired event flag group.
     41          *
     42          *              flags         Is a bit pattern indicating which bit(s) (i.e. flags) you wish to check.
     43          *                            The bits you want are specified by setting the corresponding bits in
     44          *                            'flags'.  e.g. if your application wants to wait for bits 0 and 1 then
     45          *                            'flags' would contain 0x03.
     46          *
     47          *              wait_type     specifies whether you want ALL bits to be set/cleared or ANY of the bits
     48          *                            to be set/cleared.
     49          *                            You can specify the following argument:
     50          *
     51          *                            OS_FLAG_WAIT_CLR_ALL   You will check ALL bits in 'flags' to be clear (0)
     52          *                            OS_FLAG_WAIT_CLR_ANY   You will check ANY bit  in 'flags' to be clear (0)
     53          *                            OS_FLAG_WAIT_SET_ALL   You will check ALL bits in 'flags' to be set   (1)
     54          *                            OS_FLAG_WAIT_SET_ANY   You will check ANY bit  in 'flags' to be set   (1)
     55          *
     56          *                            NOTE: Add OS_FLAG_CONSUME if you want the event flag to be 'consumed' by
     57          *                                  the call.  Example, to wait for any flag in a group AND then clear
     58          *                                  the flags that are present, set 'wait_type' to:
     59          *
     60          *                                  OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME
     61          *
     62          *              err           is a pointer to an error code and can be:
     63          *                            OS_NO_ERR              No error
     64          *                            OS_ERR_EVENT_TYPE      You are not pointing to an event flag group
     65          *                            OS_FLAG_ERR_WAIT_TYPE  You didn't specify a proper 'wait_type' argument.
     66          *                            OS_FLAG_INVALID_PGRP   You passed a NULL pointer instead of the event flag
     67          *                                                   group handle.
     68          *                            OS_FLAG_ERR_NOT_RDY    The desired flags you are waiting for are not
     69          *                                                   available.
     70          *
     71          * Returns    : The state of the flags in the event flag group.
     72          *
     73          * Called from: Task or ISR
     74          *********************************************************************************************************
     75          */
     76          
     77          #if OS_FLAG_ACCEPT_EN > 0
     78          OS_FLAGS  OSFlagAccept (OS_FLAG_GRP *pgrp, OS_FLAGS flags, INT8U wait_type, INT8U *err)
     79          {
   \   0000  0A12              PUSH    R10     
   \   0002  5D410400          MOV.B   4(SP),R13       
   \   0006  1A410600          MOV     6(SP),R10       
     80          #if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register */
     81              OS_CPU_SR     cpu_sr;
     82          #endif
     83              OS_FLAGS      flags_cur;
     84              OS_FLAGS      flags_rdy;
     85              BOOLEAN       consume;
     86          
     87          
     88          #if OS_ARG_CHK_EN > 0
     89              if (pgrp == (OS_FLAG_GRP *)0) {                        /* Validate 'pgrp'                          */
   \   000A  0C93              CMP     #0,R12  
   \   000C  0420              JNE     (?0059) 
     90                  *err = OS_FLAG_INVALID_PGRP;
   \   000E  FA409600          MOV.B   #150,0(R10)     
   \   0012  0000
     91                  return ((OS_FLAGS)0);
     92              }
   \   0014  683C              JMP     (?0091) 
   \   0016            ?0059:
     93              if (pgrp->OSFlagType != OS_EVENT_TYPE_FLAG) {          /* Validate event block type                */
   \   0016  7F400500          MOV.B   #5,R15  
   \   001A  6F9C              CMP.B   @R12,R15        
   \   001C  0424              JEQ     (?0061) 
     94                  *err = OS_ERR_EVENT_TYPE;
   \   001E  DA430000          MOV.B   #1,0(R10)       
     95                  return ((OS_FLAGS)0);
   \   0022  0C43              MOV     #0,R12  
     96              }
   \   0024  603C              JMP     (?0091) 
   \   0026            ?0061:
     97          #endif
     98              if (wait_type & OS_FLAG_CONSUME) {                     /* See if we need to consume the flags      */
   \   0026  7DB08000          BIT.B   #128,R13        
   \   002A  0424              JEQ     (?0063) 
     99                  wait_type &= ~OS_FLAG_CONSUME;
   \   002C  7DF07F00          AND.B   #127,R13        
    100                  consume    = TRUE;
   \   0030  5F43              MOV.B   #1,R15  
    101              } else {
   \   0032  013C              JMP     (?0064) 
   \   0034            ?0063:
    102                  consume    = FALSE;
   \   0034  4F43              MOV.B   #0,R15  
   \   0036            ?0064:
    103              }
    104          /*$PAGE*/
    105              *err = OS_NO_ERR;                                      /* Assume NO error until proven otherwise.  */
   \   0036  CA430000          MOV.B   #0,0(R10)       
    106              OS_ENTER_CRITICAL();
   \   003A  32C2              DINT            
    107              switch (wait_type) {
   \   003C  2D92              CMP     #4,R13  
   \   003E  4D2C              JC      (?0090) 
   \   0040  0D5D              ADD     R13,R13 
   \   0042  104D4600          BR      ?0217(R13)      
   \   0046            ?0217:
   \   0046  9400              DW      ?0078   
   \   0048  B800              DW      ?0084   
   \   004A  4E00              DW      ?0066   
   \   004C  7200              DW      ?0072   
   \   004E            ?0066:
    108                  case OS_FLAG_WAIT_SET_ALL:                         /* See if all required flags are set        */
    109                       flags_rdy = pgrp->OSFlagFlags & flags;        /* Extract only the bits we want            */
   \   004E  1D4C0400          MOV     4(R12),R13      
   \   0052  0DFE              AND     R14,R13 
    110                       if (flags_rdy == flags) {                     /* Must match ALL the bits that we want     */
   \   0054  0E9D              CMP     R13,R14 
   \   0056  0620              JNE     (?0068) 
    111                           if (consume == TRUE) {                    /* See if we need to consume the flags      */
   \   0058  5F93              CMP.B   #1,R15  
   \   005A  0720              JNE     (?0071) 
    112                               pgrp->OSFlagFlags &= ~flags_rdy;      /* Clear ONLY the flags that we wanted      */
   \   005C  3DE3              XOR     #-1,R13 
   \   005E  8CFD0400          AND     R13,4(R12)      
    113                           }
    114                       } else {
   \   0062  033C              JMP     (?0071) 
   \   0064            ?0068:
    115                           *err  = OS_FLAG_ERR_NOT_RDY;
   \   0064  FA409800          MOV.B   #152,0(R10)     
   \   0068  0000
   \   006A            ?0071:
    116                       }
    117                       flags_cur = pgrp->OSFlagFlags;                /* Will return the state of the group       */

⌨️ 快捷键说明

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