]> git.sur5r.net Git - freertos/commitdiff
RM48 simply blinky demo working.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Tue, 9 Oct 2012 13:04:17 +0000 (13:04 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Tue, 9 Oct 2012 13:04:17 +0000 (13:04 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1788 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

13 files changed:
FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/.cproject
FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/FreeRTOSConfig.h [new file with mode: 0644]
FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/ParTest.c [new file with mode: 0644]
FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/demo/het.c [new file with mode: 0644]
FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/demo/het.h [new file with mode: 0644]
FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/demo/partest.h [new file with mode: 0644]
FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/main.c
FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/main_blinky.c [new file with mode: 0644]
FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/os/FreeRTOSConfig.h [deleted file]
FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/os/heap.c [deleted file]
FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/os/heap_4.c [new file with mode: 0644]
FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/startup/sys_system.c
FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/startup/sys_system.h

index 438f5cbb0f80b0f7abbca41ddae02ffc12cbef24..d62cf321edd408c76ec483cb6cdfa6dd7cd834c5 100644 (file)
@@ -16,8 +16,8 @@
                        <storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
                                <configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.580416121" name="Debug" parent="com.ti.ccstudio.buildDefinitions.TMS470.Debug">\r
                                        <folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.580416121." name="/" resourcePath="">\r
-                                               <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.DebugToolchain.1023182662" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.linkerDebug.1702479053">\r
-                                                       <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1465456143" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">\r
+                                               <toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.DebugToolchain.2131003966" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.linkerDebug.1033617493">\r
+                                                       <option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.2072640321" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">\r
                                                                <listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex R.RM48L950"/>\r
                                                                <listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>\r
                                                                <listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>\r
                                                                <listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>\r
                                                                <listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>\r
                                                        </option>\r
-                                                       <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1528434639" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="4.9.5" valueType="string"/>\r
-                                                       <targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.targetPlatformDebug.580671531" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.targetPlatformDebug"/>\r
-                                                       <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.builderDebug.1190105434" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.builderDebug"/>\r
-                                                       <tool id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.compilerDebug.1935264313" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.compilerDebug">\r
-                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.CODE_STATE.619839677" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.CODE_STATE.32" valueType="enumerated"/>\r
-                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.SILICON_VERSION.942876674" name="Target processor version (--silicon_version, -mv)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.SILICON_VERSION.7R4" valueType="enumerated"/>\r
-                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.FLOAT_SUPPORT.748273201" name="Specify floating point support (--float_support)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.FLOAT_SUPPORT._none" valueType="enumerated"/>\r
-                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ABI.901458990" name="Application binary interface (tiabi, ti_arm9_abi, eabi) (--abi)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ABI.eabi" valueType="enumerated"/>\r
-                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ENUM_TYPE.1247828011" name="Designate enum type (Default is packed for EABI) (--enum_type)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ENUM_TYPE" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ENUM_TYPE.packed" valueType="enumerated"/>\r
-                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.LITTLE_ENDIAN.1062648374" name="Little endian code (--little_endian, -me)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>\r
-                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.OPT_LEVEL.704079957" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.OPT_LEVEL.3" valueType="enumerated"/>\r
-                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DEBUGGING_MODEL.1844493246" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>\r
-                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.INCLUDE_PATH.103913639" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.INCLUDE_PATH" valueType="includePath">\r
+                                                       <option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1381424494" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="4.9.7" valueType="string"/>\r
+                                                       <targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.targetPlatformDebug.1179903155" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.targetPlatformDebug"/>\r
+                                                       <builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.builderDebug.1089496991" name="GNU Make.Debug" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.builderDebug"/>\r
+                                                       <tool id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.compilerDebug.696952532" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.compilerDebug">\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.CODE_STATE.623387114" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.CODE_STATE.32" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.SILICON_VERSION.1841890606" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.SILICON_VERSION.7R4" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.FLOAT_SUPPORT.167466935" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.FLOAT_SUPPORT" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.FLOAT_SUPPORT._none" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ABI.1404444528" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ABI.eabi" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ENUM_TYPE.443601845" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ENUM_TYPE" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.ENUM_TYPE.packed" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.LITTLE_ENDIAN.514210421" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.OPT_LEVEL.267212406" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.OPT_LEVEL.3" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DEBUGGING_MODEL.1669626848" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.INCLUDE_PATH.1953076587" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.INCLUDE_PATH" valueType="includePath">\r
                                                                        <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/include&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>\r
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/demo}&quot;"/>\r
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/os}&quot;"/>\r
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/startup}&quot;"/>\r
                                                                </option>\r
-                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DIAG_WARNING.269144842" name="Treat diagnostic &lt;id&gt; as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DIAG_WARNING" valueType="stringList">\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DIAG_WARNING.588172833" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DIAG_WARNING" valueType="stringList">\r
                                                                        <listOptionValue builtIn="false" value="225"/>\r
                                                                </option>\r
-                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DISPLAY_ERROR_NUMBER.135924003" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>\r
-                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__C_SRCS.147863472" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__C_SRCS"/>\r
-                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__CPP_SRCS.44313954" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__CPP_SRCS"/>\r
-                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__ASM_SRCS.1138240635" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__ASM_SRCS"/>\r
-                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__ASM2_SRCS.472900198" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__ASM2_SRCS"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DISPLAY_ERROR_NUMBER.1829685666" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__C_SRCS.1529542724" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__C_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__CPP_SRCS.1515585759" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__CPP_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__ASM_SRCS.254481684" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__ASM_SRCS"/>\r
+                                                               <inputType id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__ASM2_SRCS.892140900" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.compiler.inputType__ASM2_SRCS"/>\r
                                                        </tool>\r
