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

📄 os_flag.lst

📁 编译环境是 iar EWARM ,STM32 下的UCOSII
💻 LST
📖 第 1 页 / 共 5 页
字号:
##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 KICKSTART     26/Dec/2008  18:22:02 #
# Copyright 1999-2005 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode        =  thumb                                                #
#    Endian          =  little                                               #
#    Stack alignment =  4                                                    #
#    Source file     =  F:\PROJECT\STM32_UCOSII\uCOS-II\Source\os_flag.c     #
#    Command line    =  F:\PROJECT\STM32_UCOSII\uCOS-II\Source\os_flag.c     #
#                       -lCN F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E- #
#                       EVAL\IAR\OS-Probe\Flash\List\ -o                     #
#                       F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\Flash\Obj\ -z6 --no_unroll --no_inline  #
#                       --no_tbaa --no_scheduling --debug --cpu_mode thumb   #
#                       --endian little --cpu cortex-M3 --stack_align 4 -e   #
#                       --fpu None --dlib_config "E:\Program Files\IAR       #
#                       Systems\Embedded Workbench 4.0                       #
#                       Kickstart\arm\LIB\dl7mptnnl8n.h" -I                  #
#                       F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\ -I F:\PROJECT\STM32_UCOSII\EvalBoards\ #
#                       ST\STM3210E-EVAL\IAR\OS-Probe\..\BSP\ -I             #
#                       F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\..\..\..\..\..\CPU\ST\STM32\inc\ -I     #
#                       F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\..\..\..\..\..\uC-CPU\ -I               #
#                       F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\..\..\..\..\..\uC-CPU\ARM-Cortex-M3\IAR #
#                       \ -I F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E- #
#                       EVAL\IAR\OS-Probe\..\..\..\..\..\uC-LCD\Source\ -I   #
#                       F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\..\..\..\..\..\uC-LIB\ -I               #
#                       F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\..\..\..\..\..\uCOS-II\Ports\ARM-Cortex #
#                       -M3\Generic\IAR\ -I F:\PROJECT\STM32_UCOSII\EvalBoar #
#                       ds\ST\STM3210E-EVAL\IAR\OS-Probe\..\..\..\..\..\uCOS #
#                       -II\Source\ -I F:\PROJECT\STM32_UCOSII\EvalBoards\ST #
#                       \STM3210E-EVAL\IAR\OS-Probe\..\..\..\..\..\uC-Probe\ #
#                       Target\Communication\Generic\RS-232\Source\ -I       #
#                       F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Communic #
#                       ation\Generic\RS-232\Ports\ST\STM32\ -I              #
#                       F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Communic #
#                       ation\Generic\Source\ -I F:\PROJECT\STM32_UCOSII\Eva #
#                       lBoards\ST\STM3210E-EVAL\IAR\OS-Probe\..\..\..\..\.. #
#                       \uC-Probe\Target\Plugins\uCOS-II\ -I "E:\Program     #
#                       Files\IAR Systems\Embedded Workbench 4.0             #
#                       Kickstart\arm\INC\"                                  #
#    List file       =  F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\Flash\List\os_flag.lst                  #
#    Object file     =  F:\PROJECT\STM32_UCOSII\EvalBoards\ST\STM3210E-EVAL\ #
#                       IAR\OS-Probe\Flash\Obj\os_flag.r79                   #
#                                                                            #
#                                                                            #
##############################################################################

