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

📄 dynamic.lst

📁 本代码已经经过修改
💻 LST
📖 第 1 页 / 共 4 页
字号:
##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.30A/W32 KICKSTART     14/Dec/2005  14:41:44 #
# Copyright 1999-2005 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode        =  interwork                                            #
#    Endian          =  little                                               #
#    Stack alignment =  4                                                    #
#    Source file     =  D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\Common\Minimal #
#                       \dynamic.c                                           #
#    Command line    =  D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\Common\Minimal #
#                       \dynamic.c -D _NDEBUG -D STR71X_IAR -lC              #
#                       D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
#                       R\binary\List\ --diag_suppress pe191,pa082 -o        #
#                       D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
#                       R\binary\Obj\ -s9 --no_clustering --cpu_mode thumb   #
#                       --endian little --cpu ARM7TDMI --stack_align 4       #
#                       --interwork -e --require_prototypes --fpu None       #
#                       --dlib_config "C:\Program Files\IAR                  #
#                       Systems\Embedded Workbench 4.0                       #
#                       Kickstart\arm\LIB\dl4tptinl8n.h" -I                  #
#                       D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
#                       R\ -I D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR #
#                       71x_IAR\library\include\ -I                          #
#                       D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
#                       R\..\common\include\ -I D:\board\FreeRTOSV3.2.3\Free #
#                       RTOS\Demo\ARM7_STR71x_IAR\..\..\source\include\ -I   #
#                       "C:\Program Files\IAR Systems\Embedded Workbench     #
#                       4.0 Kickstart\arm\INC\"                              #
#    List file       =  D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
#                       R\binary\List\dynamic.lst                            #
#    Object file     =  D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
#                       R\binary\Obj\dynamic.r79                             #
#                                                                            #
#                                                                            #
##############################################################################