-                                                       <tool id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.linkerDebug.1702479053" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.linkerDebug">\r
-                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.OUTPUT_FILE.388311302" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.OUTPUT_FILE" value="&quot;${ProjName}.out&quot;" valueType="string"/>\r
-                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.STACK_SIZE.281008610" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.STACK_SIZE" value="0" valueType="string"/>\r
-                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.MAP_FILE.621729312" name="Input and output sections listed into &lt;file&gt; (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.MAP_FILE" value="&quot;${ProjName}.map&quot;" valueType="string"/>\r
-                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.HEAP_SIZE.1208137669" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.HEAP_SIZE" value="4096" valueType="string"/>\r
-                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.SEARCH_PATH.1264252191" name="Add &lt;dir&gt; to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.SEARCH_PATH" valueType="stringList">\r
+                                                       <tool id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.linkerDebug.1033617493" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.linkerDebug">\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.OUTPUT_FILE.1902415178" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.OUTPUT_FILE" value="&quot;${ProjName}.out&quot;" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.STACK_SIZE.1479532073" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.STACK_SIZE" value="0" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.MAP_FILE.749910416" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.MAP_FILE" value="&quot;${ProjName}.map&quot;" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.HEAP_SIZE.153308438" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.HEAP_SIZE" value="4096" valueType="string"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.SEARCH_PATH.1359859481" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.SEARCH_PATH" valueType="stringList">\r
                                                                        <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/lib&quot;"/>\r
                                                                        <listOptionValue builtIn="false" value="&quot;${CG_TOOL_ROOT}/include&quot;"/>\r
                                                                </option>\r
-                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.DISPLAY_ERROR_NUMBER.1175489283" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>\r
-                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.LIBRARY.1560618069" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.LIBRARY" valueType="libs">\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.DISPLAY_ERROR_NUMBER.1618522691" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>\r
+                                                               <option id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.LIBRARY.498176643" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.linkerID.LIBRARY" valueType="libs">\r
                                                                        <listOptionValue builtIn="false" value="&quot;libc.a&quot;"/>\r
                                                                </option>\r
                                                        </tool>\r
                                                </toolChain>\r
                                        </folderInfo>\r
-                                       <fileInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.580416121.sys_link.cmd" name="sys_link.cmd" rcbsApplicability="disable" resourcePath="sys_link.cmd" toolsToInvoke="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.linkerDebug.1702479053.560971072">\r
-                                               <tool id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.linkerDebug.1702479053.560971072" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.linkerDebug.1702479053"/>\r
+                                       <fileInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Debug.580416121.sys_link.cmd" name="sys_link.cmd" rcbsApplicability="disable" resourcePath="sys_link.cmd" toolsToInvoke="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.linkerDebug.1033617493.346117375">\r
+                                               <tool id="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.linkerDebug.1033617493.346117375" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_4.9.exe.linkerDebug.1033617493"/>\r
                                        </fileInfo>\r
                                        <sourceEntries>\r
                                                <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>\r
diff --git a/FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/FreeRTOSConfig.h
new file mode 100644 (file)
index 0000000..d6ddc00
--- /dev/null
@@ -0,0 +1,128 @@
+/*\r
+    FreeRTOS V7.2.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+       \r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?                                      *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, training, latest information,\r
+    license and contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+    the code with commercial support, indemnification, and middleware, under\r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under\r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+#ifndef FREERTOS_CONFIG_H\r
+#define FREERTOS_CONFIG_H\r
+\r
+/*-----------------------------------------------------------\r
+ * Application specific definitions.\r
+ *\r
+ * These definitions should be adjusted for your particular hardware and\r
+ * application requirements.\r
+ *\r
+ * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE\r
+ * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. \r
+ *\r
+ * See http://www.freertos.org/a00110.html.\r
+ *----------------------------------------------------------*/\r
+\r
+#define configUSE_PREEMPTION             1\r
+#define configUSE_IDLE_HOOK                      1\r
+#define configUSE_TICK_HOOK                      1\r
+#define configUSE_TRACE_FACILITY         0\r
+#define configUSE_16_BIT_TICKS           0\r
+#define configCPU_CLOCK_HZ                       ( ( unsigned portLONG ) 90000000 ) /* Timer clock. */\r
+#define configTICK_RATE_HZ                       ( ( portTickType ) 1000 )\r
+#define configMAX_PRIORITIES             ( ( unsigned portBASE_TYPE ) 8 )\r
+#define configMINIMAL_STACK_SIZE         ( ( unsigned portSHORT ) 128 )\r
+#define configTOTAL_HEAP_SIZE            ( ( size_t ) 32768 )\r
+#define configMAX_TASK_NAME_LEN                  ( 16 )\r
+#define configIDLE_SHOULD_YIELD                  1\r
+#define configGENERATE_RUN_TIME_STATS 1\r
+#define configUSE_MALLOC_FAILED_HOOK  1\r
+\r
+#define configCHECK_FOR_STACK_OVERFLOW 2\r
+\r
+/* Co-routine definitions. */\r
+#define configUSE_CO_ROUTINES              0\r
+#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
+\r
+/* Mutexes */\r
+#define configUSE_MUTEXES               1\r
+#define configUSE_RECURSIVE_MUTEXES     0\r
+\r
+/* Semaphores */\r
+#define configUSE_COUNTING_SEMAPHORES   1\r
+\r
+/* Timers */\r
+#define configUSE_TIMERS                1\r
+#define configTIMER_TASK_PRIORITY              ( 2 )\r
+#define configTIMER_QUEUE_LENGTH               10\r
+#define configTIMER_TASK_STACK_DEPTH   ( 128 )\r
+\r
+/* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */\r
+#define INCLUDE_vTaskPrioritySet                   1\r
+#define INCLUDE_uxTaskPriorityGet                  1\r
+#define INCLUDE_vTaskDelete                                0\r
+#define INCLUDE_vTaskCleanUpResources      0\r
+#define INCLUDE_vTaskSuspend                   1\r
+#define INCLUDE_xTaskResumeFromISR          0\r
+#define INCLUDE_vTaskDelayUntil                            1\r
+#define INCLUDE_vTaskDelay                                 1\r
+#define INCLUDE_xTaskGetSchedulerState      1\r
+#define INCLUDE_uxTaskGetStackHighWaterMark 1\r
+\r
+#endif /* FREERTOS_CONFIG_H */\r
diff --git a/FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/ParTest.c b/FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/ParTest.c
new file mode 100644 (file)
index 0000000..97c9045
--- /dev/null
@@ -0,0 +1,142 @@
+/*\r
+    FreeRTOS V7.2.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+       \r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+    \r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?                                      *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+    \r
+    http://www.FreeRTOS.org - Documentation, training, latest information, \r
+    license and contact details.\r
+    \r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
+    the code with commercial support, indemnification, and middleware, under \r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under \r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+/*-----------------------------------------------------------\r
+ * Simple IO routines to control the LEDs.\r
+ *-----------------------------------------------------------*/\r
+\r
+/* Scheduler includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+\r
+/* Demo includes. */\r
+#include "partest.h"\r
+\r
+/* Library includes. */\r
+#include "het.h"\r
+\r
+/* Port bits connected to LEDs. */\r
+const unsigned long ulLEDBits[] = { 25, 18, 29,        /* Bottom row. */\r
+                                                                       17, 31, 0,      /* Top row. */\r
+                                                                       2, 5, 20,               /* Red1, blue1, green1 */\r
+                                                                       4, 27, 16 };    /* Red2, blue2, green2 */\r
+\r
+/* 1 turns a white LED on, or a coloured LED off. */\r
+const unsigned long ulOnStates[] = { 1, 1, 1,\r
+                                                                        1, 1, 1,\r
+                                                                        0, 0, 0,\r
+                                                                        0, 0, 0 };\r
+\r
+const unsigned long ulNumLEDs = sizeof( ulLEDBits ) / sizeof( unsigned long );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+void vParTestInitialise( void )\r
+{\r
+unsigned long ul;\r
+\r
+       /* Initalise the IO ports that drive the LEDs */\r
+       gioSetDirection( hetPORT, 0xFFFFFFFF );\r
+\r
+       /* Turn all the LEDs off. */\r
+       for( ul = 0; ul < ulNumLEDs; ul++ )\r
+       {\r
+               gioSetBit( hetPORT, ulLEDBits[ ul ], !ulOnStates[ ul ] );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vParTestSetLED( unsigned long ulLED, signed long xValue )\r
+{      \r
+       if( ulLED < ulNumLEDs )\r
+       {\r
+               if( xValue == pdFALSE )\r
+               {\r
+                       xValue = !ulOnStates[ ulLED ];\r
+               }\r
+               else\r
+               {\r
+                       xValue = ulOnStates[ ulLED ];\r
+               }\r
+\r
+               gioSetBit( hetPORT, ulLEDBits[ ulLED ], xValue );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vParTestToggleLED( unsigned long ulLED )\r
+{\r
+unsigned long ulBitState;\r
+\r
+       if( ulLED < ulNumLEDs )\r
+       {\r
+               ulBitState = gioGetBit( hetPORT, ulLEDBits[ ulLED ] );\r
+               gioSetBit( hetPORT, ulLEDBits[ ulLED ], !ulBitState );\r
+       }\r
+}\r
+                                                       \r
+\r
+\r
diff --git a/FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/demo/het.c b/FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/demo/het.c
new file mode 100644 (file)
index 0000000..78def33
--- /dev/null
@@ -0,0 +1,121 @@
+/*\r
+    FreeRTOS V7.0.2 - Copyright (C) 2011 Real Time Engineers Ltd.\r
+\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    http://www.FreeRTOS.org - Documentation, latest information, license and\r
+    contact details.\r
+\r
+    http://www.SafeRTOS.com - A version that is certified for use in safety\r
+    critical systems.\r
+\r
+    http://www.OpenRTOS.com - Commercial support, development, porting,\r
+    licensing and training services.\r
+*/\r
+\r
+#include "FreeRTOS.h"\r
+#include "Task.h"\r
+#include "gio.h"\r
+#include "het.h"\r
+\r
+/*\r
+ * Task that flashes the LEDS on the USB stick.\r
+ *\r
+ * This task is also run in Thumb mode to test the ARM/THUMB context switch\r
+ */\r
+\r
+#pragma TASK(vLedTask)\r
+#pragma CODE_STATE(vLedTask, 16)\r
+\r
+void vLedTask(void *pvParameters)\r
+{\r
+       unsigned led    = 0;\r
+       unsigned count  = 0;\r
+       unsigned colour = 0;\r
+\r
+       /* Initalise the IO ports that drive the LEDs */\r
+       gioSetDirection(hetPORT, 0xFFFFFFFF);\r
+       /* switch all leds off */\r
+       gioSetPort(hetPORT, 0x08110034);\r
+\r
+       for(;;)\r
+       {\r
+               /* toggle on/off */\r
+               led ^= 1;\r
+               /* switch TOP row */\r
+               gioSetBit(hetPORT, 25, led);\r
+               gioSetBit(hetPORT, 18, led);\r
+               gioSetBit(hetPORT, 29, led);\r
+               /* switch BOTTOM row */\r
+               gioSetBit(hetPORT, 17, led ^ 1);\r
+               gioSetBit(hetPORT, 31, led ^ 1);\r
+               gioSetBit(hetPORT,  0, led ^ 1);\r
+               vTaskDelay(500);\r
+\r
+               if (++count > 5)\r
+               {\r
+                       count = 0;\r
+                       /* both leds to off */\r
+                       gioSetBit(hetPORT, 2, 1);  gioSetBit(hetPORT,  5, 1);  gioSetBit(hetPORT, 20, 1);\r
+                       gioSetBit(hetPORT, 4, 1);  gioSetBit(hetPORT, 27, 1);  gioSetBit(hetPORT, 16, 1);\r
+                       switch(colour)\r
+                       {\r
+                       case 0:\r
+                               gioSetBit(hetPORT, 2, 0);  /* red */\r
+                               gioSetBit(hetPORT, 4, 0);\r
+                               colour++;\r
+                               continue;\r
+                       case 1:\r
+                               gioSetBit(hetPORT,  5, 0);  /* blue */\r
+                               gioSetBit(hetPORT, 27, 0);\r
+                               colour++;\r
+                               continue;\r
+                       case 2:\r
+                               gioSetBit(hetPORT, 20, 0);  /* green */\r
+                               gioSetBit(hetPORT, 16, 0);\r
+                               colour++;\r
+                               continue;\r
+                       }\r
+                       colour = 0;\r
+               }\r
+       }\r
+}\r
+\r
diff --git a/FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/demo/het.h b/FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/demo/het.h
new file mode 100644 (file)
index 0000000..5f0c47c
--- /dev/null
@@ -0,0 +1,128 @@
+/*\r
+    FreeRTOS V7.0.2 - Copyright (C) 2011 Real Time Engineers Ltd.\r
+\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    http://www.FreeRTOS.org - Documentation, latest information, license and\r
+    contact details.\r
+\r
+    http://www.SafeRTOS.com - A version that is certified for use in safety\r
+    critical systems.\r
+\r
+    http://www.OpenRTOS.com - Commercial support, development, porting,\r
+    licensing and training services.\r
+*/\r
+\r
+\r
+#ifndef __HET_H__\r
+#define __HET_H__\r
+\r
+#include "gio.h"\r
+\r
+/** @struct hetBase\r
+*   @brief HET Register Definition\r
+*\r
+*   This structure is used to access the HET module egisters.\r
+*/\r
+/** @typedef hetBASE_t\r
+*   @brief HET Register Frame Type Definition\r
+*\r
+*   This type is used to access the HET Registers.\r
+*/\r
+typedef volatile struct hetBase\r
+{\r
+    unsigned GCR;     /**< 0x0000: Global control register              */\r
+    unsigned PFR;     /**< 0x0004: Prescale factor register             */\r
+    unsigned ADDR;    /**< 0x0008: Current address register             */\r
+    unsigned OFF1;    /**< 0x000C: Interrupt offset register 1          */\r
+    unsigned OFF2;    /**< 0x0010: Interrupt offset register 2          */\r
+    unsigned INTENAS; /**< 0x0014: Interrupt enable set register        */\r
+    unsigned INTENAC; /**< 0x0018: Interrupt enable clear register      */\r
+    unsigned EXC1;    /**< 0x001C: Exeption control register 1          */\r
+    unsigned EXC2;    /**< 0x0020: Exeption control register 2          */\r
+    unsigned PRY;     /**< 0x0024: Interrupt priority register          */\r
+    unsigned FLG;     /**< 0x0028: Interrupt flag register              */\r
+    unsigned : 32U;   /**< 0x002C: Reserved                             */\r
+    unsigned : 32U;   /**< 0x0030: Reserved                             */\r
+    unsigned HRSH;    /**< 0x0034: High resoltion share register        */\r
+    unsigned XOR;     /**< 0x0038: XOR share register                   */\r
+    unsigned REQENS;  /**< 0x003C: Request enable set register          */\r
+    unsigned REQENC;  /**< 0x0040: Request enable clear register        */\r
+    unsigned REQDS;   /**< 0x0044: Request destination select register  */\r
+    unsigned : 32U;   /**< 0x0048: Reserved                             */\r
+    unsigned DIR;     /**< 0x004C: Direction register                   */\r
+    unsigned DIN;     /**< 0x0050: Data input register                  */\r
+    unsigned DOUT;    /**< 0x0054: Data output register                 */\r
+    unsigned DSET;    /**< 0x0058: Data output set register             */\r
+    unsigned DCLR;    /**< 0x005C: Data output clear register           */\r
+    unsigned PDR;     /**< 0x0060: Open drain register                  */\r
+    unsigned PULDIS;  /**< 0x0064: Pull disable register                */\r
+    unsigned PSL;     /**< 0x0068: Pull select register                 */\r
+    unsigned : 32U;   /**< 0x006C: Reserved                             */\r
+    unsigned : 32U;   /**< 0x0070: Reserved                             */\r
+    unsigned PCREG;   /**< 0x0074: Parity control register              */\r
+    unsigned PAR;     /**< 0x0078: Parity address register              */\r
+    unsigned PPR;     /**< 0x007C: Parity pin select register           */\r
+    unsigned SFPRLD;  /**< 0x0080: Suppression filter preload register  */\r
+    unsigned SFENA;   /**< 0x0084: Suppression filter enable register   */\r
+    unsigned : 32U;   /**< 0x0088: Reserved                             */\r
+    unsigned LBPSEL;  /**< 0x008C: Loop back pair select register       */\r
+    unsigned LBPDIR;  /**< 0x0090: Loop back pair direction register    */\r
+} hetBASE_t;\r
+\r
+\r
+/** @def hetREG\r
+*   @brief HET Register Frame Pointer\r
+*\r
+*   This pointer is used by the HET driver to access the het module registers.\r
+*/\r
+#define hetREG ((hetBASE_t *)0xFFF7B800U)\r
+\r
+\r
+/** @def hetPORT\r
+*   @brief HET GIO Port Register Pointer\r
+*\r
+*   Pointer used by the GIO driver to access I/O PORT of HET\r
+*   (use the GIO drivers to access the port pins).\r
+*/\r
+#define hetPORT ((gioPORT_t *)0xFFF7B84CU)\r
+\r
+#endif\r
diff --git a/FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/demo/partest.h b/FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/demo/partest.h
new file mode 100644 (file)
index 0000000..268654e
--- /dev/null
@@ -0,0 +1,77 @@
+/*\r
+    FreeRTOS V7.2.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+       \r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+    \r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?                                      *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+    \r
+    http://www.FreeRTOS.org - Documentation, training, latest information, \r
+    license and contact details.\r
+    \r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
+    the code with commercial support, indemnification, and middleware, under \r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under \r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+#ifndef PARTEST_H\r
+#define PARTEST_H\r
+\r
+#define partstDEFAULT_PORT_ADDRESS             ( ( unsigned short ) 0x378 )\r
+\r
+void vParTestInitialise( void );\r
+void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue );\r
+void vParTestToggleLED( unsigned portBASE_TYPE uxLED );\r
+\r
+#endif\r
+\r
index 11fd02d7a7a0dfafd7af44d1eba86b9cc396495c..a7d89977b576d4a36cf4f7569debfe5aa54e3e28 100644 (file)
@@ -1,5 +1,295 @@
-/* main.c \r
+#if 1\r
+/*\r
+    FreeRTOS V7.2.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?"                                      *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, training, latest information,\r
+    license and contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+    the code with commercial support, indemnification, and middleware, under\r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under\r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+/******************************************************************************\r
+ * This project provides two demo applications.  A simple blinky style project,\r
+ * and a more comprehensive test and demo application.  The\r
+ * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting (defined in this file) is used to\r
+ * select between the two.  The simply blinky demo is implemented and described\r
+ * in main_blinky.c.  The more comprehensive test and demo application is\r
+ * implemented and described in main_full.c.\r
+ *\r
+ * This file implements the code that is not demo specific, including the\r
+ * hardware setup and FreeRTOS hook functions.\r
  *\r
+ */\r
+\r
+/* Standard includes. */\r
+#include <stdio.h>\r
+\r
+/* Kernel includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+\r
+/* Standard demo includes - just needed for the LED (ParTest) initialisation\r
+function. */\r
+#include "partest.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
+#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY     1\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * Set up the hardware ready to run this demo.\r
+ */\r
+static void prvSetupHardware( void );\r
+\r
+/*\r
+ * main_blinky() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1.\r
+ * main_full() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 0.\r
+ */\r
+extern void main_blinky( void );\r
+extern void main_full( void );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/* See the documentation page for this demo on the FreeRTOS.org web site for\r
+full information - including hardware setup requirements. */\r
+\r
+int main( void )\r
+{\r
+       /* Prepare the hardware to run this demo. */\r
+       prvSetupHardware();\r
+\r
+       /* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top\r
+       of this file. */\r
+       #if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1\r
+       {\r
+               main_blinky();\r
+       }\r
+       #else\r
+       {\r
+               main_full();\r
+       }\r
+       #endif\r
+\r
+       return 0;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvSetupHardware( void )\r
+{\r
+       /* Perform any configuration necessary to use the ParTest LED output\r
+       functions. */\r
+       gioInit();\r
+       vParTestInitialise();\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vApplicationMallocFailedHook( void )\r
+{\r
+       /* vApplicationMallocFailedHook() will only be called if\r
+       configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h.  It is a hook\r
+       function that will get called if a call to pvPortMalloc() fails.\r
+       pvPortMalloc() is called internally by the kernel whenever a task, queue,\r
+       timer or semaphore is created.  It is also called by various parts of the\r
+       demo application.  If heap_1.c or heap_2.c are used, then the size of the\r
+       heap available to pvPortMalloc() is defined by configTOTAL_HEAP_SIZE in\r
+       FreeRTOSConfig.h, and the xPortGetFreeHeapSize() API function can be used\r
+       to query the size of free heap space that remains (although it does not\r
+       provide information on how the remaining heap might be fragmented). */\r
+       taskDISABLE_INTERRUPTS();\r
+       for( ;; );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vApplicationIdleHook( void )\r
+{\r
+       /* vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set\r
+       to 1 in FreeRTOSConfig.h.  It will be called on each iteration of the idle\r
+       task.  It is essential that code added to this hook function never attempts\r
+       to block in any way (for example, call xQueueReceive() with a block time\r
+       specified, or call vTaskDelay()).  If the application makes use of the\r
+       vTaskDelete() API function (as this demo application does) then it is also\r
+       important that vApplicationIdleHook() is permitted to return to its calling\r
+       function, because it is the responsibility of the idle task to clean up\r
+       memory allocated by the kernel to any task that has since been deleted. */\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName )\r
+{\r
+       ( void ) pcTaskName;\r
+       ( void ) pxTask;\r
+\r
+       /* Run time stack overflow checking is performed if\r
+       configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2.  This hook\r
+       function is called if a stack overflow is detected. */\r
+       taskDISABLE_INTERRUPTS();\r
+       for( ;; );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vApplicationTickHook( void )\r
+{\r
+       /* This function will be called by each tick interrupt if\r
+       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
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+#else\r
+\r
+/*\r
+    FreeRTOS V7.2.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+    \r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?                                      *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+    \r
+    http://www.FreeRTOS.org - Documentation, training, latest information, \r
+    license and contact details.\r
+    \r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
+    the code with commercial support, indemnification, and middleware, under \r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under \r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+/* Standard includes. */\r
+#include <stdio.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+#include "timers.h"\r
+#include "queue.h"\r
+\r
+/* Library includes. */\r
+#include "gio.h"\r
+\r
+/* Demo application includes. */\r
+#include "TimerDemo.h"\r
+#include "countsem.h"\r
+#include "GenQTest.h"\r
+#include "dynamic.h"\r
+\r
+\r
+/*\r
  * "Check" callback function - Called each time the 'check' timer expires.  The\r
  * check timer executes every five seconds.  Its main function is to check that \r
  * all the standard demo tasks are still operational.  Each time it executes it \r
  *\r
  */\r
 \r
-#include <stdio.h>\r
-#include "FreeRTOS.h"\r
-#include "task.h"\r
-#include "timers.h"\r
-#include "queue.h"\r
-#include "gio.h"\r
-#include "TimerDemo.h"\r
-#include "countsem.h"\r
-#include "GenQTest.h"\r
-#include "dynamic.h"\r
-\r
-\r
-/* ----------------------------------------------------------------------------------------------------------- */\r
-\r
 /* Codes sent within messages to the LCD task so the LCD task can interpret\r
 exactly what the message it just received was.  These are sent in the\r
 cMessageID member of the message structure (defined below). */\r
-//#define mainMESSAGE_BUTTON_UP                        ( 1 )\r
-//#define mainMESSAGE_BUTTON_SEL               ( 2 )\r
-#define mainMESSAGE_STATUS                             ( 3 )\r
-\r
-/* When the cMessageID member of the message sent to the MSG task is\r
-mainMESSAGE_STATUS then these definitions are sent in the ulMessageValue member\r
-of the same message and indicate what the status actually is. */\r
 #define mainERROR_DYNAMIC_TASKS                        ( pdPASS + 1 )\r
-#define mainERROR_COM_TEST                             ( pdPASS + 2 )\r
 #define mainERROR_GEN_QUEUE_TEST               ( pdPASS + 3 )\r
 #define mainERROR_REG_TEST                             ( pdPASS + 4 )\r
 #define mainERROR_TIMER_TEST                   ( pdPASS + 5 )\r
 #define mainERROR_COUNT_SEM_TEST               ( pdPASS + 6 )\r
 \r
 /* Priorities used by the test and demo tasks. */\r
-#define mainMSG_TASK_PRIORITY                  ( tskIDLE_PRIORITY + 1 )\r
-#define mainCOM_TEST_PRIORITY                  ( tskIDLE_PRIORITY + 2 )\r
+#define mainPRINT_TASK_PRIORITY                        ( tskIDLE_PRIORITY + 1 )\r
 #define mainGENERIC_QUEUE_TEST_PRIORITY        ( tskIDLE_PRIORITY )\r
+#define mainLED_TASK_PRIORITY                  ( tskIDLE_PRIORITY + 2 )\r
+#define mainSTAT_TASK_PRIORITY                 ( tskIDLE_PRIORITY )\r
 \r
 /* Just used to ensure parameters are passed into tasks correctly. */\r
-#define mainTASK_PARAMETER_CHECK_VALUE ((void *)0xDEAD)\r
+#define mainTASK_PARAMETER_CHECK_VALUE ( ( void * ) 0xDEADBEEF )\r
 \r
 /* The length of the queue (the number of items the queue can hold) that is used\r
-to send messages from tasks and interrupts the the MSG task. */\r
+to send messages from tasks and interrupts the the Print task. */\r
 #define mainQUEUE_LENGTH                               ( 5 )\r
 \r
 /* The base period used by the timer test tasks. */\r
-#define mainTIMER_TEST_PERIOD                  ( 50 )\r
+#define mainTIMER_TEST_PERIOD                  ( 50 / portTICK_RATE_MS )\r
 \r
 /* The frequency at which the check timer (described in the comments at the top\r
 of this file) will call its callback function. */\r
 #define mainCHECK_TIMER_PERIOD                 ( 5000UL / ( unsigned long ) portTICK_RATE_MS )\r
 \r
-/* Misc. */\r
+/* A block time of 0 simply means "don't block". */\r
 #define mainDONT_BLOCK                                 ( 0 )\r
 \r
-\r
-/* ----------------------------------------------------------------------------------------------------------- */\r
-/* external regsiter check tasks, this checks that the context store/restore works                             */\r
-\r
+/* \r
+ * The register check tasks, as decribed in the comments at the top of this \r
+ * file.  The nature of the tasks necessitates that they are written in \r
+ * assembler. \r
+ */\r
 extern void vRegTestTask1(void *pvParameters); \r
 extern void vRegTestTask2(void *pvParameters); \r
 \r
 /*\r
- * Definition of the MSG/controller task described in the comments at the top\r
- * of this file.\r
+ * Definition of the Print task described in the comments at the top of this \r
+ * file.\r
  */\r
-static void prvMsgTask( void *pvParameters );\r
-\r
-/*\r
- * Converts a status message value into an appropriate string for display on\r
- * the LCD.  The string is written to pcBuffer.\r
- */\r
-static void prvGenerateStatusMessage( char *pcBuffer, unsigned long ulStatusValue );\r
+static void prvPrintTask( void *pvParameters );\r
 \r
 /*\r
  * Defines the 'check' functionality as described at the top of this file.  This\r
  * function is the callback function for the 'check' timer. */\r
 static void vCheckTimerCallback( xTimerHandle xTimer );\r
 \r
+extern void vLedTask( void * pvParameters );\r
+void vStatsTask(void *pvParameters);\r
 \r
-/* ----------------------------------------------------------------------------------------------------------- */\r
-\r
-static signed char buffer[1024];\r
-\r
-void vStatsTask(void *pvParameters)\r
-{\r
-       printf("**** Task Statistics Started\n");\r
-       for (;;)\r
-       {\r
-               vTaskDelay(15000);\r
-               vTaskGetRunTimeStats(buffer);\r
-               printf("%s\n", buffer);\r
-       }\r
-}\r
-\r
-\r
-/* ----------------------------------------------------------------------------------------------------------- */\r
+/*-----------------------------------------------------------*/\r
 \r
 /* variable incremente in the IDLE hook */\r
 volatile unsigned usIdleCounter = 0;\r
@@ -129,41 +379,33 @@ stops incrementing then it is likely that its associate task has stalled. */
 volatile unsigned usRegTest1Counter = 0, usRegTest2Counter = 0;\r
 \r
 /* The handle of the queue used to send messages from tasks and interrupts to\r
-   the MSG task. */\r
-static xQueueHandle xMsgQueue = NULL;\r
+   the Print task. */\r
+static xQueueHandle xPrintQueue = NULL;\r
 \r
 /* The 'check' timer, as described at the top of this file. */\r
 static xTimerHandle xCheckTimer = NULL;\r
 \r
-/* The definition of each message sent from tasks and interrupts to the MSG\r
-task. */\r
-typedef struct\r
-{\r
-       char     cMessageID;            /* << States what the message is. */\r
-       unsigned ulMessageValue;        /* << States the message value (can be an integer, string pointer, etc. depending on the value of cMessageID). */\r
-} xQueueMessage;\r
-\r
 \r
-/* ----------------------------------------------------------------------------------------------------------- */\r
+/*-----------------------------------------------------------*/\r
 \r
 void main()\r
 {\r
        /* initalise DIO ports */\r
        gioInit();\r
-       \r
-       gioSetBit(gioPORTA, 0, 1);\r
-       gioSetBit(gioPORTA, 0, 0);\r
 \r
-\r
-       /* Create the queue used by tasks and interrupts to send strings to the MSG task. */\r
-       xMsgQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( xQueueMessage ) );\r
+       /* Create the queue used by tasks and interrupts to send strings to the \r
+       print task. */\r
+       xPrintQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( unsigned long ) );\r
 \r
        /* If the queue could not be created then don't create any tasks that might\r
        attempt to use the queue. */\r
-       if( xMsgQueue != NULL )\r
+       if( xPrintQueue != NULL )\r
        {\r
                /* Create STATS task, this prints out a summary of running tasks every 15s */\r
-               xTaskCreate(vStatsTask, (signed char *)"STATS..", 600, NULL, 6, NULL);\r
+               xTaskCreate(vStatsTask, (signed char *)"STATS..", 600, NULL, mainSTAT_TASK_PRIORITY, NULL);\r
+\r
+               /* Create LED task, this will flash the LEDs on the USB stick */\r
+               xTaskCreate(vLedTask, (signed char *)"LEDS...", configMINIMAL_STACK_SIZE, NULL, mainLED_TASK_PRIORITY, NULL);\r
 \r
                /* Create the standard demo tasks. */\r
                vStartDynamicPriorityTasks();\r
@@ -178,12 +420,11 @@ void main()
                queue, freeing up space for more commands to be received). */\r
                vStartTimerDemoTask(mainTIMER_TEST_PERIOD);\r
                \r
-               /* Create the MSGl and register test tasks. */\r
-               xTaskCreate(prvMsgTask,    (signed char *)"MSG....",  500, mainTASK_PARAMETER_CHECK_VALUE, mainMSG_TASK_PRIORITY, NULL );\r
+               /* Create the Print and register test tasks. */\r
+               xTaskCreate(prvPrintTask, (signed char *)"Print..", 500, mainTASK_PARAMETER_CHECK_VALUE, mainPRINT_TASK_PRIORITY, NULL );\r
                xTaskCreate(vRegTestTask1, (signed char *)"REG1...", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL);\r
                xTaskCreate(vRegTestTask2, (signed char *)"REG2...", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL);\r
                \r
-               \r
                /* Create the 'check' timer - the timer that periodically calls the\r
                check function as described at the top of this file.  Note that, for\r
                the reasons stated in the comments above the call to \r
@@ -201,16 +442,31 @@ void main()
        hook function, if one is configured. */ \r
        for (;;);\r
 }\r
+/*-----------------------------------------------------------*/\r
 \r
+void vStatsTask(void *pvParameters)\r
+{\r
+/* Buffer used to hold the table of run time statistics.  This is static so it\r
+does not overflow the task stack. */\r
+static signed char cStatsBuffer[ 1024 ];\r
+const portTickType x15Seconds = 15000 / portTICK_RATE_MS;\r
 \r
-/* ----------------------------------------------------------------------------------------------------------- */\r
+       printf("**** Task Statistics Started\n");\r
+       for (;;)\r
+       {\r
+               vTaskDelay( x15Seconds );\r
+               vTaskGetRunTimeStats( cStatsBuffer );\r
+               printf("%s\n", cStatsBuffer );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
 \r
-static void prvMsgTask( void *pvParameters )\r
+static void prvPrintTask( void *pvParameters )\r
 {\r
-       xQueueMessage xReceivedMessage;\r
-       static char   cBuffer[50];  \r
+unsigned long ulReceivedMessage;\r
+static signed char cPrintBuffer[ 50 ];  \r
 \r
-       printf("**** Msg Task Started\n");\r
+       printf( "**** Print Task Started\n" );\r
 \r
        /* Now the scheduler has been started (it must have been for this task to\r
        be running), start the check timer too.  The call to xTimerStart() will\r
@@ -224,7 +480,7 @@ static void prvMsgTask( void *pvParameters )
        is done after a short delay to ensure all the demo tasks have created all\r
        the objects they are going to use.  */\r
        vTaskDelay( mainTIMER_TEST_PERIOD * 10 );\r
-       printf("**** %d heap free\n", (int)xPortGetFreeHeapSize());\r
+       printf( "**** %d heap free\n", ( int ) xPortGetFreeHeapSize() );\r
        \r
        /* Just as a test of the port, and for no functional reason, check the task\r
        parameter contains its expected value. */\r
@@ -240,73 +496,33 @@ static void prvMsgTask( void *pvParameters )
                set to 1 in FreeRTOSConfig.h, therefore there is no need to check the\r
                function return value and the function will only return when a value\r
                has been received. */\r
-               xQueueReceive( xMsgQueue, &xReceivedMessage, portMAX_DELAY );\r
+               xQueueReceive( xPrintQueue, &ulReceivedMessage, portMAX_DELAY );\r
 \r
                /* What is this message?  What does it contain? */\r
-               switch( xReceivedMessage.cMessageID )\r
+               switch( ulReceivedMessage )\r
                {\r
-#if 0                  \r
-                       case mainMESSAGE_BUTTON_UP              :       /* The button poll task has just\r
-                                                                                               informed this task that the up\r
-                                                                                               button on the joystick input has\r
-                                                                                               been pressed or released. */\r
-                                                                                               sprintf( cBuffer, "Button up = %d", ( int ) xReceivedMessage.ulMessageValue );\r
+                       case pdPASS                                             :       sprintf( ( char * ) cPrintBuffer, "Status = PASS" );\r
                                                                                                break;\r
-\r
-                       case mainMESSAGE_BUTTON_SEL             :       /* The select button interrupt\r
-                                                                                               just informed this task that the\r
-                                                                                               select button has been pressed.\r
-                                                                                               In this case the pointer to the \r
-                                                                                               string to print is sent directly \r
-                                                                                               in the ulMessageValue member of \r
-                                                                                               the     message.  This just \r
-                                                                                               demonstrates a different \r
-                                                                                               communication technique. */\r
-                                                                                               sprintf( cBuffer, "%s", ( char * ) xReceivedMessage.ulMessageValue );\r
+                       case mainERROR_DYNAMIC_TASKS    :       sprintf( ( char * ) cPrintBuffer, "Err: Dynamic tsks" );\r
+                                                                                               break;\r
+                       case mainERROR_GEN_QUEUE_TEST   :       sprintf( ( char * ) cPrintBuffer, "Error: Gen Q test" );\r
+                                                                                               break;\r
+                       case mainERROR_REG_TEST                 :       sprintf( ( char * ) cPrintBuffer, "Error: Reg test" );\r
+                                                                                               break;\r
+                       case mainERROR_TIMER_TEST               :       sprintf( ( char * ) cPrintBuffer, "Error: Tmr test" );\r
                                                                                                break;\r
-#endif                                                                                         \r
-                       case mainMESSAGE_STATUS                 :       /* The tick interrupt hook\r
-                                                                                               function has just informed this\r
-                                                                                               task of the system status.\r
-                                                                                               Generate a string in accordance\r
-                                                                                               with the status value. */\r
-                                                                                               prvGenerateStatusMessage( cBuffer, xReceivedMessage.ulMessageValue );\r
+                       case mainERROR_COUNT_SEM_TEST   :       sprintf( ( char * ) cPrintBuffer, "Error: Count sem" );\r
                                                                                                break;\r
-                                                                                               \r
-                       default                                                 :       sprintf( cBuffer, "Unknown message" );\r
+                       default                                                 :       sprintf( ( char * ) cPrintBuffer, "Unknown status" );\r
                                                                                                break;\r
                }\r
                /* Output the message that was placed into the cBuffer array within the\r
                switch statement above, then move onto the next line ready for the next\r
                message to arrive on the queue. */\r
-               printf("**** Message Received: %s\n", cBuffer);\r
+               printf( "**** Message Received: %s\n", cPrintBuffer );\r
        }               \r
 }\r
 \r
-static void prvGenerateStatusMessage(char *pcBuffer, unsigned long ulStatusValue)\r
-{\r
-       /* Just a utility function to convert a status value into a meaningful\r
-       string for output. */\r
-       switch( ulStatusValue )\r
-       {\r
-               case pdPASS                                             :       sprintf( pcBuffer, "Status = PASS" );\r
-                                                                                       break;\r
-               case mainERROR_DYNAMIC_TASKS    :       sprintf( pcBuffer, "Err: Dynamic tsks" );\r
-                                                                                       break;\r
-               case mainERROR_COM_TEST                 :       sprintf( pcBuffer, "Err: COM test" );\r
-                                                                                       break;\r
-               case mainERROR_GEN_QUEUE_TEST   :       sprintf( pcBuffer, "Error: Gen Q test" );\r
-                                                                                       break;\r
-               case mainERROR_REG_TEST                 :       sprintf( pcBuffer, "Error: Reg test" );\r
-                                                                                       break;\r
-               case mainERROR_TIMER_TEST               :       sprintf( pcBuffer, "Error: Tmr test" );\r
-                                                                                       break;\r
-               case mainERROR_COUNT_SEM_TEST   :       sprintf( pcBuffer, "Error: Count sem" );\r
-                                                                                       break;\r
-               default                                                 :       sprintf( pcBuffer, "Unknown status" );\r
-                                                                                       break;\r
-       }\r
-}\r
 \r
 /* ----------------------------------------------------------------------------------------------------------- */\r
 \r
@@ -316,7 +532,7 @@ static void vCheckTimerCallback( xTimerHandle xTimer )
 \r
        /* Define the status message that is sent to the LCD task.  By default the\r
           status is PASS. */\r
-       static xQueueMessage xStatusMessage = { mainMESSAGE_STATUS, pdPASS };\r
+       unsigned long ulStatus = pdPASS;\r
 \r
        /* This is the callback function used by the 'check' timer, as described\r
        at the top of this file. */\r
@@ -327,49 +543,43 @@ static void vCheckTimerCallback( xTimerHandle xTimer )
        /* See if the standard demo tasks are executing as expected, changing\r
        the message that is sent to the LCD task from PASS to an error code if\r
        any tasks set reports an error. */\r
-#if 0  \r
-       if( xAreComTestTasksStillRunning() != pdPASS )\r
-       {\r
-               xStatusMessage.ulMessageValue = mainERROR_COM_TEST;\r
-       }\r
-#endif\r
        if( xAreDynamicPriorityTasksStillRunning() != pdPASS )\r
        {\r
-               xStatusMessage.ulMessageValue = mainERROR_DYNAMIC_TASKS;\r
+               ulStatus = mainERROR_DYNAMIC_TASKS;\r
        }\r
        \r
        if( xAreGenericQueueTasksStillRunning() != pdPASS )\r
        {\r
-               xStatusMessage.ulMessageValue = mainERROR_GEN_QUEUE_TEST;\r
+               ulStatus = mainERROR_GEN_QUEUE_TEST;\r
        }                       \r
        \r
        if( xAreCountingSemaphoreTasksStillRunning() != pdPASS )\r
        {\r
-               xStatusMessage.ulMessageValue = mainERROR_COUNT_SEM_TEST;\r
+               ulStatus = mainERROR_COUNT_SEM_TEST;\r
        }\r
        \r
        if( xAreTimerDemoTasksStillRunning( ( portTickType ) mainCHECK_TIMER_PERIOD ) != pdPASS )\r
        {\r
-               xStatusMessage.ulMessageValue = mainERROR_TIMER_TEST;\r
+               ulStatus = mainERROR_TIMER_TEST;\r
        }\r
 \r
        /* Check the reg test tasks are still cycling.  They will stop\r
        incrementing their loop counters if they encounter an error. */\r
        if( usRegTest1Counter == usLastRegTest1Counter )\r
        {\r
-               xStatusMessage.ulMessageValue = mainERROR_REG_TEST;\r
+               ulStatus = mainERROR_REG_TEST;\r
        }\r
 \r
        if( usRegTest2Counter == usLastRegTest2Counter )\r
        {\r
-               xStatusMessage.ulMessageValue = mainERROR_REG_TEST;\r
+               ulStatus = mainERROR_REG_TEST;\r
        }\r
 \r
        usLastRegTest1Counter = usRegTest1Counter;\r
        usLastRegTest2Counter = usRegTest2Counter;\r
        \r
        /* This is called from a timer callback so must not block! */\r
-       xQueueSendToBack( xMsgQueue, &xStatusMessage, mainDONT_BLOCK );\r
+       xQueueSendToBack( xPrintQueue, &ulStatus, mainDONT_BLOCK );\r
 }\r
 \r
 \r
@@ -425,5 +635,6 @@ void vApplicationIdleHook(void)
 \r
 /* ----------------------------------------------------------------------------------------------------------- */\r
 \r
+#endif\r
 \r
 \r
diff --git a/FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/main_blinky.c b/FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/main_blinky.c
new file mode 100644 (file)
index 0000000..1beca16
--- /dev/null
@@ -0,0 +1,240 @@
+volatile unsigned long ulRx = 0, ulTx = 0;\r
+/*\r
+    FreeRTOS V7.2.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+    \r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?                                      *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+    \r
+    http://www.FreeRTOS.org - Documentation, training, latest information, \r
+    license and contact details.\r
+    \r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
+    the code with commercial support, indemnification, and middleware, under \r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under \r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+/******************************************************************************\r
+ * NOTE 1:  This project provides two demo applications.  A simple blinky style\r
+ * project, and a more comprehensive test and demo application.  The\r
+ * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting in main.c is used to select\r
+ * between the two.  See the notes on using mainCREATE_SIMPLE_BLINKY_DEMO_ONLY\r
+ * in main.c.  This file implements the simply blinky style version.\r
+ *\r
+ * NOTE 2:  This file only contains the source code that is specific to the\r
+ * basic demo.  Generic functions, such FreeRTOS hook functions, and functions\r
+ * required to configure the hardware, are defined in main.c.\r
+ ******************************************************************************\r
+ *\r
+ * main_blinky() creates one queue, and two tasks.  It then starts the\r
+ * scheduler.\r
+ *\r
+ * The Queue Send Task:\r
+ * The queue send task is implemented by the prvQueueSendTask() function in\r
+ * this file.  prvQueueSendTask() sits in a loop that causes it to repeatedly\r
+ * block for 200 milliseconds, before sending the value 100 to the queue that\r
+ * was created within main_blinky().  Once the value is sent, the task loops\r
+ * back around to block for another 200 milliseconds.\r
+ *\r
+ * The Queue Receive Task:\r
+ * The queue receive task is implemented by the prvQueueReceiveTask() function\r
+ * in this file.  prvQueueReceiveTask() sits in a loop where it repeatedly\r
+ * blocks on attempts to read data from the queue that was created within\r
+ * main_blinky().  When data is received, the task checks the value of the\r
+ * data, and if the value equals the expected 100, toggles the LED.  The 'block\r
+ * time' parameter passed to the queue receive function specifies that the\r
+ * task should be held in the Blocked state indefinitely to wait for data to\r
+ * be available on the queue.  The queue receive task will only leave the\r
+ * Blocked state when the queue send task writes to the queue.  As the queue\r
+ * send task writes to the queue every 200 milliseconds, the queue receive\r
+ * task leaves the Blocked state every 200 milliseconds, and therefore toggles\r
+ * the LED every 200 milliseconds.\r
+ */\r
+\r
+/* Standard includes. */\r
+#include <stdio.h>\r
+\r
+/* Kernel includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+#include "semphr.h"\r
+\r
+/* Common demo includes. */\r
+#include "partest.h"\r
+\r
+/* Priorities at which the tasks are created. */\r
+#define mainQUEUE_RECEIVE_TASK_PRIORITY                ( tskIDLE_PRIORITY + 2 )\r
+#define        mainQUEUE_SEND_TASK_PRIORITY            ( tskIDLE_PRIORITY + 1 )\r
+\r
+/* The rate at which data is sent to the queue.  The 200ms value is converted\r
+to ticks using the portTICK_RATE_MS constant. */\r
+#define mainQUEUE_SEND_FREQUENCY_MS                    ( 200 / portTICK_RATE_MS )\r
+\r
+/* The number of items the queue can hold.  This is 1 as the receive task\r
+will remove items as they are added, meaning the send task should always find\r
+the queue empty. */\r
+#define mainQUEUE_LENGTH                                       ( 1 )\r
+\r
+/* Values passed to the two tasks just to check the task parameter \r
+functionality. */\r
+#define mainQUEUE_SEND_PARAMETER                       ( 0x1111UL )\r
+#define mainQUEUE_RECEIVE_PARAMETER                    ( 0x22UL )\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * The tasks as described in the comments at the top of this file.\r
+ */\r
+static void prvQueueReceiveTask( void *pvParameters );\r
+static void prvQueueSendTask( void *pvParameters );\r
+\r
+/*\r
+ * Called by main() to create the simply blinky style application if\r
+ * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1.\r
+ */\r
+void main_blinky( void );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/* The queue used by both tasks. */\r
+static xQueueHandle xQueue = NULL;\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+void main_blinky( void )\r
+{\r
+       /* Create the queue. */\r
+       xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( unsigned long ) );\r
+\r
+       if( xQueue != NULL )\r
+       {\r
+               /* Start the two tasks as described in the comments at the top of this\r
+               file. */\r
+               xTaskCreate( prvQueueReceiveTask,                                       /* The function that implements the task. */\r
+                                       ( signed char * ) "Rx",                                 /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+                                       configMINIMAL_STACK_SIZE,                               /* The size of the stack to allocate to the task. */\r
+                                       ( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */\r
+                                       mainQUEUE_RECEIVE_TASK_PRIORITY,                /* The priority assigned to the task. */\r
+                                       NULL );                                                                 /* The task handle is not required, so NULL is passed. */\r
+\r
+               xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+\r
+               /* Start the tasks and timer running. */\r
+               vTaskStartScheduler();\r
+       }\r
+\r
+       /* If all is well, the scheduler will now be running, and the following\r
+       line will never be reached.  If the following line does execute, then\r
+       there was insufficient FreeRTOS heap memory available for the idle and/or\r
+       timer tasks     to be created.  See the memory management section on the\r
+       FreeRTOS web site for more details. */\r
+       for( ;; );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvQueueSendTask( void *pvParameters )\r
+{\r
+portTickType xNextWakeTime;\r
+const unsigned long ulValueToSend = 100UL;\r
+\r
+       /* Check the task parameter is as expected. */\r
+       configASSERT( ( ( unsigned long ) pvParameters ) == mainQUEUE_SEND_PARAMETER );\r
+\r
+       /* Initialise xNextWakeTime - this only needs to be done once. */\r
+       xNextWakeTime = xTaskGetTickCount();\r
+\r
+       for( ;; )\r
+       {\r
+               /* Place this task in the blocked state until it is time to run again.\r
+               The block time is specified in ticks, the constant used converts ticks\r
+               to ms.  While in the Blocked state this task will not consume any CPU\r
+               time. */\r
+               vTaskDelayUntil( &xNextWakeTime, mainQUEUE_SEND_FREQUENCY_MS );\r
+\r
+               /* Send to the queue - causing the queue receive task to unblock and\r
+               toggle the LED.  0 is used as the block time so the sending operation\r
+               will not block - it shouldn't need to block as the queue should always\r
+               be empty at this point in the code. */\r
+               xQueueSend( xQueue, &ulValueToSend, 0U );\r
+ulTx++;\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvQueueReceiveTask( void *pvParameters )\r
+{\r
+unsigned long ulReceivedValue;\r
+\r
+       /* Check the task parameter is as expected. */\r
+       configASSERT( ( ( unsigned long ) pvParameters ) == mainQUEUE_RECEIVE_PARAMETER );\r
+\r
+       for( ;; )\r
+       {\r
+               /* Wait until something arrives in the queue - this task will block\r
+               indefinitely provided INCLUDE_vTaskSuspend is set to 1 in\r
+               FreeRTOSConfig.h. */\r
+               xQueueReceive( xQueue, &ulReceivedValue, portMAX_DELAY );\r
+\r
+               /*  To get here something must have been received from the queue, but\r
+               is it the expected value?  If it is, toggle the LED. */\r
+               if( ulReceivedValue == 100UL )\r
+               {\r
+                       vParTestToggleLED( 0 );\r
+                       ulReceivedValue = 0U;\r
+ulRx++;\r
+               }\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
diff --git a/FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/os/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/os/FreeRTOSConfig.h
deleted file mode 100644 (file)
index d6ddc00..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*\r
-    FreeRTOS V7.2.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
-       \r
-\r
-    ***************************************************************************\r
-     *                                                                       *\r
-     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
-     *    Complete, revised, and edited pdf reference manuals are also       *\r
-     *    available.                                                         *\r
-     *                                                                       *\r
-     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
-     *    ensuring you get running as quickly as possible and with an        *\r
-     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
-     *    the FreeRTOS project to continue with its mission of providing     *\r
-     *    professional grade, cross platform, de facto standard solutions    *\r
-     *    for microcontrollers - completely free of charge!                  *\r
-     *                                                                       *\r
-     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
-     *                                                                       *\r
-     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
-     *                                                                       *\r
-    ***************************************************************************\r
-\r
-\r
-    This file is part of the FreeRTOS distribution.\r
-\r
-    FreeRTOS is free software; you can redistribute it and/or modify it under\r
-    the terms of the GNU General Public License (version 2) as published by the\r
-    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
-    >>>NOTE<<< The modification to the GPL is included to allow you to\r
-    distribute a combined work that includes FreeRTOS without being obliged to\r
-    provide the source code for proprietary components outside of the FreeRTOS\r
-    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
-    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
-    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
-    more details. You should have received a copy of the GNU General Public\r
-    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
-    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
-    by writing to Richard Barry, contact details for whom are available on the\r
-    FreeRTOS WEB site.\r
-\r
-    1 tab == 4 spaces!\r
-\r
-    ***************************************************************************\r
-     *                                                                       *\r
-     *    Having a problem?  Start by reading the FAQ "My application does   *\r
-     *    not run, what could be wrong?                                      *\r
-     *                                                                       *\r
-     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
-     *                                                                       *\r
-    ***************************************************************************\r
-\r
-\r
-    http://www.FreeRTOS.org - Documentation, training, latest information,\r
-    license and contact details.\r
-\r
-    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
-    including FreeRTOS+Trace - an indispensable productivity tool.\r
-\r
-    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
-    the code with commercial support, indemnification, and middleware, under\r
-    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
-    provide a safety engineered and independently SIL3 certified version under\r
-    the SafeRTOS brand: http://www.SafeRTOS.com.\r
-*/\r
-\r
-#ifndef FREERTOS_CONFIG_H\r
-#define FREERTOS_CONFIG_H\r
-\r
-/*-----------------------------------------------------------\r
- * Application specific definitions.\r
- *\r
- * These definitions should be adjusted for your particular hardware and\r
- * application requirements.\r
- *\r
- * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE\r
- * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. \r
- *\r
- * See http://www.freertos.org/a00110.html.\r
- *----------------------------------------------------------*/\r
-\r
-#define configUSE_PREEMPTION             1\r
-#define configUSE_IDLE_HOOK                      1\r
-#define configUSE_TICK_HOOK                      1\r
-#define configUSE_TRACE_FACILITY         0\r
-#define configUSE_16_BIT_TICKS           0\r
-#define configCPU_CLOCK_HZ                       ( ( unsigned portLONG ) 90000000 ) /* Timer clock. */\r
-#define configTICK_RATE_HZ                       ( ( portTickType ) 1000 )\r
-#define configMAX_PRIORITIES             ( ( unsigned portBASE_TYPE ) 8 )\r
-#define configMINIMAL_STACK_SIZE         ( ( unsigned portSHORT ) 128 )\r
-#define configTOTAL_HEAP_SIZE            ( ( size_t ) 32768 )\r
-#define configMAX_TASK_NAME_LEN                  ( 16 )\r
-#define configIDLE_SHOULD_YIELD                  1\r
-#define configGENERATE_RUN_TIME_STATS 1\r
-#define configUSE_MALLOC_FAILED_HOOK  1\r
-\r
-#define configCHECK_FOR_STACK_OVERFLOW 2\r
-\r
-/* Co-routine definitions. */\r
-#define configUSE_CO_ROUTINES              0\r
-#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
-\r
-/* Mutexes */\r
-#define configUSE_MUTEXES               1\r
-#define configUSE_RECURSIVE_MUTEXES     0\r
-\r
-/* Semaphores */\r
-#define configUSE_COUNTING_SEMAPHORES   1\r
-\r
-/* Timers */\r
-#define configUSE_TIMERS                1\r
-#define configTIMER_TASK_PRIORITY              ( 2 )\r
-#define configTIMER_QUEUE_LENGTH               10\r
-#define configTIMER_TASK_STACK_DEPTH   ( 128 )\r
-\r
-/* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */\r
-#define INCLUDE_vTaskPrioritySet                   1\r
-#define INCLUDE_uxTaskPriorityGet                  1\r
-#define INCLUDE_vTaskDelete                                0\r
-#define INCLUDE_vTaskCleanUpResources      0\r
-#define INCLUDE_vTaskSuspend                   1\r
-#define INCLUDE_xTaskResumeFromISR          0\r
-#define INCLUDE_vTaskDelayUntil                            1\r
-#define INCLUDE_vTaskDelay                                 1\r
-#define INCLUDE_xTaskGetSchedulerState      1\r
-#define INCLUDE_uxTaskGetStackHighWaterMark 1\r
-\r
-#endif /* FREERTOS_CONFIG_H */\r
diff --git a/FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/os/heap.c b/FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/os/heap.c
deleted file mode 100644 (file)
index 57ad6eb..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-/*\r
-    FreeRTOS V7.2.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
-       \r
-\r
-    ***************************************************************************\r
-     *                                                                       *\r
-     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
-     *    Complete, revised, and edited pdf reference manuals are also       *\r
-     *    available.                                                         *\r
-     *                                                                       *\r
-     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
-     *    ensuring you get running as quickly as possible and with an        *\r
-     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
-     *    the FreeRTOS project to continue with its mission of providing     *\r
-     *    professional grade, cross platform, de facto standard solutions    *\r
-     *    for microcontrollers - completely free of charge!                  *\r
-     *                                                                       *\r
-     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
-     *                                                                       *\r
-     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
-     *                                                                       *\r
-    ***************************************************************************\r
-\r
-\r
-    This file is part of the FreeRTOS distribution.\r
-\r
-    FreeRTOS is free software; you can redistribute it and/or modify it under\r
-    the terms of the GNU General Public License (version 2) as published by the\r
-    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
-    >>>NOTE<<< The modification to the GPL is included to allow you to\r
-    distribute a combined work that includes FreeRTOS without being obliged to\r
-    provide the source code for proprietary components outside of the FreeRTOS\r
-    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
-    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
-    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
-    more details. You should have received a copy of the GNU General Public\r
-    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
-    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
-    by writing to Richard Barry, contact details for whom are available on the\r
-    FreeRTOS WEB site.\r
-\r
-    1 tab == 4 spaces!\r
-    \r
-    ***************************************************************************\r
-     *                                                                       *\r
-     *    Having a problem?  Start by reading the FAQ "My application does   *\r
-     *    not run, what could be wrong?                                      *\r
-     *                                                                       *\r
-     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
-     *                                                                       *\r
-    ***************************************************************************\r
-\r
-    \r
-    http://www.FreeRTOS.org - Documentation, training, latest information, \r
-    license and contact details.\r
-    \r
-    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
-    including FreeRTOS+Trace - an indispensable productivity tool.\r
-\r
-    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
-    the code with commercial support, indemnification, and middleware, under \r
-    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
-    provide a safety engineered and independently SIL3 certified version under \r
-    the SafeRTOS brand: http://www.SafeRTOS.com.\r
-*/\r
-\r
-\r
-/*\r
- * The simplest possible implementation of pvPortMalloc().  Note that this\r
- * implementation does NOT allow allocated memory to be freed again.\r
- *\r
- * See heap_2.c and heap_3.c for alternative implementations, and the memory\r
- * management pages of http://www.FreeRTOS.org for more information.\r
- */\r
-#include <stdlib.h>\r
-\r
-/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining\r
-all the API functions to use the MPU wrappers.  That should only be done when\r
-task.h is included from an application file. */\r
-#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE\r
-\r
-#include "FreeRTOS.h"\r
-#include "task.h"\r
-\r
-#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE\r
-\r
-#pragma DATA_SECTION(xHeap, ".heap")\r
-#pragma DATA_ALIGN(xHeap, 8)\r
-\r
-/* Allocate the memory for the heap.  The struct is used to force byte\r
-alignment without using any non-portable code. */\r
-static union xRTOS_HEAP\r
-{\r
-       unsigned char ucHeap[ configTOTAL_HEAP_SIZE ];\r
-} xHeap;\r
-\r
-static size_t xNextFreeByte = ( size_t ) 0;\r
-\r
-/*-----------------------------------------------------------*/\r
-\r
-void *pvPortMalloc( size_t xWantedSize )\r
-{\r
-void *pvReturn = NULL; \r
-\r
-       /* Ensure that blocks are always aligned to the required number of bytes. */\r
-       #if portBYTE_ALIGNMENT != 1\r
-               if( xWantedSize & portBYTE_ALIGNMENT_MASK )\r
-               {\r
-                       /* Byte alignment required. */\r
-                       xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) );\r
-               }\r
-       #endif\r
-\r
-       vTaskSuspendAll();\r
-       {\r
-               /* Check there is enough room left for the allocation. */\r
-               if( ( ( xNextFreeByte + xWantedSize ) < configTOTAL_HEAP_SIZE ) &&\r
-                       ( ( xNextFreeByte + xWantedSize ) > xNextFreeByte )     )/* Check for overflow. */\r
-               {\r
-                       /* Return the next free byte then increment the index past this\r
-                       block. */\r
-                       pvReturn = &( xHeap.ucHeap[ xNextFreeByte ] );\r
-                       xNextFreeByte += xWantedSize;                   \r
-               }       \r
-       }\r
-       xTaskResumeAll();\r
-       \r
-       #if( configUSE_MALLOC_FAILED_HOOK == 1 )\r
-       {\r
-               if( pvReturn == NULL )\r
-               {\r
-                       extern void vApplicationMallocFailedHook( void );\r
-                       vApplicationMallocFailedHook();\r
-               }\r
-       }\r
-       #endif  \r
-\r
-       return pvReturn;\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-void vPortFree( void *pv )\r
-{\r
-       /* Memory cannot be freed using this scheme.  See heap_2.c and heap_3.c \r
-       for alternative implementations, and the memory management pages of \r
-       http://www.FreeRTOS.org for more information. */\r
-       ( void ) pv;\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-void vPortInitialiseBlocks( void )\r
-{\r
-       /* Only required when static memory is not cleared. */\r
-       xNextFreeByte = ( size_t ) 0;\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-size_t xPortGetFreeHeapSize( void )\r
-{\r
-       return ( configTOTAL_HEAP_SIZE - xNextFreeByte );\r
-}\r
-\r
-\r
-\r
diff --git a/FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/os/heap_4.c b/FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/os/heap_4.c
new file mode 100644 (file)
index 0000000..3210b3c
--- /dev/null
@@ -0,0 +1,357 @@
+/*\r
+    FreeRTOS V7.2.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    Having a problem?  Start by reading the FAQ "My application does   *\r
+     *    not run, what could be wrong?                                      *\r
+     *                                                                       *\r
+     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    http://www.FreeRTOS.org - Documentation, training, latest information,\r
+    license and contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool.\r
+\r
+    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+    the code with commercial support, indemnification, and middleware, under\r
+    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
+    provide a safety engineered and independently SIL3 certified version under\r
+    the SafeRTOS brand: http://www.SafeRTOS.com.\r
+*/\r
+\r
+/*\r
+ * A sample implementation of pvPortMalloc() and vPortFree() that combines \r
+ * (coalescences) adjacent memory blocks as they are freed, and in so doing \r
+ * limits memory fragmentation.\r
+ *\r
+ * See heap_1.c, heap_2.c and heap_3.c for alternative implementations, and the \r
+ * memory management pages of http://www.FreeRTOS.org for more information.\r
+ */\r
+#include <stdlib.h>\r
+\r
+/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining\r
+all the API functions to use the MPU wrappers.  That should only be done when\r
+task.h is included from an application file. */\r
+#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE\r
+\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+\r
+#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE\r
+\r
+/* Block sizes must not get too small. */\r
+#define heapMINIMUM_BLOCK_SIZE ( ( size_t ) ( heapSTRUCT_SIZE * 2 ) )\r
+\r
+/* Allocate the memory for the heap.  The struct is used to force byte\r
+alignment without using any non-portable code. */\r
+static union xRTOS_HEAP\r
+{\r
+       #if portBYTE_ALIGNMENT == 8\r
+               volatile portDOUBLE dDummy;\r
+       #else\r
+               volatile unsigned long ulDummy;\r
+       #endif\r
+       unsigned char ucHeap[ configTOTAL_HEAP_SIZE ];\r
+} xHeap;\r
+\r
+/* Define the linked list structure.  This is used to link free blocks in order\r
+of their memory address. */\r
+typedef struct A_BLOCK_LINK\r
+{\r
+       struct A_BLOCK_LINK *pxNextFreeBlock;   /*<< The next free block in the list. */\r
+       size_t xBlockSize;                                              /*<< The size of the free block. */\r
+} xBlockLink;\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * Inserts a block of memory that is being freed into the correct position in \r
+ * the list of free memory blocks.  The block being freed will be merged with\r
+ * the block in front it and/or the block behind it if the memory blocks are\r
+ * adjacent to each other.\r
+ */\r
+static void prvInsertBlockIntoFreeList( xBlockLink *pxBlockToInsert );\r
+\r
+/*\r
+ * Called automatically to setup the required heap structures the first time\r
+ * pvPortMalloc() is called.\r
+ */\r
+static void prvHeapInit( void );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/* The size of the structure placed at the beginning of each allocated memory\r
+block must by correctly byte aligned. */\r
+static const unsigned short heapSTRUCT_SIZE    = ( sizeof( xBlockLink ) + portBYTE_ALIGNMENT - ( sizeof( xBlockLink ) % portBYTE_ALIGNMENT ) );\r
+\r
+/* Ensure the pxEnd pointer will end up on the correct byte alignment. */\r
+static const size_t xTotalHeapSize = ( ( size_t ) configTOTAL_HEAP_SIZE ) & ( ( size_t ) ~portBYTE_ALIGNMENT_MASK );\r
+\r
+/* Create a couple of list links to mark the start and end of the list. */\r
+static xBlockLink xStart, *pxEnd = NULL;\r
+\r
+/* Keeps track of the number of free bytes remaining, but says nothing about\r
+fragmentation. */\r
+static size_t xFreeBytesRemaining = ( ( size_t ) configTOTAL_HEAP_SIZE ) & ( ( size_t ) ~portBYTE_ALIGNMENT_MASK );\r
+\r
+/* STATIC FUNCTIONS ARE DEFINED AS MACROS TO MINIMIZE THE FUNCTION CALL DEPTH. */\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+void *pvPortMalloc( size_t xWantedSize )\r
+{\r
+xBlockLink *pxBlock, *pxPreviousBlock, *pxNewBlockLink;\r
+void *pvReturn = NULL;\r
+\r
+       vTaskSuspendAll();\r
+       {\r
+               /* If this is the first call to malloc then the heap will require\r
+               initialisation to setup the list of free blocks. */\r
+               if( pxEnd == NULL )\r
+               {\r
+                       prvHeapInit();\r
+               }\r
+\r
+               /* The wanted size is increased so it can contain a xBlockLink\r
+               structure in addition to the requested amount of bytes. */\r
+               if( xWantedSize > 0 )\r
+               {\r
+                       xWantedSize += heapSTRUCT_SIZE;\r
+\r
+                       /* Ensure that blocks are always aligned to the required number of \r
+                       bytes. */\r
+                       if( xWantedSize & portBYTE_ALIGNMENT_MASK )\r
+                       {\r
+                               /* Byte alignment required. */\r
+                               xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) );\r
+                       }\r
+               }\r
+\r
+               if( ( xWantedSize > 0 ) && ( xWantedSize < xTotalHeapSize ) )\r
+               {\r
+                       /* Traverse the list from the start     (lowest address) block until one\r
+                       of adequate size is found. */\r
+                       pxPreviousBlock = &xStart;\r
+                       pxBlock = xStart.pxNextFreeBlock;\r
+                       while( ( pxBlock->xBlockSize < xWantedSize ) && ( pxBlock->pxNextFreeBlock != NULL ) )\r
+                       {\r
+                               pxPreviousBlock = pxBlock;\r
+                               pxBlock = pxBlock->pxNextFreeBlock;\r
+                       }\r
+\r
+                       /* If the end marker was reached then a block of adequate size was\r
+                       not found. */\r
+                       if( pxBlock != pxEnd )\r
+                       {\r
+                               /* Return the memory space - jumping over the xBlockLink structure\r
+                               at its start. */\r
+                               pvReturn = ( void * ) ( ( ( unsigned char * ) pxPreviousBlock->pxNextFreeBlock ) + heapSTRUCT_SIZE );\r
+\r
+                               /* This block is being returned for use so must be taken out of\r
+                               the     list of free blocks. */\r
+                               pxPreviousBlock->pxNextFreeBlock = pxBlock->pxNextFreeBlock;\r
+\r
+                               /* If the block is larger than required it can be split into two. */\r
+                               if( ( pxBlock->xBlockSize - xWantedSize ) > heapMINIMUM_BLOCK_SIZE )\r
+                               {\r
+                                       /* This block is to be split into two.  Create a new block\r
+                                       following the number of bytes requested. The void cast is\r
+                                       used to prevent byte alignment warnings from the compiler. */\r
+                                       pxNewBlockLink = ( void * ) ( ( ( unsigned char * ) pxBlock ) + xWantedSize );\r
+\r
+                                       /* Calculate the sizes of two blocks split from the single\r
+                                       block. */\r
+                                       pxNewBlockLink->xBlockSize = pxBlock->xBlockSize - xWantedSize;\r
+                                       pxBlock->xBlockSize = xWantedSize;\r
+\r
+                                       /* Insert the new block into the list of free blocks. */\r
+                                       prvInsertBlockIntoFreeList( ( pxNewBlockLink ) );\r
+                               }\r
+\r
+                               xFreeBytesRemaining -= pxBlock->xBlockSize;\r
+                       }\r
+               }\r
+       }\r
+       xTaskResumeAll();\r
+\r
+       #if( configUSE_MALLOC_FAILED_HOOK == 1 )\r
+       {\r
+               if( pvReturn == NULL )\r
+               {\r
+                       extern void vApplicationMallocFailedHook( void );\r
+                       vApplicationMallocFailedHook();\r
+               }\r
+       }\r
+       #endif\r
+\r
+       return pvReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vPortFree( void *pv )\r
+{\r
+unsigned char *puc = ( unsigned char * ) pv;\r
+xBlockLink *pxLink;\r
+\r
+       if( pv != NULL )\r
+       {\r
+               /* The memory being freed will have an xBlockLink structure immediately\r
+               before it. */\r
+               puc -= heapSTRUCT_SIZE;\r
+\r
+               /* This casting is to keep the compiler from issuing warnings. */\r
+               pxLink = ( void * ) puc;\r
+\r
+               vTaskSuspendAll();\r
+               {\r
+                       /* Add this block to the list of free blocks. */\r
+                       xFreeBytesRemaining += pxLink->xBlockSize;\r
+                       prvInsertBlockIntoFreeList( ( ( xBlockLink * ) pxLink ) );                      \r
+               }\r
+               xTaskResumeAll();\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+size_t xPortGetFreeHeapSize( void )\r
+{\r
+       return xFreeBytesRemaining;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vPortInitialiseBlocks( void )\r
+{\r
+       /* This just exists to keep the linker quiet. */\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvHeapInit( void )\r
+{\r
+xBlockLink *pxFirstFreeBlock;\r
+unsigned char *pucHeapEnd;\r
+\r
+       /* Ensure the start of the heap is aligned. */\r
+       configASSERT( ( ( ( unsigned long ) xHeap.ucHeap ) & ( ( unsigned long ) portBYTE_ALIGNMENT_MASK ) ) == 0UL );\r
+\r
+       /* xStart is used to hold a pointer to the first item in the list of free\r
+       blocks.  The void cast is used to prevent compiler warnings. */\r
+       xStart.pxNextFreeBlock = ( void * ) xHeap.ucHeap;\r
+       xStart.xBlockSize = ( size_t ) 0;\r
+\r
+       /* pxEnd is used to mark the end of the list of free blocks and is inserted\r
+       at the end of the heap space. */\r
+       pucHeapEnd = xHeap.ucHeap + xTotalHeapSize;\r
+       pucHeapEnd -= heapSTRUCT_SIZE;\r
+       pxEnd = ( void * ) pucHeapEnd;\r
+       configASSERT( ( ( ( unsigned long ) pxEnd ) & ( ( unsigned long ) portBYTE_ALIGNMENT_MASK ) ) == 0UL );\r
+       pxEnd->xBlockSize = 0;\r
+       pxEnd->pxNextFreeBlock = NULL;\r
+\r
+       /* To start with there is a single free block that is sized to take up the\r
+       entire heap space, minus the space taken by pxEnd. */\r
+       pxFirstFreeBlock = ( void * ) xHeap.ucHeap;\r
+       pxFirstFreeBlock->xBlockSize = xTotalHeapSize - heapSTRUCT_SIZE;\r
+       pxFirstFreeBlock->pxNextFreeBlock = pxEnd;\r
+\r
+       /* The heap now contains pxEnd. */\r
+       xFreeBytesRemaining -= heapSTRUCT_SIZE;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvInsertBlockIntoFreeList( xBlockLink *pxBlockToInsert )\r
+{\r
+xBlockLink *pxIterator;\r
+unsigned char *puc;\r
+\r
+       /* Iterate through the list until a block is found that has a higher address\r
+       than the block being inserted. */\r
+       for( pxIterator = &xStart; pxIterator->pxNextFreeBlock < pxBlockToInsert; pxIterator = pxIterator->pxNextFreeBlock )\r
+       {\r
+               /* Nothing to do here, just iterate to the right position. */\r
+       }\r
+\r
+       /* Do the block being inserted, and the block it is being inserted after\r
+       make a contiguous block of memory? */   \r
+       puc = ( unsigned char * ) pxIterator;\r
+       if( ( puc + pxIterator->xBlockSize ) == ( unsigned char * ) pxBlockToInsert )\r
+       {\r
+               pxIterator->xBlockSize += pxBlockToInsert->xBlockSize;\r
+               pxBlockToInsert = pxIterator;\r
+       }\r
+\r
+       /* Do the block being inserted, and the block it is being inserted before\r
+       make a contiguous block of memory? */\r
+       puc = ( unsigned char * ) pxBlockToInsert;\r
+       if( ( puc + pxBlockToInsert->xBlockSize ) == ( unsigned char * ) pxIterator->pxNextFreeBlock )\r
+       {\r
+               if( pxIterator->pxNextFreeBlock != pxEnd )\r
+               {\r
+                       /* Form one big block from the two blocks. */\r
+                       pxBlockToInsert->xBlockSize += pxIterator->pxNextFreeBlock->xBlockSize;\r
+                       pxBlockToInsert->pxNextFreeBlock = pxIterator->pxNextFreeBlock->pxNextFreeBlock;\r
+               }\r
+               else\r
+               {\r
+                       pxBlockToInsert->pxNextFreeBlock = pxEnd;\r
+               }\r
+       }\r
+       else\r
+       {\r
+               pxBlockToInsert->pxNextFreeBlock = pxIterator->pxNextFreeBlock;         \r
+       }\r
+\r
+       /* If the block being inserted plugged a gab, so was merged with the block\r
+       before and the block after, then it's pxNextFreeBlock pointer will have\r
+       already been set, and should not be set here as that would make it point\r
+       to itself. */\r
+       if( pxIterator != pxBlockToInsert )\r
+       {\r
+               pxIterator->pxNextFreeBlock = pxBlockToInsert;\r
+       }\r
+}\r
+\r
index df0674db48553ba4f16401e023674f427e84bbce..d5cb9003a5064dd728b3b61d80f309ac9b04696c 100644 (file)
@@ -34,37 +34,6 @@ void systemInit(void)
                        | (3U << 8U) \r
                        | (1U << 4U) \r
                        |  1U;\r
-#if 0\r
-    /** - Setup flash bank power modes */\r
-    flashWREG->FBFALLBACK = 0x05050000\r
-                          | (SYS_ACTIVE << 14U) \r
-                          | (SYS_SLEEP << 12U) \r
-                          | (SYS_SLEEP << 10U) \r
-                          | (SYS_SLEEP << 8U) \r
-                          | (SYS_SLEEP << 6U) \r
-                          | (SYS_SLEEP << 4U) \r
-                          | (SYS_ACTIVE << 2U) \r
-                          |  SYS_ACTIVE;\r
-\r
-    /** @b Initialize @b Lpo: */\r
-\r
-    {\r
-        unsigned trim = *(volatile unsigned short *)0xF00801B4;\r
-        \r
-        if (trim != 0xFFFF)\r
-        {\r
-            systemREG1->LPOMONCTL = (1U << 24U) \r
-                                  | (0U << 16U) \r
-                                  | trim; \r
-        }\r
-        else\r
-        {\r
-            systemREG1->LPOMONCTL = (1U << 24U) \r
-                                  | (0U << 16U) \r
-                                  | (systemREG1->LPOMONCTL & 0xFFFF);\r
-        }\r
-    }\r
-#endif\r
     /** @b Initialize @b Pll: */\r
 \r
     /** - Setup pll control register 1:\r
index b0cbe9107ea9d7faa97e68e05dc2619a41de9a90..fde1029843a5c85f35e433947d4be87e14405c99 100644 (file)
@@ -166,7 +166,7 @@ typedef volatile struct systemBase1
     unsigned BMMCR1;                 /* 0x00C4 */\r
     unsigned BMMCR2;                 /* 0x00C8 */\r
     unsigned MMUGCR;                 /* 0x00CC */\r
-#ifdef _little_endian__\r
+#ifdef __little_endian__\r
     unsigned        : 8U;            /* 0x00D0 */\r
     unsigned PENA   : 1U;            /* 0x00D0 */\r
     unsigned        : 7U;            /* 0x00D0 */\r