lib_str.lst

来自「针对STM32F103的UCOS移植」· LST 代码 · 共 1,098 行 · 第 1/5 页

LST
1,098
字号
##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 KICKSTART     13/Mar/2009  16:00:57 #
# Copyright 1999-2005 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode        =  thumb                                                #
#    Endian          =  little                                               #
#    Stack alignment =  4                                                    #
#    Source file     =  E:\UC_OS\Micrium\Software\uC-LIB\lib_str.c           #
#    Command line    =  E:\UC_OS\Micrium\Software\uC-LIB\lib_str.c -lCN      #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\Flash\List\ -o                        #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\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          #
#                       "C:\Program Files\IAR Systems\Embedded Workbench     #
#                       4.0 Kickstart\arm\LIB\dl7mptnnl8n.h" -I              #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\ -I E:\UC_OS\Micrium\Software\EvalBoa #
#                       rds\ST\STM3210B-EVAL\IAR\OS-Probe\..\..\..\..\..\uco #
#                       s-ii\ports\arm-cortex-m3\generic\iar\ -I             #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\ucos-ii\source\ -I     #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uc-lib\ -I             #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uc-cpu\ -I             #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uc-cpu\ARM-Cortex-M3\I #
#                       AR\ -I E:\UC_OS\Micrium\Software\EvalBoards\ST\STM32 #
#                       10B-EVAL\IAR\OS-Probe\..\..\..\..\..\cpu\st\stm32\in #
#                       c\ -I E:\UC_OS\Micrium\Software\EvalBoards\ST\STM321 #
#                       0B-EVAL\IAR\OS-Probe\..\BSP\ -I                      #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
#                       ication\Generic\RS-232\Source\ -I                    #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
#                       ication\Generic\RS-232\Ports\ST\STM32\ -I            #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
#                       ication\Generic\Source\ -I                           #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Plugin #
#                       s\uCOS-II\ -I "C:\Program Files\IAR                  #
#                       Systems\Embedded Workbench 4.0 Kickstart\arm\INC\"   #
#    List file       =  E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\Flash\List\lib_str.lst                #
#    Object file     =  E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\Flash\Obj\lib_str.r79                 #
#                                                                            #
#                                                                            #
##############################################################################