D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\Common\Minimal\dynamic.c
      1          /*
      2          	FreeRTOS V3.2.3 - Copyright (C) 2003-2005 Richard Barry.
      3          
      4          	This file is part of the FreeRTOS distribution.
      5          
      6          	FreeRTOS is free software; you can redistribute it and/or modify
      7          	it under the terms of the GNU General Public License as published by
      8          	the Free Software Foundation; either version 2 of the License, or
      9          	(at your option) any later version.
     10          
     11          	FreeRTOS is distributed in the hope that it will be useful,
     12          	but WITHOUT ANY WARRANTY; without even the implied warranty of
     13          	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     14          	GNU General Public License for more details.
     15          
     16          	You should have received a copy of the GNU General Public License
     17          	along with FreeRTOS; if not, write to the Free Software
     18          	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     19          
     20          	A special exception to the GPL can be applied should you wish to distribute
     21          	a combined work that includes FreeRTOS, without being obliged to provide
     22          	the source code for any proprietary components.  See the licensing section 
     23          	of http://www.FreeRTOS.org for full details of how and when the exception
     24          	can be applied.
     25          
     26          	***************************************************************************
     27          	See http://www.FreeRTOS.org for documentation, latest information, license 
     28          	and contact details.  Please ensure to read the configuration and relevant 
     29          	port sections of the online documentation.
     30          	***************************************************************************
     31          */
     32          
     33          /*
     34           * The first test creates three tasks - two counter tasks (one continuous count 
     35           * and one limited count) and one controller.  A "count" variable is shared 
     36           * between all three tasks.  The two counter tasks should never be in a "ready" 
     37           * state at the same time.  The controller task runs at the same priority as 
     38           * the continuous count task, and at a lower priority than the limited count 
     39           * task.
     40           *
     41           * One counter task loops indefinitely, incrementing the shared count variable
     42           * on each iteration.  To ensure it has exclusive access to the variable it
     43           * raises it's priority above that of the controller task before each 
     44           * increment, lowering it again to it's original priority before starting the
     45           * next iteration.
     46           *
     47           * The other counter task increments the shared count variable on each
     48           * iteration of it's loop until the count has reached a limit of 0xff - at
     49           * which point it suspends itself.  It will not start a new loop until the 
     50           * controller task has made it "ready" again by calling vTaskResume ().  
     51           * This second counter task operates at a higher priority than controller 
     52           * task so does not need to worry about mutual exclusion of the counter 
     53           * variable.
     54           *
     55           * The controller task is in two sections.  The first section controls and
     56           * monitors the continuous count task.  When this section is operational the 
     57           * limited count task is suspended.  Likewise, the second section controls 
     58           * and monitors the limited count task.  When this section is operational the 
     59           * continuous count task is suspended.
     60           *
     61           * In the first section the controller task first takes a copy of the shared
     62           * count variable.  To ensure mutual exclusion on the count variable it
     63           * suspends the continuous count task, resuming it again when the copy has been
     64           * taken.  The controller task then sleeps for a fixed period - during which
     65           * the continuous count task will execute and increment the shared variable.
     66           * When the controller task wakes it checks that the continuous count task
     67           * has executed by comparing the copy of the shared variable with its current
     68           * value.  This time, to ensure mutual exclusion, the scheduler itself is 
     69           * suspended with a call to vTaskSuspendAll ().  This is for demonstration 
     70           * purposes only and is not a recommended technique due to its inefficiency.
     71           *
     72           * After a fixed number of iterations the controller task suspends the 
     73           * continuous count task, and moves on to its second section.
     74           *
     75           * At the start of the second section the shared variable is cleared to zero.
     76           * The limited count task is then woken from it's suspension by a call to
     77           * vTaskResume ().  As this counter task operates at a higher priority than
     78           * the controller task the controller task should not run again until the
     79           * shared variable has been counted up to the limited value causing the counter
     80           * task to suspend itself.  The next line after vTaskResume () is therefore
     81           * a check on the shared variable to ensure everything is as expected.
     82           *
     83           *
     84           * The second test consists of a couple of very simple tasks that post onto a 
     85           * queue while the scheduler is suspended.  This test was added to test parts
     86           * of the scheduler not exercised by the first test.
     87           *
     88           */
     89          
     90          #include <stdlib.h>
     91          
     92          /* Scheduler include files. */
     93          #include "FreeRTOS.h"
     94          #include "task.h"
     95          #include "semphr.h"
     96          
     97          /* Demo app include files. */
     98          #include "dynamic.h"
     99          
    100          /* Function that implements the "limited count" task as described above. */
    101          static portTASK_FUNCTION_PROTO( vLimitedIncrementTask, pvParameters );
    102          
    103          /* Function that implements the "continuous count" task as described above. */
    104          static portTASK_FUNCTION_PROTO( vContinuousIncrementTask, pvParameters );
    105          
    106          /* Function that implements the controller task as described above. */
    107          static portTASK_FUNCTION_PROTO( vCounterControlTask, pvParameters );
    108          
    109          static portTASK_FUNCTION_PROTO( vQueueReceiveWhenSuspendedTask, pvParameters );
    110          static portTASK_FUNCTION_PROTO( vQueueSendWhenSuspendedTask, pvParameters );
    111          
    112          /* Demo task specific constants. */
    113          #define priSTACK_SIZE				( ( unsigned portSHORT ) 128 )
    114          #define priSLEEP_TIME				( ( portTickType ) 50 )
    115          #define priLOOPS					( 5 )
    116          #define priMAX_COUNT				( ( unsigned portLONG ) 0xff )
    117          #define priNO_BLOCK					( ( portTickType ) 0 )
    118          #define priSUSPENDED_QUEUE_LENGTH	( 1 )
    119          
    120          /*-----------------------------------------------------------*/
    121          
    122          /* Handles to the two counter tasks.  These could be passed in as parameters
    123          to the controller task to prevent them having to be file scope. */

   \                                 In segment DATA_Z, align 4, align-sorted
    124          static xTaskHandle xContinousIncrementHandle, xLimitedIncrementHandle;
   \                     ??xContinousIncrementHandle:
   \   00000000                      DS8 4

   \                                 In segment DATA_Z, align 4, align-sorted
   \                     ??xLimitedIncrementHandle:
   \   00000000                      DS8 4
    125          
    126          /* The shared counter variable.  This is passed in as a parameter to the two 
    127          counter variables for demonstration purposes. */

   \                                 In segment DATA_Z, align 4, align-sorted
    128          static unsigned portLONG ulCounter;
   \                     ??ulCounter:
   \   00000000                      DS8 4
    129          
    130          /* Variables used to check that the tasks are still operating without error.
    131          Each complete iteration of the controller task increments this variable
    132          provided no errors have been found.  The variable maintaining the same value
    133          is therefore indication of an error. */

   \                                 In segment DATA_Z, align 2, align-sorted
    134          static unsigned portSHORT usCheckVariable = ( unsigned portSHORT ) 0;
   \                     ??usCheckVariable:
   \   00000000                      DS8 2

   \                                 In segment DATA_Z, align 4, align-sorted
    135          static portBASE_TYPE xSuspendedQueueSendError = pdFALSE;
   \                     ??xSuspendedQueueSendError:
   \   00000000                      DS8 4

   \                                 In segment DATA_Z, align 4, align-sorted
    136          static portBASE_TYPE xSuspendedQueueReceiveError = pdFALSE;
   \                     ??xSuspendedQueueReceiveError:
   \   00000000                      DS8 4
    137          
    138          /* Queue used by the second test. */

   \                                 In segment DATA_Z, align 4, align-sorted
    139          xQueueHandle xSuspendedTestQueue;
   \                     xSuspendedTestQueue:
   \   00000000                      DS8 4
    140          
    141          /*-----------------------------------------------------------*/
    142          /*
    143           * Start the three tasks as described at the top of the file.
    144           * Note that the limited count task is given a higher priority.
    145           */

   \                                 In segment CODE, align 4, keep-with-next
    146          void vStartDynamicPriorityTasks( void )

⌨️ 快捷键说明

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