Continue work on XMC1000 demos.
diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/.cproject b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/.cproject index 7aefb82..f1fe74e 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/.cproject +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/.cproject
@@ -57,6 +57,7 @@ <option id="com.atollic.truestudio.common_options.target.endianess.1238437628" name="Endianess" superClass="com.atollic.truestudio.common_options.target.endianess"/> <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"/> <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"/> + <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"/> <inputType id="com.atollic.truestudio.gcc.input.1008000819" superClass="com.atollic.truestudio.gcc.input"/> </tool> <tool id="com.atollic.truestudio.exe.debug.toolchain.ld.298485676" name="C Linker" superClass="com.atollic.truestudio.exe.debug.toolchain.ld"> @@ -105,9 +106,6 @@ <tool id="com.atollic.truestudio.exe.debug.toolchain.secoutput.31389710" name="Other" superClass="com.atollic.truestudio.exe.debug.toolchain.secoutput"/> </toolChain> </folderInfo> - <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"> - <tool id="com.atollic.truestudio.exe.debug.toolchain.gcc.37591077.227330701" name="C Compiler" superClass="com.atollic.truestudio.exe.debug.toolchain.gcc.37591077"/> - </fileInfo> <sourceEntries> <entry excluding="Keil_Specific|IAR_Specific" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> </sourceEntries>
diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/.project b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/.project index 7a00051..1be489f 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/.project +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/.project
@@ -35,6 +35,16 @@ <locationURI>virtual:/virtual</locationURI> </link> <link> + <name>Common_Demo_Source/QueueOverwrite.c</name> + <type>1</type> + <locationURI>FREERTOS_BASE/Demo/Common/Minimal/QueueOverwrite.c</locationURI> + </link> + <link> + <name>Common_Demo_Source/QueueSet.c</name> + <type>1</type> + <locationURI>FREERTOS_BASE/Demo/Common/Minimal/QueueSet.c</locationURI> + </link> + <link> <name>Common_Demo_Source/blocktim.c</name> <type>1</type> <locationURI>FREERTOS_BASE/Demo/Common/Minimal/blocktim.c</locationURI> @@ -95,6 +105,17 @@ <locationURI>FREERTOS_BASE/Source/timers.c</locationURI> </link> </linkedResources> + <filteredResources> + <filter> + <id>1378064141906</id> + <name></name> + <type>26</type> + <matcher> + <id>org.eclipse.ui.ide.multiFilter</id> + <arguments>1.0-projectRelativePath-matches-true-false-.csdata/ci</arguments> + </matcher> + </filter> + </filteredResources> <variableList> <variable> <name>FREERTOS_BASE</name>
diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/Atollic_Specific/RegTest.c b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/Atollic_Specific/RegTest.c index 472cba8..f0bbd2b 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/Atollic_Specific/RegTest.c +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/Atollic_Specific/RegTest.c
@@ -131,6 +131,13 @@ " ldr r1, [r0] \n" " add r1, r1, #1 \n" " str r1, [r0] \n" + " \n" + " /* Yield to increase test coverage. */ \n" + " movs r0, #0x01 \n" + " ldr r1, =0xe000ed04 \n" /*NVIC_INT_CTRL */ + " lsl r0, #28 \n" /* Shift to PendSV bit */ + " str r0, [r1] \n" + " dsb \n" " pop { r1 } \n" " \n" " /* Start again. */ \n"
diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/FreeRTOSConfig.h index 7bcce20..3fec1ee 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/FreeRTOSConfig.h
@@ -86,12 +86,12 @@ #define configUSE_PREEMPTION 1 #define configUSE_IDLE_HOOK 0 -#define configUSE_TICK_HOOK 0 +#define configUSE_TICK_HOOK 1 #define configCPU_CLOCK_HZ ( SystemCoreClock ) #define configTICK_RATE_HZ ( ( portTickType ) 1000 ) #define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 ) #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 60 ) -#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 6000 ) ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 12000 ) ) #define configMAX_TASK_NAME_LEN ( 5 ) #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 @@ -104,6 +104,7 @@ #define configUSE_APPLICATION_TASK_TAG 0 #define configUSE_COUNTING_SEMAPHORES 1 #define configGENERATE_RUN_TIME_STATS 0 +#define configUSE_QUEUE_SETS 1 /* Co-routine definitions. */ #define configUSE_CO_ROUTINES 0 @@ -124,6 +125,7 @@ #define INCLUDE_vTaskSuspend 1 #define INCLUDE_vTaskDelayUntil 1 #define INCLUDE_vTaskDelay 1 +#define INCLUDE_eTaskGetState 1 /* Normal assert() semantics without relying on the provision of an assert.h header file. */
diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/RegTest_IAR.s b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/RegTest_IAR.s index 8e65a5c..b22027b 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/RegTest_IAR.s +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/IAR_Specific/RegTest_IAR.s
@@ -136,6 +136,13 @@ ldr r1, [r0] adds r1, r1, #1 str r1, [r0] + + /* Yield to increase test coverage. */ + movs r0, #0x01 + ldr r1, =0xe000ed04 /* NVIC_INT_CTRL */ + lsls r0 ,r0, #28 /* Shift to PendSV bit */ + str r0, [r1] + dsb pop { r1 } /* Start again. */
diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/Keil_Specific/RegTest_Keil.s b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/Keil_Specific/RegTest_Keil.s index c7158f5..a51261c 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/Keil_Specific/RegTest_Keil.s +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/Keil_Specific/RegTest_Keil.s
@@ -64,16 +64,14 @@ PRESERVE8 THUMB - + IMPORT ulRegTest1LoopCounter IMPORT ulRegTest2LoopCounter - EXTERN vPortYield ;//////////////////////////////////////////////////////////////////////////////////////// - EXPORT vRegTest1Task EXPORT vRegTest2Task - + AREA |.text|, CODE, READONLY ;/*-----------------------------------------------------------*/ @@ -140,15 +138,18 @@ ldr r1, [r0] adds r1, r1, #1 str r1, [r0] + + ;/* Yield to increase test coverage. */ + movs r0, #0x01 + ldr r1, =0xe000ed04 ; NVIC_INT_CTRL + lsls r0 ,r0, #28 ; Shift to PendSV bit + str r0, [r1] + dsb pop { r1 } ;/* Start again. */ movs r0, #100 - - push {r0-r1} - bl vPortYield ;;/////////////////////////////////////////////////////////////////////////////////////////////////// - pop {r0-r1} - + b reg1_loop reg1_error_loop
diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.ewd b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.ewd index d1f08e3..08ef695 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.ewd +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.ewd
@@ -1251,7 +1251,7 @@ </plugin> <plugin> <file>$TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin</file> - <loadFlag>0</loadFlag> + <loadFlag>1</loadFlag> </plugin> <plugin> <file>$TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin</file>
diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.ewp b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.ewp index 29cfce8..29c8eab 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.ewp +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.ewp
@@ -229,7 +229,7 @@ <option> <name>CCAllowList</name> <version>1</version> - <state>0000000</state> + <state>1111111</state> </option> <option> <name>CCDebugInfo</name> @@ -321,7 +321,7 @@ </option> <option> <name>CCOptLevel</name> - <state>1</state> + <state>3</state> </option> <option> <name>CCOptStrategy</name> @@ -330,7 +330,7 @@ </option> <option> <name>CCOptLevelSlave</name> - <state>1</state> + <state>3</state> </option> <option> <name>CompilerMisraRules98</name> @@ -950,6 +950,12 @@ <name>$PROJ_DIR$\..\Common\Minimal\dynamic.c</name> </file> <file> + <name>$PROJ_DIR$\..\Common\Minimal\QueueOverwrite.c</name> + </file> + <file> + <name>$PROJ_DIR$\..\Common\Minimal\QueueSet.c</name> + </file> + <file> <name>$PROJ_DIR$\..\Common\Minimal\recmutex.c</name> </file> </group>
diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.uvopt b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.uvopt index 4ea6bea..6800cee 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.uvopt +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.uvopt
@@ -436,8 +436,8 @@ <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> @@ -452,8 +452,8 @@ <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> @@ -464,7 +464,7 @@ <Group> <GroupName>FreeRTOS source</GroupName> - <tvExp>0</tvExp> + <tvExp>1</tvExp> <tvExpOptDlg>0</tvExpOptDlg> <cbSel>0</cbSel> <RteFlg>0</RteFlg> @@ -506,7 +506,7 @@ <FileType>1</FileType> <tvExp>0</tvExp> <Focus>0</Focus> - <ColumnNumber>0</ColumnNumber> + <ColumnNumber>26</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> <TopLine>0</TopLine> <CurrentLine>0</CurrentLine> @@ -522,7 +522,7 @@ <FileType>1</FileType> <tvExp>0</tvExp> <Focus>0</Focus> - <ColumnNumber>0</ColumnNumber> + <ColumnNumber>9</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> <TopLine>0</TopLine> <CurrentLine>0</CurrentLine> @@ -538,10 +538,10 @@ <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> @@ -580,8 +580,8 @@ <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> @@ -610,7 +610,7 @@ <FileType>5</FileType> <tvExp>0</tvExp> <Focus>0</Focus> - <ColumnNumber>2</ColumnNumber> + <ColumnNumber>5</ColumnNumber> <tvExpOptDlg>0</tvExpOptDlg> <TopLine>0</TopLine> <CurrentLine>0</CurrentLine> @@ -660,8 +660,8 @@ <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> @@ -740,6 +740,38 @@ <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>
diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.uvproj b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.uvproj index 0cccd2f..33ef157 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.uvproj +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/RTOSDemo.uvproj
@@ -537,6 +537,16 @@ <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> @@ -883,7 +893,7 @@ <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> @@ -1072,6 +1082,16 @@ <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>
diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/main-full.c b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/main-full.c index 8d23357..4059147 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/main-full.c +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/main-full.c
@@ -90,11 +90,15 @@ * containing an unexpected value is indicative of an error in the context * switching mechanism. * + * "Semaphore take task" - This task does nothing but block on a semaphore that + * is 'given' from the tick hook function (which is defined in main.c). It + * toggles the fourth LED each time it receives the semaphore. The Semahore is + * given every 50ms, so LED 4 toggles every 50ms. + * * "Flash timers" - A software timer callback function is defined that does * nothing but toggle an LED. Three software timers are created that each * use the same callback function, but each toggles a different LED at a - * different frequency. One software timer uses LED1, another LED2 and the - * third LED3. + * different frequency. The timers control the first three LEDs. * * "Check" software timer - The check timer period is initially set to three * seconds. Its callback function checks that all the standard demo tasks, and @@ -102,16 +106,17 @@ * without reporting any errors. If the check timer callback discovers that a * task has either stalled, or reported an error, then it changes the period of * the check timer from the initial three seconds, to just 200ms. The callback - * function also toggles LED 4 each time it is called. This provides a visual - * indication of the system status: If the LED toggles every three seconds, - * then no issues have been discovered. If the LED toggles every 200ms, then - * an issue has been discovered with at least one task. + * function also toggles the fifth LED each time it is called. This provides a + * visual indication of the system status: If the LED toggles every three + * seconds then no issues have been discovered. If the LED toggles every 200ms, + * then an issue has been discovered with at least one task. */ /* Kernel includes. */ #include "FreeRTOS.h" #include "task.h" #include "queue.h" +#include "semphr.h" #include "timers.h" /* Common demo includes. */ @@ -120,6 +125,8 @@ #include "recmutex.h" #include "ParTest.h" #include "dynamic.h" +#include "QueueOverwrite.h" +#include "QueueSet.h" /* The period after which the check timer will expire provided no errors have been reported by any of the standard demo tasks. ms are converted to the @@ -141,6 +148,10 @@ /* The LED toggle by the check timer. */ #define mainCHECK_LED ( 4 ) +/* The LED toggled each time the task implemented by the prvSemaphoreTakeTask() +function takes the semaphore that is given by the tick hook function. */ +#define mainSEMAPHORE_LED ( 3 ) + /*-----------------------------------------------------------*/ /* @@ -167,6 +178,12 @@ static void prvFlashTimerCallback( xTimerHandle xTimer ); /* + * The task that toggles an LED each time the semaphore 'given' by the tick + * hook function (which is defined in main.c) is 'taken' in the task. + */ +static void prvSemaphoreTakeTask( void *pvParameters ); + +/* * Called by main() to create the comprehensive test/demo application if * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is not set to 1. */ @@ -180,6 +197,10 @@ a variable stops incrementing, then an error has been found. */ volatile unsigned long ulRegTest1LoopCounter = 0UL, ulRegTest2LoopCounter = 0UL; +/* The semaphore that is given by the tick hook function (defined in main.c) +and taken by the task implemented by the prvSemaphoreTakeTask() function. The +task toggles LED mainSEMAPHORE_LED each time the semaphore is taken. */ +xSemaphoreHandle xLEDSemaphore = NULL; /*-----------------------------------------------------------*/ void main_full( void ) @@ -198,6 +219,18 @@ vStartCountingSemaphoreTasks(); vStartRecursiveMutexTasks(); vStartDynamicPriorityTasks(); + vStartQueueSetTasks(); + vStartQueueOverwriteTask( tskIDLE_PRIORITY ); + + /* Create that is given from the tick hook function, and the task that + toggles an LED each time the semaphore is given. */ + vSemaphoreCreateBinary( xLEDSemaphore ); + xTaskCreate( prvSemaphoreTakeTask, /* Function that implements the task. */ + ( signed char * ) "Sem", /* Text name of the task. */ + configMINIMAL_STACK_SIZE, /* Stack allocated to the task (in words). */ + NULL, /* The task parameter is not used. */ + configMAX_PRIORITIES - 1, /* The priority of the task. */ + NULL ); /* Don't receive a handle back, it is not needed. */ /* Create the register test tasks as described at the top of this file. These are naked functions that don't use any stack. A stack still has @@ -305,6 +338,16 @@ } ulLastRegTest2Value = ulRegTest2LoopCounter; + if( xAreQueueSetTasksStillRunning() != pdPASS ) + { + ulErrorFound |= ( 0x01UL << 6UL ); + } + + if( xIsQueueOverwriteTaskStillRunning() != pdPASS ) + { + ulErrorFound |= ( 0x01UL << 7UL ); + } + /* Toggle the check LED to give an indication of the system status. If the LED toggles every mainCHECK_TIMER_PERIOD_MS milliseconds then everything is ok. A faster toggle indicates an error. */ @@ -329,6 +372,20 @@ } /*-----------------------------------------------------------*/ +static void prvSemaphoreTakeTask( void *pvParameters ) +{ + configASSERT( xLEDSemaphore ); + + for( ;; ) + { + /* Wait to obtain the semaphore - which is given by the tick hook + function every 50ms. */ + xSemaphoreTake( xLEDSemaphore, portMAX_DELAY ); + vParTestToggleLED( mainSEMAPHORE_LED ); + } +} +/*-----------------------------------------------------------*/ + static void prvFlashTimerCallback( xTimerHandle xTimer ) { unsigned long ulLED;
diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/main.c b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/main.c index 6707792..c4d6fcc 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/main.c +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/main.c
@@ -85,9 +85,11 @@ /* FreeRTOS includes. */ #include "FreeRTOS.h" #include "task.h" +#include "semphr.h" /* Demo application include. */ #include "ParTest.h" +#include "QueueSet.h" /* Set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo, or 0 to run the more comprehensive test and demo application. */ @@ -194,7 +196,39 @@ configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h. User code can be added here, but the tick hook is called from an interrupt context, so code must not attempt to block, and only the interrupt safe FreeRTOS API - functions can be used (those that end in FromISR()). */ + functions can be used (those that end in FromISR()). The code in this + tick hook implementation is for demonstration only - it has no real + purpose. It just gives a semaphore every 50ms. The semaphore unblocks a + task that then toggles an LED. Additionally, the call to + vQueueSetAccessQueueSetFromISR() is part of the "standard demo tasks" + functionality. */ + + /* The semaphore and associated task are not created when the simple blinky + demo is used. */ + #if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 0 + { + static unsigned long ulLastGiveTime = 0UL; + const unsigned long ulRate = 50UL / portTICK_RATE_MS; + extern xSemaphoreHandle xLEDSemaphore; + + configASSERT( xLEDSemaphore ); + + if( ( xTaskGetTickCountFromISR() - ulLastGiveTime ) > ulRate ) + { + /* The second parameter is normally used to determine if a context + switch should be performed or not. In this case the function is + being performed from the tick hook, so the scheduler will make that + assessment before returning to a task anyway - so the parameter is + not needed and is just set to NULL. */ + xSemaphoreGiveFromISR( xLEDSemaphore, NULL ); + ulLastGiveTime += ulRate; + } + + /* Write to a queue that is in use as part of the queue set demo to + demonstrate using queue sets from an ISR. */ + vQueueSetAccessQueueSetFromISR(); + } + #endif /* mainCREATE_SIMPLE_BLINKY_DEMO_ONLY */ } /*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/settings/RTOSDemo.dni b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/settings/RTOSDemo.dni index 076f534..b0930cb 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/settings/RTOSDemo.dni +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/settings/RTOSDemo.dni
@@ -1,5 +1,5 @@ [DebugChecksum] -Checksum=-2111807952 +Checksum=-850785765 [Stack] FillEnabled=0 OverflowWarningsEnabled=1 @@ -107,7 +107,8 @@ [Disassemble mode] mode=0 [Breakpoints2] -Count=0 +Bp0=_ 1 "EMUL_CODE" "{$PROJ_DIR$\main-full.c}.362.3" 0 0 1 "" 0 "" 0 +Count=1 [Aliases] Count=0 SuppressDialog=0
diff --git a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/settings/RTOSDemo.wsdt b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/settings/RTOSDemo.wsdt index 4df60d4..22119b0 100644 --- a/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/settings/RTOSDemo.wsdt +++ b/FreeRTOS/Demo/CORTEX_M0_Infineon_XMC1000_IAR_Keil_GCC/settings/RTOSDemo.wsdt
@@ -21,7 +21,7 @@ <ColumnWidth0>20</ColumnWidth0><ColumnWidth1>1216</ColumnWidth1><ColumnWidth2>324</ColumnWidth2><ColumnWidth3>81</ColumnWidth3></Build> <TerminalIO/> - </Static> + <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> <Windows> @@ -33,7 +33,7 @@ <Factory>Workspace</Factory> <Session> - <NodeDict><ExpandedNode>RTOSDemo</ExpandedNode><ExpandedNode>RTOSDemo/System</ExpandedNode></NodeDict></Session> + <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> </Tab> </Tabs> @@ -53,14 +53,14 @@ - <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> + <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> <Positions> - <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> + <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> </Desktop> </Workspace>