F:\PROJECT\STM32_UCOSII\uCOS-II\Source\os_flag.c
      1          /*
      2          *********************************************************************************************************
      3          *                                                uC/OS-II
      4          *                                          The Real-Time Kernel
      5          *                                         EVENT FLAG  MANAGEMENT
      6          *
      7          *                              (c) Copyright 1992-2007, Micrium, Weston, FL
      8          *                                           All Rights Reserved
      9          *
     10          * File    : OS_FLAG.C
     11          * By      : Jean J. Labrosse
     12          * Version : V2.86
     13          *
     14          * LICENSING TERMS:
     15          * ---------------
     16          *   uC/OS-II is provided in source form for FREE evaluation, for educational use or for peaceful research.  
     17          * If you plan on using  uC/OS-II  in a commercial product you need to contact Micri祄 to properly license 
     18          * its use in your product. We provide ALL the source code for your convenience and to help you experience 
     19          * uC/OS-II.   The fact that the  source is provided does  NOT  mean that you can use it without  paying a 
     20          * licensing fee.
     21          *********************************************************************************************************
     22          */
     23          
     24          #ifndef  OS_MASTER_FILE
     25          #include <ucos_ii.h>
     26          #endif
     27          
     28          #if (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
     29          /*
     30          *********************************************************************************************************
     31          *                                            LOCAL PROTOTYPES
     32          *********************************************************************************************************
     33          */
     34          
     35          static  void     OS_FlagBlock(OS_FLAG_GRP *pgrp, OS_FLAG_NODE *pnode, OS_FLAGS flags, INT8U wait_type, INT16U timeout);
     36          static  BOOLEAN  OS_FlagTaskRdy(OS_FLAG_NODE *pnode, OS_FLAGS flags_rdy);
     37          
     38          /*$PAGE*/
     39          /*
     40          *********************************************************************************************************
     41          *                              CHECK THE STATUS OF FLAGS IN AN EVENT FLAG GROUP
     42          *
     43          * Description: This function is called to check the status of a combination of bits to be set or cleared
     44          *              in an event flag group.  Your application can check for ANY bit to be set/cleared or ALL
     45          *              bits to be set/cleared.
     46          *
     47          *              This call does not block if the desired flags are not present.
     48          *
     49          * Arguments  : pgrp          is a pointer to the desired event flag group.
     50          *
     51          *              flags         Is a bit pattern indicating which bit(s) (i.e. flags) you wish to check.
     52          *                            The bits you want are specified by setting the corresponding bits in
     53          *                            'flags'.  e.g. if your application wants to wait for bits 0 and 1 then
     54          *                            'flags' would contain 0x03.
     55          *
     56          *              wait_type     specifies whether you want ALL bits to be set/cleared or ANY of the bits
     57          *                            to be set/cleared.
     58          *                            You can specify the following argument:
     59          *
     60          *                            OS_FLAG_WAIT_CLR_ALL   You will check ALL bits in 'flags' to be clear (0)
     61          *                            OS_FLAG_WAIT_CLR_ANY   You will check ANY bit  in 'flags' to be clear (0)
     62          *                            OS_FLAG_WAIT_SET_ALL   You will check ALL bits in 'flags' to be set   (1)
     63          *                            OS_FLAG_WAIT_SET_ANY   You will check ANY bit  in 'flags' to be set   (1)
     64          *
     65          *                            NOTE: Add OS_FLAG_CONSUME if you want the event flag to be 'consumed' by
     66          *                                  the call.  Example, to wait for any flag in a group AND then clear
     67          *                                  the flags that are present, set 'wait_type' to:
     68          *
     69          *                                  OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME
     70          *
     71          *              perr          is a pointer to an error code and can be:
     72          *                            OS_ERR_NONE               No error
     73          *                            OS_ERR_EVENT_TYPE         You are not pointing to an event flag group
     74          *                            OS_ERR_FLAG_WAIT_TYPE     You didn't specify a proper 'wait_type' argument.
     75          *                            OS_ERR_FLAG_INVALID_PGRP  You passed a NULL pointer instead of the event flag
     76          *                                                      group handle.
     77          *                            OS_ERR_FLAG_NOT_RDY       The desired flags you are waiting for are not
     78          *                                                      available.
     79          *
     80          * Returns    : The flags in the event flag group that made the task ready or, 0 if a timeout or an error
     81          *              occurred.
     82          *
     83          * Called from: Task or ISR
     84          *
     85          * Note(s)    : 1) IMPORTANT, the behavior of this function has changed from PREVIOUS versions.  The
     86          *                 function NOW returns the flags that were ready INSTEAD of the current state of the
     87          *                 event flags.
     88          *********************************************************************************************************
     89          */
     90          
     91          #if OS_FLAG_ACCEPT_EN > 0

   \                                 In segment CODE, align 4, keep-with-next
     92          OS_FLAGS  OSFlagAccept (OS_FLAG_GRP *pgrp, OS_FLAGS flags, INT8U wait_type, INT8U *perr)
     93          {
   \                     OSFlagAccept:
   \   00000000   2DE9F043           PUSH     {R4-R9,LR}
   \   00000004   8846               MOV      R8,R1
   \   00000006   0400               MOVS     R4,R0
   \   00000008   1500               MOVS     R5,R2
   \   0000000A   1E00               MOVS     R6,R3
     94              OS_FLAGS      flags_rdy;
     95              INT8U         result;
     96              BOOLEAN       consume;
     97          #if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register */
     98              OS_CPU_SR     cpu_sr = 0;
     99          #endif
    100          
    101          
    102          
    103          #if OS_ARG_CHK_EN > 0
    104              if (perr == (INT8U *)0) {                              /* Validate 'perr'                          */
    105                  return ((OS_FLAGS)0);
    106              }
    107              if (pgrp == (OS_FLAG_GRP *)0) {                        /* Validate 'pgrp'                          */
    108                  *perr = OS_ERR_FLAG_INVALID_PGRP;
    109                  return ((OS_FLAGS)0);
    110              }
    111          #endif
    112              if (pgrp->OSFlagType != OS_EVENT_TYPE_FLAG) {          /* Validate event block type                */
   \   0000000C   0127               MOVS     R7,#+1
   \   0000000E   2078               LDRB     R0,[R4, #+0]
   \   00000010   0528               CMP      R0,#+5
   \   00000012   02D0               BEQ.N    ??OSFlagAccept_1
    113                  *perr = OS_ERR_EVENT_TYPE;
   \   00000014   3770               STRB     R7,[R6, #+0]
    114                  return ((OS_FLAGS)0);
   \   00000016   0020               MOVS     R0,#+0
   \   00000018   4CE0               B.N      ??OSFlagAccept_2
    115              }
    116              result = (INT8U)(wait_type & OS_FLAG_CONSUME);
    117              if (result != (INT8U)0) {                              /* See if we need to consume the flags      */
   \                     ??OSFlagAccept_1:
   \   0000001A   0020               MOVS     R0,#+0
   \   0000001C   8146               MOV      R9,R0
   \   0000001E   2806               LSLS     R0,R5,#+24
   \   00000020   02D5               BPL.N    ??OSFlagAccept_3
    118                  wait_type &= ~OS_FLAG_CONSUME;
   \   00000022   6D06               LSLS     R5,R5,#+25
   \   00000024   6D0E               LSRS     R5,R5,#+25
    119                  consume    = OS_TRUE;
   \   00000026   00E0               B.N      ??OSFlagAccept_4
    120              } else {
    121                  consume    = OS_FALSE;
   \                     ??OSFlagAccept_3:
   \   00000028   4F46               MOV      R7,R9
    122              }
    123          /*$PAGE*/
    124              *perr = OS_ERR_NONE;                                   /* Assume NO error until proven otherwise.  */

⌨️ 快捷键说明

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