]> git.sur5r.net Git - freertos/commitdiff
Continue work on XMC1000 demos.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sun, 1 Sep 2013 20:06:31 +0000 (20:06 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sun, 1 Sep 2013 20:06:31 +0000 (20:06 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2016 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

14 files changed:
FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/.cproject
FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/.project
FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/Atollic_Specific/RegTest.c
FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/FreeRTOSConfig.h
FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/RegTest_IAR.s
FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/Keil_Specific/RegTest_Keil.s
FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.ewd
FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.ewp
FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.uvopt
FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.uvproj
FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/main-full.c
FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/main.c
FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/settings/RTOSDemo.dni
FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/settings/RTOSDemo.wsdt

index 7aefb8212620e9cad8c174e99770d6643964927c..f1fe74e9f7288c65ce1724301e3636ceb053b40b 100644 (file)
@@ -57,6 +57,7 @@
                                                                <option id="com.atollic.truestudio.common_options.target.endianess.1238437628" name="Endianess" superClass="com.atollic.truestudio.common_options.target.endianess"/>\r
                                                                <option id="com.atollic.truestudio.gcc.optimization.prep_garbage.1914199267" name="Prepare dead code removal" superClass="com.atollic.truestudio.gcc.optimization.prep_garbage" value="true" valueType="boolean"/>\r
                                                                <option id="com.atollic.truestudio.gcc.optimization.prep_data.989109200" name="Prepare dead data removal" superClass="com.atollic.truestudio.gcc.optimization.prep_data" value="true" valueType="boolean"/>\r
+                                                               <option id="com.atollic.truestudio.exe.debug.toolchain.gcc.optimization.level.47441462" name="Optimization Level" superClass="com.atollic.truestudio.exe.debug.toolchain.gcc.optimization.level" value="com.atollic.truestudio.gcc.optimization.level.00" valueType="enumerated"/>\r
                                                                <inputType id="com.atollic.truestudio.gcc.input.1008000819" superClass="com.atollic.truestudio.gcc.input"/>\r
                                                        </tool>\r
                                                        <tool id="com.atollic.truestudio.exe.debug.toolchain.ld.298485676" name="C Linker" superClass="com.atollic.truestudio.exe.debug.toolchain.ld">\r
                                                        <tool id="com.atollic.truestudio.exe.debug.toolchain.secoutput.31389710" name="Other" superClass="com.atollic.truestudio.exe.debug.toolchain.secoutput"/>\r
                                                </toolChain>\r
                                        </folderInfo>\r
-                                       <fileInfo id="com.atollic.truestudio.exe.debug.2093031755.1258798340" name="main-full.c" rcbsApplicability="disable" resourcePath="main-full.c" toolsToInvoke="com.atollic.truestudio.exe.debug.toolchain.gcc.37591077.227330701">\r
-                                               <tool id="com.atollic.truestudio.exe.debug.toolchain.gcc.37591077.227330701" name="C Compiler" superClass="com.atollic.truestudio.exe.debug.toolchain.gcc.37591077"/>\r
-                                       </fileInfo>\r
                                        <sourceEntries>\r
                                                <entry excluding="Keil_Specific|IAR_Specific" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>\r
                                        </sourceEntries>\r
index 7a0005113ab15b32156919e2970c266f50ad1fa0..1be489f74bdcd5b5708031d1096936c78d3537b0 100644 (file)
                        <type>2</type>\r
                        <locationURI>virtual:/virtual</locationURI>\r
                </link>\r
+               <link>\r
+                       <name>Common_Demo_Source/QueueOverwrite.c</name>\r
+                       <type>1</type>\r
+                       <locationURI>FREERTOS_BASE/Demo/Common/Minimal/QueueOverwrite.c</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>Common_Demo_Source/QueueSet.c</name>\r
+                       <type>1</type>\r
+                       <locationURI>FREERTOS_BASE/Demo/Common/Minimal/QueueSet.c</locationURI>\r
+               </link>\r
                <link>\r
                        <name>Common_Demo_Source/blocktim.c</name>\r
                        <type>1</type>\r
                        <locationURI>FREERTOS_BASE/Source/timers.c</locationURI>\r
                </link>\r
        </linkedResources>\r
+       <filteredResources>\r
+               <filter>\r
+                       <id>1378064141906</id>\r
+                       <name></name>\r
+                       <type>26</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-projectRelativePath-matches-true-false-.csdata/ci</arguments>\r
+                       </matcher>\r
+               </filter>\r
+       </filteredResources>\r
        <variableList>\r
                <variable>\r
                        <name>FREERTOS_BASE</name>\r
index 472cba8649a623ecac7bf9a57ab33e97dc6a44fc..f0bbd2bdbfb811fd047d344c17ebfad5b36ca33b 100644 (file)
@@ -131,6 +131,13 @@ void vRegTest1Task( void )
                "       ldr r1, [r0]                                    \n"\r
                "       add r1, r1, #1                                  \n"\r
                "       str r1, [r0]                                    \n"\r
+               "                                                                       \n"\r
+               "       /* Yield to increase test coverage. */ \n"\r
+               "       movs r0, #0x01                                  \n"\r
+               "       ldr r1, =0xe000ed04                     \n" /*NVIC_INT_CTRL */\r
+               "       lsl r0, #28                                     \n" /* Shift to PendSV bit */\r
+               "       str r0, [r1]                                    \n"\r
+               "       dsb                                                             \n"\r
                "       pop { r1 }                                              \n"\r
                "                                                                       \n"\r
                "       /* Start again. */                              \n"\r
index 7bcce204cc9bd664962f95f690327813f289c6f3..3fec1ee00f5c3e7eaffb5dead21deee0b9f30b00 100644 (file)
 \r
 #define configUSE_PREEMPTION                   1\r
 #define configUSE_IDLE_HOOK                            0\r
-#define configUSE_TICK_HOOK                            0\r
+#define configUSE_TICK_HOOK                            1\r
 #define configCPU_CLOCK_HZ                             ( SystemCoreClock )\r
 #define configTICK_RATE_HZ                             ( ( portTickType ) 1000 )\r
 #define configMAX_PRIORITIES                   ( ( unsigned portBASE_TYPE ) 5 )\r
 #define configMINIMAL_STACK_SIZE               ( ( unsigned short ) 60 )\r
-#define configTOTAL_HEAP_SIZE                  ( ( size_t ) ( 6000 ) )\r
+#define configTOTAL_HEAP_SIZE                  ( ( size_t ) ( 12000 ) )\r
 #define configMAX_TASK_NAME_LEN                        ( 5 )\r
 #define configUSE_TRACE_FACILITY               1\r
 #define configUSE_16_BIT_TICKS                 0\r
 #define configUSE_APPLICATION_TASK_TAG 0\r
 #define configUSE_COUNTING_SEMAPHORES  1\r
 #define configGENERATE_RUN_TIME_STATS  0\r
+#define configUSE_QUEUE_SETS                   1\r
 \r
 /* Co-routine definitions. */\r
 #define configUSE_CO_ROUTINES                  0\r
@@ -124,6 +125,7 @@ to exclude the API function. */
 #define INCLUDE_vTaskSuspend                   1\r
 #define INCLUDE_vTaskDelayUntil                        1\r
 #define INCLUDE_vTaskDelay                             1\r
+#define INCLUDE_eTaskGetState                  1\r
 \r
 /* Normal assert() semantics without relying on the provision of an assert.h\r
 header file. */\r
index 8e65a5cdae2a9d16dea78126baf9ad39c4c564f8..b22027bc4c99e3eb96eb5065eb2ec5b44b12aa7c 100644 (file)
@@ -136,6 +136,13 @@ reg1_loop
        ldr r1, [r0]\r
        adds r1, r1, #1\r
        str r1, [r0]\r
+\r
+       /* Yield to increase test coverage. */\r
+       movs r0, #0x01\r
+       ldr r1, =0xe000ed04 /* NVIC_INT_CTRL */\r
+       lsls r0 ,r0, #28 /* Shift to PendSV bit */\r
+       str r0, [r1]\r
+       dsb\r
        pop { r1 }\r
 \r
        /* Start again. */\r
index c7158f533d02b9f3413fb86b61f43d9c10ebb80e..a51261c15b9d4333103321ce2c0c111e1f1c535e 100644 (file)
 \r
        PRESERVE8\r
        THUMB\r
-       \r
+\r
 \r
        IMPORT ulRegTest1LoopCounter\r
        IMPORT ulRegTest2LoopCounter\r
 \r
-       EXTERN vPortYield ;////////////////////////////////////////////////////////////////////////////////////////\r
-\r
        EXPORT vRegTest1Task\r
        EXPORT vRegTest2Task\r
-       \r
+\r
        AREA    |.text|, CODE, READONLY\r
 \r
 ;/*-----------------------------------------------------------*/\r
@@ -140,15 +138,18 @@ reg1_loop
        ldr r1, [r0]\r
        adds r1, r1, #1\r
        str r1, [r0]\r
+\r
+       ;/* Yield to increase test coverage. */\r
+       movs r0, #0x01\r
+       ldr r1, =0xe000ed04 ; NVIC_INT_CTRL\r
+       lsls r0 ,r0, #28 ; Shift to PendSV bit\r
+       str r0, [r1]\r
+       dsb\r
        pop { r1 }\r
 \r
        ;/* Start again. */\r
        movs r0, #100\r
-       \r
-       push {r0-r1}\r
-       bl vPortYield   ;;///////////////////////////////////////////////////////////////////////////////////////////////////\r
-       pop {r0-r1}\r
-       \r
+\r
        b reg1_loop\r
 \r
 reg1_error_loop\r
index d1f08e34ebc9ed5e57310735a62675c57eb7b045..08ef6953c2a990bec953b14a481b544bc56660a6 100644 (file)
       </plugin>\r
       <plugin>\r
         <file>$TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin</file>\r
-        <loadFlag>0</loadFlag>\r
+        <loadFlag>1</loadFlag>\r
       </plugin>\r
       <plugin>\r
         <file>$TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin</file>\r
index 29cfce81e12b7e5798403fd33d1b9ea11c2205ff..29c8eab0a466f988b61f890e9e1332f547b2c338 100644 (file)
         <option>\r
           <name>CCAllowList</name>\r
           <version>1</version>\r
-          <state>0000000</state>\r
+          <state>1111111</state>\r
         </option>\r
         <option>\r
           <name>CCDebugInfo</name>\r
         </option>\r
         <option>\r
           <name>CCOptLevel</name>\r
-          <state>1</state>\r
+          <state>3</state>\r
         </option>\r
         <option>\r
           <name>CCOptStrategy</name>\r
         </option>\r
         <option>\r
           <name>CCOptLevelSlave</name>\r
-          <state>1</state>\r
+          <state>3</state>\r
         </option>\r
         <option>\r
           <name>CompilerMisraRules98</name>\r
     <file>\r
       <name>$PROJ_DIR$\..\Common\Minimal\dynamic.c</name>\r
     </file>\r
+    <file>\r
+      <name>$PROJ_DIR$\..\Common\Minimal\QueueOverwrite.c</name>\r
+    </file>\r
+    <file>\r
+      <name>$PROJ_DIR$\..\Common\Minimal\QueueSet.c</name>\r
+    </file>\r
     <file>\r
       <name>$PROJ_DIR$\..\Common\Minimal\recmutex.c</name>\r
     </file>\r
index 4ea6bea3bd370cfc574ded631938515befbc999e..6800ceec0447b0e1878ee871e39d72f0a0a1ad60 100644 (file)
       <Focus>0</Focus>
       <ColumnNumber>0</ColumnNumber>
       <tvExpOptDlg>0</tvExpOptDlg>
-      <TopLine>90</TopLine>
-      <CurrentLine>128</CurrentLine>
+      <TopLine>0</TopLine>
+      <CurrentLine>0</CurrentLine>
       <bDave2>0</bDave2>
       <PathWithFileName>.\system_XMC1200.c</PathWithFileName>
       <FilenameWithoutPath>system_XMC1200.c</FilenameWithoutPath>
       <Focus>0</Focus>
       <ColumnNumber>0</ColumnNumber>
       <tvExpOptDlg>0</tvExpOptDlg>
-      <TopLine>0</TopLine>
-      <CurrentLine>0</CurrentLine>
+      <TopLine>120</TopLine>
+      <CurrentLine>132</CurrentLine>
       <bDave2>0</bDave2>
       <PathWithFileName>.\Keil_Specific\startup_XMC1300.s</PathWithFileName>
       <FilenameWithoutPath>startup_XMC1300.s</FilenameWithoutPath>
 
   <Group>
     <GroupName>FreeRTOS source</GroupName>
-    <tvExp>0</tvExp>
+    <tvExp>1</tvExp>
     <tvExpOptDlg>0</tvExpOptDlg>
     <cbSel>0</cbSel>
     <RteFlg>0</RteFlg>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <Focus>0</Focus>
-      <ColumnNumber>0</ColumnNumber>
+      <ColumnNumber>26</ColumnNumber>
       <tvExpOptDlg>0</tvExpOptDlg>
       <TopLine>0</TopLine>
       <CurrentLine>0</CurrentLine>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <Focus>0</Focus>
-      <ColumnNumber>0</ColumnNumber>
+      <ColumnNumber>9</ColumnNumber>
       <tvExpOptDlg>0</tvExpOptDlg>
       <TopLine>0</TopLine>
       <CurrentLine>0</CurrentLine>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <Focus>0</Focus>
-      <ColumnNumber>2</ColumnNumber>
+      <ColumnNumber>0</ColumnNumber>
       <tvExpOptDlg>0</tvExpOptDlg>
-      <TopLine>0</TopLine>
-      <CurrentLine>0</CurrentLine>
+      <TopLine>244</TopLine>
+      <CurrentLine>259</CurrentLine>
       <bDave2>0</bDave2>
       <PathWithFileName>..\..\Source\portable\RVDS\ARM_CM0\port.c</PathWithFileName>
       <FilenameWithoutPath>port.c</FilenameWithoutPath>
       <Focus>0</Focus>
       <ColumnNumber>0</ColumnNumber>
       <tvExpOptDlg>0</tvExpOptDlg>
-      <TopLine>134</TopLine>
-      <CurrentLine>142</CurrentLine>
+      <TopLine>114</TopLine>
+      <CurrentLine>122</CurrentLine>
       <bDave2>0</bDave2>
       <PathWithFileName>.\main.c</PathWithFileName>
       <FilenameWithoutPath>main.c</FilenameWithoutPath>
       <FileType>5</FileType>
       <tvExp>0</tvExp>
       <Focus>0</Focus>
-      <ColumnNumber>2</ColumnNumber>
+      <ColumnNumber>5</ColumnNumber>
       <tvExpOptDlg>0</tvExpOptDlg>
       <TopLine>0</TopLine>
       <CurrentLine>0</CurrentLine>
       <Focus>0</Focus>
       <ColumnNumber>0</ColumnNumber>
       <tvExpOptDlg>0</tvExpOptDlg>
-      <TopLine>0</TopLine>
-      <CurrentLine>0</CurrentLine>
+      <TopLine>191</TopLine>
+      <CurrentLine>199</CurrentLine>
       <bDave2>0</bDave2>
       <PathWithFileName>.\Keil_Specific\RegTest_Keil.s</PathWithFileName>
       <FilenameWithoutPath>RegTest_Keil.s</FilenameWithoutPath>
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
+    <File>
+      <GroupNumber>4</GroupNumber>
+      <FileNumber>19</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <Focus>0</Focus>
+      <ColumnNumber>35</ColumnNumber>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <TopLine>0</TopLine>
+      <CurrentLine>0</CurrentLine>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\Common\Minimal\QueueSet.c</PathWithFileName>
+      <FilenameWithoutPath>QueueSet.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>4</GroupNumber>
+      <FileNumber>20</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <Focus>0</Focus>
+      <ColumnNumber>47</ColumnNumber>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <TopLine>0</TopLine>
+      <CurrentLine>0</CurrentLine>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\Common\Minimal\QueueOverwrite.c</PathWithFileName>
+      <FilenameWithoutPath>QueueOverwrite.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
   </Group>
 
 </ProjectOpt>
index 0cccd2f04c5f584a2426a9d9c44150b6dc4bb089..33ef15758caca600b05f1ed5f90300f50a2f6fb9 100644 (file)
               <FileType>1</FileType>
               <FilePath>..\Common\Minimal\countsem.c</FilePath>
             </File>
+            <File>
+              <FileName>QueueSet.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\Common\Minimal\QueueSet.c</FilePath>
+            </File>
+            <File>
+              <FileName>QueueOverwrite.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\Common\Minimal\QueueOverwrite.c</FilePath>
+            </File>
           </Files>
         </Group>
       </Groups>
             <uThumb>0</uThumb>
             <uSurpInc>0</uSurpInc>
             <VariousControls>
-              <MiscControls>--c99</MiscControls>
+              <MiscControls></MiscControls>
               <Define></Define>
               <Undefine></Undefine>
               <IncludePath>.;..\Common\include;..\..\Source\include;..\..\Source\portable\RVDS\ARM_CM0;.\CMSIS</IncludePath>
               <FileType>1</FileType>
               <FilePath>..\Common\Minimal\countsem.c</FilePath>
             </File>
+            <File>
+              <FileName>QueueSet.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\Common\Minimal\QueueSet.c</FilePath>
+            </File>
+            <File>
+              <FileName>QueueOverwrite.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\Common\Minimal\QueueOverwrite.c</FilePath>
+            </File>
           </Files>
         </Group>
       </Groups>
index 8d23357c39db957be4f01f4756b67689427c21e9..4059147f352bba01d233ec18fb179d24401bc939 100644 (file)
  * containing an unexpected value is indicative of an error in the context\r
  * switching mechanism.\r
  *\r
+ * "Semaphore take task" - This task does nothing but block on a semaphore that\r
+ * is 'given' from the tick hook function (which is defined in main.c).  It\r
+ * toggles the fourth LED each time it receives the semaphore.  The Semahore is\r
+ * given every 50ms, so LED 4 toggles every 50ms.\r
+ *\r
  * "Flash timers" - A software timer callback function is defined that does\r
  * nothing but toggle an LED.  Three software timers are created that each\r
  * use the same callback function, but each toggles a different LED at a\r
- * different frequency.  One software timer uses LED1, another LED2 and the\r
- * third LED3.\r
+ * different frequency.  The timers control the first three LEDs.\r
  *\r
  * "Check" software timer - The check timer period is initially set to three\r
  * seconds.  Its callback function checks that all the standard demo tasks, and\r
  * without reporting any errors.  If the check timer callback discovers that a\r
  * task has either stalled, or reported an error, then it changes the period of\r
  * the check timer from the initial three seconds, to just 200ms.  The callback\r
- * function also toggles LED 4 each time it is called.  This provides a visual\r
- * indication of the system status:  If the LED toggles every three seconds,\r
- * then no issues have been discovered.  If the LED toggles every 200ms, then\r
- * an issue has been discovered with at least one task.\r
+ * function also toggles the fifth LED each time it is called.  This provides a\r
+ * visual indication of the system status:  If the LED toggles every three\r
+ * seconds then no issues have been discovered.  If the LED toggles every 200ms,\r
+ * then an issue has been discovered with at least one task.\r
  */\r
 \r
 /* Kernel includes. */\r
 #include "FreeRTOS.h"\r
 #include "task.h"\r
 #include "queue.h"\r
+#include "semphr.h"\r
 #include "timers.h"\r
 \r
 /* Common demo includes. */\r
 #include "recmutex.h"\r
 #include "ParTest.h"\r
 #include "dynamic.h"\r
+#include "QueueOverwrite.h"\r
+#include "QueueSet.h"\r
 \r
 /* The period after which the check timer will expire provided no errors have\r
 been reported by any of the standard demo tasks.  ms are converted to the\r
@@ -141,6 +148,10 @@ multiple of this. */
 /* The LED toggle by the check timer. */\r
 #define mainCHECK_LED                                          ( 4 )\r
 \r
+/* The LED toggled each time the task implemented by the prvSemaphoreTakeTask()\r
+function takes the semaphore that is given by the tick hook function. */\r
+#define mainSEMAPHORE_LED                                      ( 3 )\r
+\r
 /*-----------------------------------------------------------*/\r
 \r
 /*\r
@@ -166,6 +177,12 @@ static void prvCheckTimerCallback( xTimerHandle xTimer );
  */\r
 static void prvFlashTimerCallback( xTimerHandle xTimer );\r
 \r
+/*\r
+ * The task that toggles an LED each time the semaphore 'given' by the tick\r
+ * hook function (which is defined in main.c) is 'taken' in the task.\r
+ */\r
+static void prvSemaphoreTakeTask( void *pvParameters );\r
+\r
 /*\r
  * Called by main() to create the comprehensive test/demo application if\r
  * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is not set to 1.\r
@@ -180,6 +197,10 @@ incrementing, then the register check tasks has not discovered any errors.  If
 a variable stops incrementing, then an error has been found. */\r
 volatile unsigned long ulRegTest1LoopCounter = 0UL, ulRegTest2LoopCounter = 0UL;\r
 \r
+/* The semaphore that is given by the tick hook function (defined in main.c)\r
+and taken by the task implemented by the prvSemaphoreTakeTask() function.  The\r
+task toggles LED mainSEMAPHORE_LED each time the semaphore is taken. */\r
+xSemaphoreHandle xLEDSemaphore = NULL;\r
 /*-----------------------------------------------------------*/\r
 \r
 void main_full( void )\r
@@ -198,6 +219,18 @@ const size_t xRegTestStackSize = 25U;
        vStartCountingSemaphoreTasks();\r
        vStartRecursiveMutexTasks();\r
        vStartDynamicPriorityTasks();\r
+       vStartQueueSetTasks();\r
+       vStartQueueOverwriteTask( tskIDLE_PRIORITY );\r
+\r
+       /* Create that is given from the tick hook function, and the task that\r
+       toggles an LED each time the semaphore is given. */\r
+       vSemaphoreCreateBinary( xLEDSemaphore );\r
+       xTaskCreate(    prvSemaphoreTakeTask,           /* Function that implements the task. */\r
+                                       ( signed char * ) "Sem",        /* Text name of the task. */\r
+                                       configMINIMAL_STACK_SIZE,       /* Stack allocated to the task (in words). */\r
+                                       NULL,                                           /* The task parameter is not used. */\r
+                                       configMAX_PRIORITIES - 1,       /* The priority of the task. */\r
+                                       NULL );                                         /* Don't receive a handle back, it is not needed. */\r
 \r
        /* Create the register test tasks as described at the top of this file.\r
        These are naked functions that don't use any stack.  A stack still has\r
@@ -305,6 +338,16 @@ unsigned long ulErrorFound = pdFALSE;
        }\r
        ulLastRegTest2Value = ulRegTest2LoopCounter;\r
 \r
+       if( xAreQueueSetTasksStillRunning() != pdPASS )\r
+       {\r
+               ulErrorFound |= ( 0x01UL << 6UL );\r
+       }\r
+\r
+       if( xIsQueueOverwriteTaskStillRunning() != pdPASS )\r
+       {\r
+               ulErrorFound |= ( 0x01UL << 7UL );\r
+       }\r
+\r
        /* Toggle the check LED to give an indication of the system status.  If\r
        the LED toggles every mainCHECK_TIMER_PERIOD_MS milliseconds then\r
        everything is ok.  A faster toggle indicates an error. */\r
@@ -329,6 +372,20 @@ unsigned long ulErrorFound = pdFALSE;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
+static void prvSemaphoreTakeTask( void *pvParameters )\r
+{\r
+       configASSERT( xLEDSemaphore );\r
+\r
+       for( ;; )\r
+       {\r
+               /* Wait to obtain the semaphore - which is given by the tick hook\r
+               function every 50ms. */\r
+               xSemaphoreTake( xLEDSemaphore, portMAX_DELAY );\r
+               vParTestToggleLED( mainSEMAPHORE_LED );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
 static void prvFlashTimerCallback( xTimerHandle xTimer )\r
 {\r
 unsigned long ulLED;\r
index 6707792fe0db1b714b7da4e87f7c863ff7e06da6..c4d6fcc20c2e26efc1f46d352842620bf47705e1 100644 (file)
 /* FreeRTOS includes. */\r
 #include "FreeRTOS.h"\r
 #include "task.h"\r
+#include "semphr.h"\r
 \r
 /* Demo application include. */\r
 #include "ParTest.h"\r
+#include "QueueSet.h"\r
 \r
 /* Set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo,\r
 or 0 to run the more comprehensive test and demo application. */\r
@@ -194,7 +196,39 @@ void vApplicationTickHook( void )
        configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h.  User code can be\r
        added here, but the tick hook is called from an interrupt context, so\r
        code must not attempt to block, and only the interrupt safe FreeRTOS API\r
-       functions can be used (those that end in FromISR()). */\r
+       functions can be used (those that end in FromISR()).  The code in this\r
+       tick hook implementation is for demonstration only - it has no real\r
+       purpose.  It just gives a semaphore every 50ms.  The semaphore unblocks a\r
+       task that then toggles an LED.  Additionally, the call to\r
+       vQueueSetAccessQueueSetFromISR() is part of the "standard demo tasks"\r
+       functionality. */\r
+\r
+       /* The semaphore and associated task are not created when the simple blinky\r
+       demo is used. */\r
+       #if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 0\r
+       {\r
+       static unsigned long ulLastGiveTime = 0UL;\r
+       const unsigned long ulRate = 50UL / portTICK_RATE_MS;\r
+       extern xSemaphoreHandle xLEDSemaphore;\r
+\r
+               configASSERT( xLEDSemaphore );\r
+\r
+               if( ( xTaskGetTickCountFromISR() - ulLastGiveTime ) > ulRate )\r
+               {\r
+                       /* The second parameter is normally used to determine if a context\r
+                       switch should be performed or not.  In this case the function is\r
+                       being performed from the tick hook, so the scheduler will make that\r
+                       assessment before returning to a task anyway - so the parameter is\r
+                       not needed and is just set to NULL. */\r
+                       xSemaphoreGiveFromISR( xLEDSemaphore, NULL );\r
+                       ulLastGiveTime += ulRate;\r
+               }\r
+\r
+               /* Write to a queue that is in use as part of the queue set demo to\r
+               demonstrate using queue sets from an ISR. */\r
+               vQueueSetAccessQueueSetFromISR();\r
+       }\r
+       #endif /* mainCREATE_SIMPLE_BLINKY_DEMO_ONLY */\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
index 076f53409d6c44fef2307065458cb8e5cf1803ab..b0930cbaa874d6a17df6344ebf6245ef957d8b10 100644 (file)
@@ -1,5 +1,5 @@
 [DebugChecksum]\r
-Checksum=-2111807952\r
+Checksum=-850785765\r
 [Stack]\r
 FillEnabled=0\r
 OverflowWarningsEnabled=1\r
@@ -107,7 +107,8 @@ Exclusions=
 [Disassemble mode]\r
 mode=0\r
 [Breakpoints2]\r
-Count=0\r
+Bp0=_ 1 "EMUL_CODE" "{$PROJ_DIR$\main-full.c}.362.3" 0 0 1 "" 0 "" 0\r
+Count=1\r
 [Aliases]\r
 Count=0\r
 SuppressDialog=0\r
index 4df60d42c813003641910c7e407e3fc3efb6a7ba..22119b050bcc50aadfe90a95aa2ccbc1ff71efb5 100644 (file)
@@ -21,7 +21,7 @@
         \r
       <ColumnWidth0>20</ColumnWidth0><ColumnWidth1>1216</ColumnWidth1><ColumnWidth2>324</ColumnWidth2><ColumnWidth3>81</ColumnWidth3></Build>\r
       <TerminalIO/>\r
-    </Static>\r
+    <Breakpoints><PreferedWindows><Position>3</Position><ScreenPosX>0</ScreenPosX><ScreenPosY>0</ScreenPosY><Windows/></PreferedWindows><col-names><item>Breakpoint</item><item>_I0</item></col-names><col-widths><item>500</item><item>35</item></col-widths></Breakpoints></Static>\r
     <Windows>\r
       \r
       \r
@@ -33,7 +33,7 @@
             <Factory>Workspace</Factory>\r
             <Session>\r
               \r
-            <NodeDict><ExpandedNode>RTOSDemo</ExpandedNode><ExpandedNode>RTOSDemo/System</ExpandedNode></NodeDict></Session>\r
+            <NodeDict><ExpandedNode>RTOSDemo</ExpandedNode><ExpandedNode>RTOSDemo/Common Demo Source</ExpandedNode><ExpandedNode>RTOSDemo/FreeRTOS Source</ExpandedNode><ExpandedNode>RTOSDemo/FreeRTOS Source/portable</ExpandedNode><ExpandedNode>RTOSDemo/System</ExpandedNode></NodeDict></Session>\r
           </Tab>\r
         </Tabs>\r
         \r
       \r
       \r
       \r
-    <Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\main.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>99</YPos2><SelStart2>5509</SelStart2><SelEnd2>5509</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\main-full.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>111</YPos2><SelStart2>7445</SelStart2><SelEnd2>7445</SelEnd2></Tab><ActiveTab>1</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>\r
+    <Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\main-full.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>343</YPos2><SelStart2>16403</SelStart2><SelEnd2>16403</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\portable\IAR\ARM_CM0\portasm.s</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>107</YPos2><SelStart2>5084</SelStart2><SelEnd2>5084</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\portable\IAR\ARM_CM0\portmacro.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>69</YPos2><SelStart2>4860</SelStart2><SelEnd2>4870</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\portable\IAR\ARM_CM0\port.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>171</YPos2><SelStart2>7642</SelStart2><SelEnd2>7642</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\queue.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>1140</YPos2><SelStart2>40632</SelStart2><SelEnd2>40632</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\Common\Minimal\recmutex.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>335</YPos2><SelStart2>14526</SelStart2><SelEnd2>14526</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\tasks.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>109</YPos2><SelStart2>6901</SelStart2><SelEnd2>6912</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\Common\Minimal\dynamic.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>183</YPos2><SelStart2>0</SelStart2><SelEnd2>0</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\Common\Minimal\QueueSet.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>276</YPos2><SelStart2>0</SelStart2><SelEnd2>0</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\main.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>197</YPos2><SelStart2>0</SelStart2><SelEnd2>0</SelEnd2></Tab><ActiveTab>9</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\IAR_Specific\RegTest_IAR.s</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>184</YPos2><SelStart2>6246</SelStart2><SelEnd2>6246</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\FreeRTOSConfig.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>98</YPos2><SelStart2>0</SelStart2><SelEnd2>0</SelEnd2></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>\r
     <Positions>\r
       \r
       \r
       \r
       \r
       \r
-    <Top><Row0><Sizes><Toolbar-01348f40><key>iaridepm.enu1</key></Toolbar-01348f40></Sizes></Row0></Top><Left><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>740</Bottom><Right>310</Right><x>-2</x><y>-2</y><xscreen>200</xscreen><yscreen>200</yscreen><sizeHorzCX>119048</sizeHorzCX><sizeHorzCY>203666</sizeHorzCY><sizeVertCX>185714</sizeVertCX><sizeVertCY>755601</sizeVertCY></Rect></Wnd0></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>198</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>200</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>203666</sizeHorzCY><sizeVertCX>119048</sizeVertCX><sizeVertCY>203666</sizeVertCY></Rect></Wnd1></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>\r
+    <Top><Row0><Sizes><Toolbar-01348f68><key>iaridepm.enu1</key></Toolbar-01348f68></Sizes></Row0><Row1><Sizes/></Row1></Top><Left><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>740</Bottom><Right>310</Right><x>-2</x><y>-2</y><xscreen>200</xscreen><yscreen>200</yscreen><sizeHorzCX>119048</sizeHorzCX><sizeHorzCY>203666</sizeHorzCY><sizeVertCX>185714</sizeVertCX><sizeVertCY>755601</sizeVertCY></Rect></Wnd0></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>198</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>200</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>203666</sizeHorzCY><sizeVertCX>119048</sizeVertCX><sizeVertCY>203666</sizeVertCY></Rect></Wnd1></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>\r
   </Desktop>\r
 </Workspace>\r
 \r