E:\UC_OS\Micrium\Software\uC-LIB\lib_str.c
      1          /*
      2          *********************************************************************************************************
      3          *                                               uC/LIB
      4          *                                       CUSTOM LIBRARY MODULES
      5          *
      6          *                          (c) Copyright 2004-2007; Micrium, Inc.; Weston, FL
      7          *
      8          *               All rights reserved.  Protected by international copyright laws.
      9          *
     10          *               uC/LIB is provided in source form for FREE evaluation, for educational
     11          *               use or peaceful research.  If you plan on using uC/LIB in a commercial
     12          *               product you need to contact Micrium to properly license its use in your
     13          *               product.  We provide ALL the source code for your convenience and to
     14          *               help you experience uC/LIB.  The fact that the source code is provided
     15          *               does NOT mean that you can use it without paying a licensing fee.
     16          *
     17          *               Knowledge of the source code may NOT be used to develop a similar product.
     18          *
     19          *               Please help us continue to provide the Embedded community with the finest
     20          *               software available.  Your honesty is greatly appreciated.
     21          *********************************************************************************************************
     22          */
     23          
     24          /*
     25          *********************************************************************************************************
     26          *
     27          *                                       ASCII STRING MANAGEMENT
     28          *
     29          * Filename      : lib_str.c
     30          * Version       : V1.24
     31          * Programmer(s) : ITJ
     32          *                 JDH
     33          *********************************************************************************************************
     34          * Note(s)       : (1) NO compiler-supplied standard library functions are used in library or product software.
     35          *
     36          *                     (a) ALL standard library functions are implemented in the custom library modules :
     37          *
     38          *                         (1) \<Custom Library Directory>\lib*.*
     39          *
     40          *                         (2) \<Custom Library Directory>\Ports\<cpu>\<compiler>\lib*_a.*
     41          *
     42          *                               where
     43          *                                       <Custom Library Directory>      directory path for custom library software
     44          *                                       <cpu>                           directory name for specific processor (CPU)
     45          *                                       <compiler>                      directory name for specific compiler
     46          *
     47          *                     (b) Product-specific library functions are implemented in individual products.
     48          *********************************************************************************************************
     49          */
     50          
     51          
     52          /*
     53          *********************************************************************************************************
     54          *                                            INCLUDE FILES
     55          *********************************************************************************************************
     56          */
     57          
     58          #define    LIB_STR_MODULE
     59          #include  <lib_str.h>
     60          
     61          
     62          /*$PAGE*/
     63          /*
     64          *********************************************************************************************************
     65          *                                            LOCAL DEFINES
     66          *********************************************************************************************************
     67          */
     68          
     69          
     70          /*
     71          *********************************************************************************************************
     72          *                                           LOCAL CONSTANTS
     73          *********************************************************************************************************
     74          */
     75          
     76          
     77          /*
     78          *********************************************************************************************************
     79          *                                          LOCAL DATA TYPES
     80          *********************************************************************************************************
     81          */
     82          
     83          
     84          /*
     85          *********************************************************************************************************
     86          *                                            LOCAL TABLES
     87          *********************************************************************************************************
     88          */
     89          
     90          
     91          /*
     92          *********************************************************************************************************
     93          *                                       LOCAL GLOBAL VARIABLES
     94          *********************************************************************************************************
     95          */
     96          
     97          
     98          /*
     99          *********************************************************************************************************
    100          *                                      LOCAL FUNCTION PROTOTYPES
    101          *********************************************************************************************************
    102          */
    103          
    104          
    105          /*
    106          *********************************************************************************************************
    107          *                                     LOCAL CONFIGURATION ERRORS
    108          *********************************************************************************************************
    109          */
    110          
    111          
    112          /*$PAGE*/
    113          /*
    114          *********************************************************************************************************
    115          *                                              Str_Len()
    116          *
    117          * Description : Calculate length of a string.
    118          *
    119          * Argument(s) : pstr        Pointer to string (see Note #1).
    120          *
    121          * Return(s)   : Length of string; number of characters in string before terminating NULL character.
    122          *
    123          * Caller(s)   : various.
    124          *
    125          * Note(s)     : (1) String buffer NOT modified.
    126          *
    127          *               (2) String length calculation terminates when :
    128          *
    129          *                   (a) String pointer points to NULL.
    130          *                       (1) String buffer overlaps with NULL address.
    131          *                       (2) String length calculated for string up to but NOT beyond or including
    132          *                           the NULL address.
    133          *
    134          *                   (b) Terminating NULL character found.
    135          *                       (1) String length calculated for string up to but NOT           including
    136          *                           the NULL character.
    137          *********************************************************************************************************
    138          */
    139          

   \                                 In segment CODE, align 4, keep-with-next
    140          CPU_SIZE_T  Str_Len (CPU_CHAR  *pstr)
    141          {
   \                     Str_Len:
   \   00000000   0100               MOVS     R1,R0
    142              CPU_SIZE_T  len;
    143          
    144          
    145              len = 0;
   \   00000002   0020               MOVS     R0,#+0
   \   00000004   01E0               B.N      ??Str_Len_0
    146              while (( pstr != (CPU_CHAR *)0) &&                          /* Calc str len until NULL ptr (see Note #2a) ...       */
    147                     (*pstr != (CPU_CHAR  )0)) {                          /* ... or NULL char found      (see Note #2b).          */
    148                  len++;
   \                     ??Str_Len_1:
   \   00000006   401C               ADDS     R0,R0,#+1
    149                  pstr++;
   \   00000008   491C               ADDS     R1,R1,#+1
    150              }
   \                     ??Str_Len_0:
   \   0000000A   0029               CMP      R1,#+0
   \   0000000C   02D0               BEQ.N    ??Str_Len_2
   \   0000000E   0A78               LDRB     R2,[R1, #+0]

⌨️ 快捷键说明

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