]> git.sur5r.net Git - freertos/commitdiff
Update GCC/Eclipse Win32 simulator port to make better use of Eclipse resource filter...
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 19 Dec 2013 13:40:37 +0000 (13:40 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 19 Dec 2013 13:40:37 +0000 (13:40 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2135 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

12 files changed:
FreeRTOS/Demo/WIN32-MingW/.cproject
FreeRTOS/Demo/WIN32-MingW/.project
FreeRTOS/Demo/WIN32-MingW/.settings/org.eclipse.cdt.managedbuilder.core.prefs
FreeRTOS/Demo/WIN32-MingW/CreateProjectDirectoryStructure.bat [deleted file]
FreeRTOS/Demo/WIN32-MingW/DemosModifiedForLowTickRate/recmutex.c
FreeRTOS/Demo/WIN32-MingW/FreeRTOSConfig.h
FreeRTOS/Demo/WIN32-MingW/Run-time-stats-utils.c [new file with mode: 0644]
FreeRTOS/Demo/WIN32-MingW/Trace_Recorder_Configuration/trcConfig.h [new file with mode: 0644]
FreeRTOS/Demo/WIN32-MingW/Trace_Recorder_Configuration/trcHardwarePort.h [new file with mode: 0644]
FreeRTOS/Demo/WIN32-MingW/main.c
FreeRTOS/Demo/WIN32-MingW/main_blinky.c [new file with mode: 0644]
FreeRTOS/Demo/WIN32-MingW/main_full.c [new file with mode: 0644]

index 4d41c2f226f885332ddb8a6ce7a76de1e97bfd70..04ec5c3bcc50e6e7fa8981d7e6bf9d229af75423 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
 <?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">\r
        <storageModule moduleId="org.eclipse.cdt.core.settings">\r
-               <cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.debug.184448914">\r
-                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.184448914" moduleId="org.eclipse.cdt.core.settings" name="Debug">\r
+               <cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239">\r
+                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239" moduleId="org.eclipse.cdt.core.settings" name="Debug">\r
                                <externalSettings/>\r
                                <extensions>\r
                                        <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
                                </extensions>\r
                        </storageModule>\r
                        <storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
-                               <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.debug.184448914" name="Debug" parent="cdt.managedbuild.config.gnu.mingw.exe.debug">\r
-                                       <folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.debug.184448914." name="/" resourcePath="">\r
-                                               <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.debug.1251700323" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.debug">\r
-                                                       <targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.exe.debug.1689770801" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.debug"/>\r
-                                                       <builder buildPath="${workspace_loc:/RTOSDemo/Debug}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.1580550423" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>\r
-                                                       <tool id="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug.740677468" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug">\r
-                                                               <option id="gnu.both.asm.option.include.paths.1735905904" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths"/>\r
-                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.947159880" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>\r
+                               <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239" name="Debug" parent="cdt.managedbuild.config.gnu.mingw.exe.debug">\r
+                                       <folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239." name="/" resourcePath="">\r
+                                               <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.debug.1619684599" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.debug">\r
+                                                       <targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.exe.debug.1827277435" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.debug"/>\r
+                                                       <builder buildPath="${workspace_loc:/RTOSDemo}/Debug" enableCleanBuild="true" enabledIncrementalBuild="true" id="cdt.managedbuild.tool.gnu.builder.mingw.base.685662364" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>\r
+                                                       <tool id="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug.2050893079" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug">\r
+                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1919405451" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>\r
                                                        </tool>\r
-                                                       <tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.1486414422" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>\r
-                                                       <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.1702673982" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug">\r
-                                                               <option id="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level.1113935807" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>\r
-                                                               <option id="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level.1377100001" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>\r
+                                                       <tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.867063893" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>\r
+                                                       <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.1190873987" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug">\r
+                                                               <option id="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level.40398864" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>\r
+                                                               <option id="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level.375002745" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>\r
                                                        </tool>\r
-                                                       <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.717220069" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug">\r
-                                                               <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.exe.debug.option.optimization.level.1441629807" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.debug.option.optimization.level" valueType="enumerated"/>\r
-                                                               <option id="gnu.c.compiler.mingw.exe.debug.option.debugging.level.368869681" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>\r
-                                                               <option id="gnu.c.compiler.option.include.paths.1213993982" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">\r
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS/include}&quot;"/>\r
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/DemoTasks/include}&quot;"/>\r
+                                                       <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1285167012" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug">\r
+                                                               <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.exe.debug.option.optimization.level.426701341" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.debug.option.optimization.level" value="gnu.c.optimization.level.none" valueType="enumerated"/>\r
+                                                               <option id="gnu.c.compiler.mingw.exe.debug.option.debugging.level.514946732" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>\r
+                                                               <option id="gnu.c.compiler.option.include.paths.1474487302" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Source/include}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS+Trace Recorder/Include}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Trace_Recorder_Configuration}&quot;"/>\r
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>\r
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS/portable/MSVC-MingW}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Standard_Demo_Tasks/Include}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Source/portable/MSVC-MingW}&quot;"/>\r
                                                                </option>\r
-                                                               <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.725671600" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>\r
+                                                               <option id="gnu.c.compiler.option.debugging.prof.53374762" name="Generate prof information (-p)" superClass="gnu.c.compiler.option.debugging.prof" value="false" valueType="boolean"/>\r
+                                                               <option id="gnu.c.compiler.option.warnings.extrawarn.1804262134" name="Extra warnings (-Wextra)" superClass="gnu.c.compiler.option.warnings.extrawarn" value="true" valueType="boolean"/>\r
+                                                               <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.974248912" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>\r
                                                        </tool>\r
-                                                       <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.1731687826" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug">\r
-                                                               <option id="gnu.c.link.option.libs.646947964" superClass="gnu.c.link.option.libs" valueType="libs">\r
-                                                                       <listOptionValue builtIn="false" value="Winmm"/>\r
+                                                       <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.2080839343" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug">\r
+                                                               <option id="gnu.c.link.option.ldflags.1005037398" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="" valueType="string"/>\r
+                                                               <option id="gnu.c.link.option.libs.709505970" name="Libraries (-l)" superClass="gnu.c.link.option.libs" valueType="libs">\r
+                                                                       <listOptionValue builtIn="false" value="winmm"/>\r
                                                                </option>\r
-                                                               <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.305720568" superClass="cdt.managedbuild.tool.gnu.c.linker.input">\r
+                                                               <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1912714899" superClass="cdt.managedbuild.tool.gnu.c.linker.input">\r
                                                                        <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>\r
                                                                        <additionalInput kind="additionalinput" paths="$(LIBS)"/>\r
                                                                </inputType>\r
                                                        </tool>\r
-                                                       <tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug.1825251027" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug"/>\r
+                                                       <tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug.500696043" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug"/>\r
                                                </toolChain>\r
                                        </folderInfo>\r
+                                       <sourceEntries>\r
+                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>\r
+                                       </sourceEntries>\r
                                </configuration>\r
                        </storageModule>\r
                        <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>\r
-                       <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>\r
                </cconfiguration>\r
        </storageModule>\r
        <storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
-               <project id="RTOSDemo.cdt.managedbuild.target.gnu.mingw.exe.1011353064" name="Executable" projectType="cdt.managedbuild.target.gnu.mingw.exe"/>\r
+               <project id="RTOSDemo.cdt.managedbuild.target.gnu.mingw.exe.393672054" name="Executable" projectType="cdt.managedbuild.target.gnu.mingw.exe"/>\r
        </storageModule>\r
        <storageModule moduleId="scannerConfiguration">\r
                <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>\r
-               <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">\r
-                       <buildOutputProvider>\r
-                               <openAction enabled="true" filePath=""/>\r
-                               <parser enabled="true"/>\r
-                       </buildOutputProvider>\r
-                       <scannerInfoProvider id="specsFile">\r
-                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                               <parser enabled="true"/>\r
-                       </scannerInfoProvider>\r
-               </profile>\r
-               <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">\r
-                       <buildOutputProvider>\r
-                               <openAction enabled="true" filePath=""/>\r
-                               <parser enabled="true"/>\r
-                       </buildOutputProvider>\r
-                       <scannerInfoProvider id="makefileGenerator">\r
-                               <runAction arguments="-E -P -v -dD" command="" useDefault="true"/>\r
-                               <parser enabled="true"/>\r
-                       </scannerInfoProvider>\r
-               </profile>\r
-               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">\r
-                       <buildOutputProvider>\r
-                               <openAction enabled="true" filePath=""/>\r
-                               <parser enabled="true"/>\r
-                       </buildOutputProvider>\r
-                       <scannerInfoProvider id="specsFile">\r
-                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                               <parser enabled="true"/>\r
-                       </scannerInfoProvider>\r
-               </profile>\r
-               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">\r
-                       <buildOutputProvider>\r
-                               <openAction enabled="true" filePath=""/>\r
-                               <parser enabled="true"/>\r
-                       </buildOutputProvider>\r
-                       <scannerInfoProvider id="specsFile">\r
-                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                               <parser enabled="true"/>\r
-                       </scannerInfoProvider>\r
-               </profile>\r
-               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">\r
-                       <buildOutputProvider>\r
-                               <openAction enabled="true" filePath=""/>\r
-                               <parser enabled="true"/>\r
-                       </buildOutputProvider>\r
-                       <scannerInfoProvider id="specsFile">\r
-                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                               <parser enabled="true"/>\r
-                       </scannerInfoProvider>\r
-               </profile>\r
-               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">\r
-                       <buildOutputProvider>\r
-                               <openAction enabled="true" filePath=""/>\r
-                               <parser enabled="true"/>\r
-                       </buildOutputProvider>\r
-                       <scannerInfoProvider id="specsFile">\r
-                               <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>\r
-                               <parser enabled="true"/>\r
-                       </scannerInfoProvider>\r
-               </profile>\r
-               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">\r
-                       <buildOutputProvider>\r
-                               <openAction enabled="true" filePath=""/>\r
-                               <parser enabled="true"/>\r
-                       </buildOutputProvider>\r
-                       <scannerInfoProvider id="specsFile">\r
-                               <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>\r
-                               <parser enabled="true"/>\r
-                       </scannerInfoProvider>\r
-               </profile>\r
-               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">\r
-                       <buildOutputProvider>\r
-                               <openAction enabled="true" filePath=""/>\r
-                               <parser enabled="true"/>\r
-                       </buildOutputProvider>\r
-                       <scannerInfoProvider id="specsFile">\r
-                               <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>\r
-                               <parser enabled="true"/>\r
-                       </scannerInfoProvider>\r
-               </profile>\r
-               <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.release.2058019519;cdt.managedbuild.config.gnu.mingw.exe.release.2058019519.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.1403225577;cdt.managedbuild.tool.gnu.c.compiler.input.42137551">\r
-                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>\r
-                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">\r
-                               <buildOutputProvider>\r
-                                       <openAction enabled="true" filePath=""/>\r
-                                       <parser enabled="true"/>\r
-                               </buildOutputProvider>\r
-                               <scannerInfoProvider id="specsFile">\r
-                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                       <parser enabled="true"/>\r
-                               </scannerInfoProvider>\r
-                       </profile>\r
-                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">\r
-                               <buildOutputProvider>\r
-                                       <openAction enabled="true" filePath=""/>\r
-                                       <parser enabled="true"/>\r
-                               </buildOutputProvider>\r
-                               <scannerInfoProvider id="makefileGenerator">\r
-                                       <runAction arguments="-E -P -v -dD" command="" useDefault="true"/>\r
-                                       <parser enabled="true"/>\r
-                               </scannerInfoProvider>\r
-                       </profile>\r
-                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">\r
-                               <buildOutputProvider>\r
-                                       <openAction enabled="true" filePath=""/>\r
-                                       <parser enabled="true"/>\r
-                               </buildOutputProvider>\r
-                               <scannerInfoProvider id="specsFile">\r
-                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                       <parser enabled="true"/>\r
-                               </scannerInfoProvider>\r
-                       </profile>\r
-                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">\r
-                               <buildOutputProvider>\r
-                                       <openAction enabled="true" filePath=""/>\r
-                                       <parser enabled="true"/>\r
-                               </buildOutputProvider>\r
-                               <scannerInfoProvider id="specsFile">\r
-                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                       <parser enabled="true"/>\r
-                               </scannerInfoProvider>\r
-                       </profile>\r
-                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">\r
-                               <buildOutputProvider>\r
-                                       <openAction enabled="true" filePath=""/>\r
-                                       <parser enabled="true"/>\r
-                               </buildOutputProvider>\r
-                               <scannerInfoProvider id="specsFile">\r
-                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                       <parser enabled="true"/>\r
-                               </scannerInfoProvider>\r
-                       </profile>\r
-                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">\r
-                               <buildOutputProvider>\r
-                                       <openAction enabled="true" filePath=""/>\r
-                                       <parser enabled="true"/>\r
-                               </buildOutputProvider>\r
-                               <scannerInfoProvider id="specsFile">\r
-                                       <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>\r
-                                       <parser enabled="true"/>\r
-                               </scannerInfoProvider>\r
-                       </profile>\r
-                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">\r
-                               <buildOutputProvider>\r
-                                       <openAction enabled="true" filePath=""/>\r
-                                       <parser enabled="true"/>\r
-                               </buildOutputProvider>\r
-                               <scannerInfoProvider id="specsFile">\r
-                                       <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>\r
-                                       <parser enabled="true"/>\r
-                               </scannerInfoProvider>\r
-                       </profile>\r
-                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">\r
-                               <buildOutputProvider>\r
-                                       <openAction enabled="true" filePath=""/>\r
-                                       <parser enabled="true"/>\r
-                               </buildOutputProvider>\r
-                               <scannerInfoProvider id="specsFile">\r
-                                       <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>\r
-                                       <parser enabled="true"/>\r
-                               </scannerInfoProvider>\r
-                       </profile>\r
-               </scannerConfigBuildInfo>\r
-               <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.184448914;cdt.managedbuild.config.gnu.mingw.exe.debug.184448914.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.717220069;cdt.managedbuild.tool.gnu.c.compiler.input.725671600">\r
-                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>\r
-                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">\r
-                               <buildOutputProvider>\r
-                                       <openAction enabled="true" filePath=""/>\r
-                                       <parser enabled="true"/>\r
-                               </buildOutputProvider>\r
-                               <scannerInfoProvider id="specsFile">\r
-                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                       <parser enabled="true"/>\r
-                               </scannerInfoProvider>\r
-                       </profile>\r
-                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">\r
-                               <buildOutputProvider>\r
-                                       <openAction enabled="true" filePath=""/>\r
-                                       <parser enabled="true"/>\r
-                               </buildOutputProvider>\r
-                               <scannerInfoProvider id="makefileGenerator">\r
-                                       <runAction arguments="-E -P -v -dD" command="" useDefault="true"/>\r
-                                       <parser enabled="true"/>\r
-                               </scannerInfoProvider>\r
-                       </profile>\r
-                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">\r
-                               <buildOutputProvider>\r
-                                       <openAction enabled="true" filePath=""/>\r
-                                       <parser enabled="true"/>\r
-                               </buildOutputProvider>\r
-                               <scannerInfoProvider id="specsFile">\r
-                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                       <parser enabled="true"/>\r
-                               </scannerInfoProvider>\r
-                       </profile>\r
-                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">\r
-                               <buildOutputProvider>\r
-                                       <openAction enabled="true" filePath=""/>\r
-                                       <parser enabled="true"/>\r
-                               </buildOutputProvider>\r
-                               <scannerInfoProvider id="specsFile">\r
-                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                       <parser enabled="true"/>\r
-                               </scannerInfoProvider>\r
-                       </profile>\r
-                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">\r
-                               <buildOutputProvider>\r
-                                       <openAction enabled="true" filePath=""/>\r
-                                       <parser enabled="true"/>\r
-                               </buildOutputProvider>\r
-                               <scannerInfoProvider id="specsFile">\r
-                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                       <parser enabled="true"/>\r
-                               </scannerInfoProvider>\r
-                       </profile>\r
-                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">\r
-                               <buildOutputProvider>\r
-                                       <openAction enabled="true" filePath=""/>\r
-                                       <parser enabled="true"/>\r
-                               </buildOutputProvider>\r
-                               <scannerInfoProvider id="specsFile">\r
-                                       <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>\r
-                                       <parser enabled="true"/>\r
-                               </scannerInfoProvider>\r
-                       </profile>\r
-                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">\r
-                               <buildOutputProvider>\r
-                                       <openAction enabled="true" filePath=""/>\r
-                                       <parser enabled="true"/>\r
-                               </buildOutputProvider>\r
-                               <scannerInfoProvider id="specsFile">\r
-                                       <runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>\r
-                                       <parser enabled="true"/>\r
-                               </scannerInfoProvider>\r
-                       </profile>\r
-                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">\r
-                               <buildOutputProvider>\r
-                                       <openAction enabled="true" filePath=""/>\r
-                                       <parser enabled="true"/>\r
-                               </buildOutputProvider>\r
-                               <scannerInfoProvider id="specsFile">\r
-                                       <runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>\r
-                                       <parser enabled="true"/>\r
-                               </scannerInfoProvider>\r
-                       </profile>\r
+               <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239;cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1285167012;cdt.managedbuild.tool.gnu.c.compiler.input.974248912">\r
+                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>\r
                </scannerConfigBuildInfo>\r
        </storageModule>\r
        <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>\r
-       <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>\r
+       <storageModule moduleId="refreshScope" versionNumber="2">\r
+               <configuration configurationName="Debug">\r
+                       <resource resourceType="PROJECT" workspacePath="/RTOSDemo"/>\r
+               </configuration>\r
+       </storageModule>\r
 </cproject>\r
index 3533b8343974530c43009e9693b054f162b382a6..4d3dee903ee298da868f94607b91fb64ac3b1c1d 100644 (file)
@@ -9,50 +9,6 @@
                        <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>\r
                        <triggers>clean,full,incremental,</triggers>\r
                        <arguments>\r
-                               <dictionary>\r
-                                       <key>?name?</key>\r
-                                       <value></value>\r
-                               </dictionary>\r
-                               <dictionary>\r
-                                       <key>org.eclipse.cdt.make.core.append_environment</key>\r
-                                       <value>true</value>\r
-                               </dictionary>\r
-                               <dictionary>\r
-                                       <key>org.eclipse.cdt.make.core.buildArguments</key>\r
-                                       <value></value>\r
-                               </dictionary>\r
-                               <dictionary>\r
-                                       <key>org.eclipse.cdt.make.core.buildCommand</key>\r
-                                       <value>make</value>\r
-                               </dictionary>\r
-                               <dictionary>\r
-                                       <key>org.eclipse.cdt.make.core.buildLocation</key>\r
-                                       <value>${workspace_loc:/RTOSDemo/Debug}</value>\r
-                               </dictionary>\r
-                               <dictionary>\r
-                                       <key>org.eclipse.cdt.make.core.contents</key>\r
-                                       <value>org.eclipse.cdt.make.core.activeConfigSettings</value>\r
-                               </dictionary>\r
-                               <dictionary>\r
-                                       <key>org.eclipse.cdt.make.core.enableAutoBuild</key>\r
-                                       <value>false</value>\r
-                               </dictionary>\r
-                               <dictionary>\r
-                                       <key>org.eclipse.cdt.make.core.enableCleanBuild</key>\r
-                                       <value>true</value>\r
-                               </dictionary>\r
-                               <dictionary>\r
-                                       <key>org.eclipse.cdt.make.core.enableFullBuild</key>\r
-                                       <value>true</value>\r
-                               </dictionary>\r
-                               <dictionary>\r
-                                       <key>org.eclipse.cdt.make.core.stopOnError</key>\r
-                                       <value>true</value>\r
-                               </dictionary>\r
-                               <dictionary>\r
-                                       <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>\r
-                                       <value>true</value>\r
-                               </dictionary>\r
                        </arguments>\r
                </buildCommand>\r
                <buildCommand>\r
                <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>\r
                <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>\r
        </natures>\r
+       <linkedResources>\r
+               <link>\r
+                       <name>FreeRTOS+Trace Recorder</name>\r
+                       <type>2</type>\r
+                       <locationURI>FREERTOS_ROOT/FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>FreeRTOS_Source</name>\r
+                       <type>2</type>\r
+                       <locationURI>FREERTOS_ROOT/FreeRTOS/Source</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>Standard_Demo_Tasks</name>\r
+                       <type>2</type>\r
+                       <locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/Minimal</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>Standard_Demo_Tasks/Include</name>\r
+                       <type>2</type>\r
+                       <locationURI>FREERTOS_ROOT/FreeRTOS/Demo/Common/include</locationURI>\r
+               </link>\r
+       </linkedResources>\r
+       <filteredResources>\r
+               <filter>\r
+                       <id>1387372952208</id>\r
+                       <name>FreeRTOS+Trace Recorder</name>\r
+                       <type>10</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-ConfigurationTemplate</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>0</id>\r
+                       <name>Standard_Demo_Tasks</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-BlockQ.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>0</id>\r
+                       <name>Standard_Demo_Tasks</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-blocktim.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>0</id>\r
+                       <name>Standard_Demo_Tasks</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-countsem.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>0</id>\r
+                       <name>Standard_Demo_Tasks</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-death.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>0</id>\r
+                       <name>Standard_Demo_Tasks</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-dynamic.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>0</id>\r
+                       <name>Standard_Demo_Tasks</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-EventGroupsDemo.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>0</id>\r
+                       <name>Standard_Demo_Tasks</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-flop.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>0</id>\r
+                       <name>Standard_Demo_Tasks</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-GenQTest.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>0</id>\r
+                       <name>Standard_Demo_Tasks</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-Integer.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>0</id>\r
+                       <name>Standard_Demo_Tasks</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-PollQ.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>0</id>\r
+                       <name>Standard_Demo_Tasks</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-QPeek.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>0</id>\r
+                       <name>Standard_Demo_Tasks</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-QueueOverwrite.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>0</id>\r
+                       <name>Standard_Demo_Tasks</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-QueueSet.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>0</id>\r
+                       <name>Standard_Demo_Tasks</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-semtest.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>0</id>\r
+                       <name>Standard_Demo_Tasks</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-timerdemo.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>0</id>\r
+                       <name>FreeRTOS_Source/portable</name>\r
+                       <type>9</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-MSVC-MingW</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>0</id>\r
+                       <name>FreeRTOS_Source/portable</name>\r
+                       <type>9</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-MemMang</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>0</id>\r
+                       <name>FreeRTOS_Source/portable/MemMang</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-heap_4.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+       </filteredResources>\r
+       <variableList>\r
+               <variable>\r
+                       <name>FREERTOS_ROOT</name>\r
+                       <value>$%7BPARENT-3-PROJECT_LOC%7D</value>\r
+               </variable>\r
+       </variableList>\r
 </projectDescription>\r
index 1e00b815724ad218dfa1b737b9f605a6f5166cd3..a36a155945df0b3660c52ac64de650649b23df0a 100644 (file)
@@ -1,12 +1,11 @@
-#Sun Nov 21 18:36:02 GMT 2010\r
 eclipse.preferences.version=1\r
-environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.184448914/CPATH/delimiter=;\r
-environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.184448914/CPATH/operation=remove\r
-environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.184448914/C_INCLUDE_PATH/delimiter=;\r
-environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.184448914/C_INCLUDE_PATH/operation=remove\r
-environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.184448914/append=true\r
-environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.184448914/appendContributed=true\r
-environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.184448914/LIBRARY_PATH/delimiter=;\r
-environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.184448914/LIBRARY_PATH/operation=remove\r
-environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.184448914/append=true\r
-environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.184448914/appendContributed=true\r
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239/CPATH/delimiter=;\r
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239/CPATH/operation=remove\r
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239/C_INCLUDE_PATH/delimiter=;\r
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239/C_INCLUDE_PATH/operation=remove\r
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239/append=true\r
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239/appendContributed=true\r
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239/LIBRARY_PATH/delimiter=;\r
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239/LIBRARY_PATH/operation=remove\r
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239/append=true\r
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.396692239/appendContributed=true\r
diff --git a/FreeRTOS/Demo/WIN32-MingW/CreateProjectDirectoryStructure.bat b/FreeRTOS/Demo/WIN32-MingW/CreateProjectDirectoryStructure.bat
deleted file mode 100644 (file)
index a1986dc..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-REM This file should be executed from the command line prior to the first\r
-REM build.  It will be necessary to refresh the Eclipse project once the\r
-REM .bat file has been executed (normally just press F5 to refresh).\r
-\r
-REM Copies all the required files from their location within the standard\r
-REM FreeRTOS directory structure to under the Eclipse project directory.\r
-REM This permits the Eclipse project to be used in 'managed' mode and without\r
-REM having to setup any linked resources.\r
-\r
-REM Have the files already been copied?\r
-IF EXIST FreeRTOS Goto END\r
-\r
-       REM Create the required directory structure.\r
-       MD FreeRTOS\r
-       MD FreeRTOS\include\r
-       MD FreeRTOS\portable\r
-       MD FreeRTOS\portable\MSVC-MingW\r
-       MD FreeRTOS\portable\MemMang\r
-       MD DemoTasks\r
-       MD DemoTasks\include\r
-       \r
-       REM Copy the core kernel files.\r
-       copy ..\..\Source\tasks.c FreeRTOS\r
-       copy ..\..\Source\queue.c FreeRTOS\r
-       copy ..\..\Source\list.c FreeRTOS\r
-       \r
-       REM Copy the common header files\r
-\r
-       copy ..\..\Source\include\*.* FreeRTOS\include\r
-       \r
-       REM Copy the portable layer files\r
-       copy ..\..\Source\portable\MSVC-MingW\*.* FreeRTOS\portable\MSVC-MingW\r
-       \r
-       REM Copy the basic memory allocation files\r
-       copy ..\..\Source\portable\MemMang\heap_3.c FreeRTOS\portable\MemMang\r
-\r
-       REM Copy the common demo files that are used by this demo\r
-       copy ..\Common\include\BlockQ.h DemoTasks\include\r
-       copy ..\Common\include\integer.h DemoTasks\include\r
-       copy ..\Common\include\semtest.h DemoTasks\include\r
-       copy ..\Common\include\PollQ.h DemoTasks\include\r
-       copy ..\Common\include\GenQTest.h DemoTasks\include\r
-       copy ..\Common\include\QPeek.h DemoTasks\include\r
-       copy ..\Common\include\flop.h DemoTasks\include\r
-       copy ..\Common\include\recmutex.h DemoTasks\include\r
-       copy ..\Common\Minimal\BlockQ.c DemoTasks\r
-       copy ..\Common\Minimal\integer.c DemoTasks\r
-       copy ..\Common\Minimal\semtest.c DemoTasks\r
-       copy ..\Common\Minimal\PollQ.c DemoTasks\r
-       copy ..\Common\Minimal\GenQTest.c DemoTasks\r
-       copy ..\Common\Minimal\QPeek.c DemoTasks\r
-       copy ..\Common\Minimal\flop.c DemoTasks\r
-       \r
-: END
\ No newline at end of file
index ec904707f569fd12ff6c1c887ff13de4bc37d037..67a6cb42325037dc91cd5f61b2c8351b0290c11b 100644 (file)
@@ -137,7 +137,7 @@ static volatile unsigned portBASE_TYPE uxControllingCycles = 0, uxBlockingCycles
 \r
 /* Handles of the two higher priority tasks, required so they can be resumed \r
 (unsuspended). */\r
-static xTaskHandle xControllingTaskHandle, xBlockingTaskHandle;\r
+static xTaskHandle xControllingTaskHandle, xBlockingTaskHandle, xPollingTaskHandle;\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
@@ -160,7 +160,7 @@ void vStartRecursiveMutexTasks( void )
        {\r
                xTaskCreate( prvRecursiveMutexControllingTask, ( signed portCHAR * ) "Rec1Ctrl", configMINIMAL_STACK_SIZE, NULL, recmuCONTROLLING_TASK_PRIORITY, &xControllingTaskHandle );\r
         xTaskCreate( prvRecursiveMutexBlockingTask, ( signed portCHAR * ) "Rec2Blck", configMINIMAL_STACK_SIZE, NULL, recmuBLOCKING_TASK_PRIORITY, &xBlockingTaskHandle );\r
-        xTaskCreate( prvRecursiveMutexPollingTask, ( signed portCHAR * ) "Rec3Poll", configMINIMAL_STACK_SIZE, NULL, recmuPOLLING_TASK_PRIORITY, NULL );\r
+        xTaskCreate( prvRecursiveMutexPollingTask, ( signed portCHAR * ) "Rec3Poll", configMINIMAL_STACK_SIZE, NULL, recmuPOLLING_TASK_PRIORITY, &xPollingTaskHandle );\r
        }\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -223,6 +223,10 @@ unsigned portBASE_TYPE ux;
                        {\r
                                xErrorOccurred = pdTRUE;\r
                        }\r
+\r
+                       #if configUSE_PREEMPTION == 0\r
+                               taskYIELD();\r
+                       #endif\r
                }\r
 \r
                /* Having given it back the same number of times as it was taken, we\r
@@ -329,10 +333,17 @@ static void prvRecursiveMutexPollingTask( void *pvParameters )
                                block indefinitely when it attempts to obtain the mutex, the\r
                                Controlling task will only block for a fixed period and an\r
                                error will be latched if the polling task has not returned the\r
-                               mutex by the time this fixed period has expired. */\r
+                               mutex by the time this fixed period has expired. */                             \r
                                vTaskResume( xBlockingTaskHandle );\r
-                vTaskResume( xControllingTaskHandle );\r
-                       \r
+                               #if configUSE_PREEMPTION == 0\r
+                                       taskYIELD();\r
+                               #endif\r
+\r
+                               vTaskResume( xControllingTaskHandle );\r
+                               #if configUSE_PREEMPTION == 0\r
+                                       taskYIELD();\r
+                               #endif\r
+\r
                                /* The other two tasks should now have executed and no longer\r
                                be suspended. */\r
                                if( ( xBlockingIsSuspended == pdTRUE ) || ( xControllingIsSuspended == pdTRUE ) )\r
@@ -345,6 +356,10 @@ static void prvRecursiveMutexPollingTask( void *pvParameters )
                                {\r
                                        xErrorOccurred = pdTRUE;\r
                                }\r
+\r
+                               #if configUSE_PREEMPTION == 0\r
+                                       taskYIELD();\r
+                               #endif\r
                        }\r
                }\r
 \r
index ee2738b401de5d0eab5331aa0ea899aa2fa7430b..0cb8c98264b57877136b8e1e696d9d8d32ba2b52 100644 (file)
 #ifndef FREERTOS_CONFIG_H\r
 #define FREERTOS_CONFIG_H\r
 \r
-/* \r
- * The following #error directive is to remind users that a batch file must be\r
- * executed prior to this project being built.  The batch file *cannot* be \r
- * executed from within the IDE!  Once it has been executed, re-open or refresh \r
- * the Eclipse project and remove the #error line below.\r
- */\r
-#error Ensure CreateProjectDirectoryStructure.bat has been executed before building.  See comment immediately above.\r
+#include <stdint.h>\r
 \r
 /*-----------------------------------------------------------\r
  * Application specific definitions.\r
 \r
 #define configUSE_PREEMPTION                   1\r
 #define configUSE_IDLE_HOOK                            1\r
-#define configUSE_TICK_HOOK                            0\r
-#define configTICK_RATE_HZ                             ( 1000 ) /* Note true real time behaviour cannot be achieved in this simulated environment. */\r
-#define configMINIMAL_STACK_SIZE               ( ( unsigned portSHORT ) 20 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the win32 thread. */\r
-#define configTOTAL_HEAP_SIZE                  ( ( size_t ) 0 ) /* This parameter has no effect when heap_3.c is included in the project. */\r
+#define configUSE_TICK_HOOK                            1\r
+#define configTICK_RATE_HZ                             ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */\r
+#define configMINIMAL_STACK_SIZE               ( ( unsigned short ) 50 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the win32 thread. */\r
+#define configTOTAL_HEAP_SIZE                  ( ( size_t ) ( 20 * 1024 ) )\r
 #define configMAX_TASK_NAME_LEN                        ( 12 )\r
 #define configUSE_TRACE_FACILITY               1\r
 #define configUSE_16_BIT_TICKS                 0\r
 #define configIDLE_SHOULD_YIELD                        1\r
-#define configUSE_CO_ROUTINES                  0\r
 #define configUSE_MUTEXES                              1\r
-#define configGENERATE_RUN_TIME_STATS  0\r
 #define configCHECK_FOR_STACK_OVERFLOW 0\r
 #define configUSE_RECURSIVE_MUTEXES            1\r
-#define configQUEUE_REGISTRY_SIZE              0\r
+#define configQUEUE_REGISTRY_SIZE              20\r
 #define configUSE_MALLOC_FAILED_HOOK   1\r
-#define configUSE_APPLICATION_TASK_TAG 0\r
+#define configUSE_APPLICATION_TASK_TAG 1\r
+#define configUSE_COUNTING_SEMAPHORES  1\r
+#define configUSE_ALTERNATIVE_API              1\r
+#define configUSE_QUEUE_SETS                   1\r
 \r
-#define configMAX_PRIORITIES                   ( ( unsigned portBASE_TYPE ) 7 )\r
-#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
+#define configUSE_TIMERS                               1\r
+#define configTIMER_TASK_PRIORITY              2\r
+#define configTIMER_QUEUE_LENGTH               20\r
+#define configTIMER_TASK_STACK_DEPTH   ( configMINIMAL_STACK_SIZE * 2 )\r
+\r
+#define configMAX_PRIORITIES                   ( 7 )\r
 \r
+/* Run time stats gathering definitions. */\r
+unsigned long ulGetRunTimeCounterValue( void );\r
+void vConfigureTimerForRunTimeStats( void );\r
+#define configGENERATE_RUN_TIME_STATS  1\r
+#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats()\r
+#define portGET_RUN_TIME_COUNTER_VALUE() ulGetRunTimeCounterValue()\r
 \r
 /* Co-routine definitions. */\r
-#define configUSE_CO_ROUTINES          0\r
+#define configUSE_CO_ROUTINES          1\r
 #define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
 \r
 /* Set the following definitions to 1 to include the API function, or zero\r
 to exclude the API function. */\r
 \r
-#define INCLUDE_vTaskPrioritySet                       1\r
-#define INCLUDE_uxTaskPriorityGet                      1\r
-#define INCLUDE_vTaskDelete                                    1\r
-#define INCLUDE_vTaskCleanUpResources          0\r
-#define INCLUDE_vTaskSuspend                           1\r
-#define INCLUDE_vTaskDelayUntil                                1\r
-#define INCLUDE_vTaskDelay                                     1\r
-#define INCLUDE_uxTaskGetStackHighWaterMark    1\r
-#define INCLUDE_xTaskGetSchedulerState         1\r
-\r
+#define INCLUDE_vTaskPrioritySet                               1\r
+#define INCLUDE_uxTaskPriorityGet                              1\r
+#define INCLUDE_vTaskDelete                                            1\r
+#define INCLUDE_vTaskCleanUpResources                  0\r
+#define INCLUDE_vTaskSuspend                                   1\r
+#define INCLUDE_vTaskDelayUntil                                        1\r
+#define INCLUDE_vTaskDelay                                             1\r
+#define INCLUDE_uxTaskGetStackHighWaterMark            1\r
+#define INCLUDE_xTaskGetSchedulerState                 1\r
+#define INCLUDE_xTimerGetTimerDaemonTaskHandle 1\r
+#define INCLUDE_xTaskGetIdleTaskHandle                 1\r
+#define INCLUDE_pcTaskGetTaskName                              1\r
+#define INCLUDE_eTaskGetState                                  1\r
+#define INCLUDE_xSemaphoreGetMutexHolder               1\r
+#define INCLUDE_xTimerPendCallbackFromISR              1\r
+\r
+/* Standard assert semantics. */\r
+extern void vAssertCalled( unsigned long ulLine, const char * const pcFileName );\r
+#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __LINE__, __FILE__ )\r
+\r
+/* configUSE_PORT_OPTIMISED_TASK_SELECTION is only available in the MSVC \r
+version of the Win32 simulator projects.  It will be ignored in the GCC\r
+version. */\r
+#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1\r
+\r
+/* Include the FreeRTOS+Trace FreeRTOS trace macro definitions. */\r
+#include "trcKernelPort.h"\r
 \r
 #endif /* FREERTOS_CONFIG_H */\r
diff --git a/FreeRTOS/Demo/WIN32-MingW/Run-time-stats-utils.c b/FreeRTOS/Demo/WIN32-MingW/Run-time-stats-utils.c
new file mode 100644 (file)
index 0000000..75865a9
--- /dev/null
@@ -0,0 +1,140 @@
+/*\r
+    FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+    All rights reserved\r
+\r
+    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS provides completely free yet professionally developed,    *\r
+     *    robust, strictly quality controlled, supported, and cross          *\r
+     *    platform software that has become a de facto standard.             *\r
+     *                                                                       *\r
+     *    Help yourself get started quickly and support the FreeRTOS         *\r
+     *    project by purchasing a FreeRTOS tutorial book, reference          *\r
+     *    manual, or both from: http://www.FreeRTOS.org/Documentation        *\r
+     *                                                                       *\r
+     *    Thank you!                                                         *\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
+\r
+    >>! NOTE: The modification to the GPL is included to allow you to distribute\r
+    >>! a combined work that includes FreeRTOS without being obliged to provide\r
+    >>! the source code for proprietary components outside of the FreeRTOS\r
+    >>! kernel.\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  Full license text is available from the following\r
+    link: http://www.freertos.org/a00114.html\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
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
+    license and Real Time Engineers Ltd. contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
+    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
+    Integrity Systems to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
+    licenses offer ticketed support, indemnification and middleware.\r
+\r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
+    engineered and independently SIL3 certified version for use in safety and\r
+    mission critical applications that require provable dependability.\r
+\r
+    1 tab == 4 spaces!\r
+*/\r
+\r
+/*\r
+ * Utility functions required to gather run time statistics.  See:\r
+ * http://www.freertos.org/rtos-run-time-stats.html\r
+ *\r
+ * Note that this is a simulated port, where simulated time is a lot slower than\r
+ * real time, therefore the run time counter values have no real meaningful\r
+ * units.\r
+ *\r
+ * Also note that it is assumed this demo is going to be used for short periods\r
+ * of time only, and therefore timer overflows are not handled.\r
+*/\r
+\r
+/* FreeRTOS includes. */\r
+#include <FreeRTOS.h>\r
+\r
+/* FreeRTOS+Trace includes. */\r
+#include "trcUser.h"\r
+\r
+/* Variables used in the creation of the run time stats time base.  Run time \r
+stats record how much time each task spends in the Running state. */\r
+static long long llInitialRunTimeCounterValue = 0LL, llTicksPerHundedthMillisecond = 0LL;\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+void vConfigureTimerForRunTimeStats( void )\r
+{\r
+LARGE_INTEGER liPerformanceCounterFrequency, liInitialRunTimeValue;\r
+\r
+       /* Initialise the variables used to create the run time stats time base.\r
+       Run time stats record how much time each task spends in the Running \r
+       state. */\r
+\r
+       if( QueryPerformanceFrequency( &liPerformanceCounterFrequency ) == 0 )\r
+       {\r
+               llTicksPerHundedthMillisecond = 1;\r
+       }\r
+       else\r
+       {\r
+               /* How many times does the performance counter increment in 1/100th\r
+               millisecond. */\r
+               llTicksPerHundedthMillisecond = liPerformanceCounterFrequency.QuadPart / 100000LL;\r
+\r
+               /* What is the performance counter value now, this will be subtracted\r
+               from readings taken at run time. */\r
+               QueryPerformanceCounter( &liInitialRunTimeValue );\r
+               llInitialRunTimeCounterValue = liInitialRunTimeValue.QuadPart;\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+unsigned long ulGetRunTimeCounterValue( void )\r
+{\r
+LARGE_INTEGER liCurrentCount;\r
+unsigned long ulReturn;\r
+\r
+       /* What is the performance counter value now? */\r
+       QueryPerformanceCounter( &liCurrentCount );\r
+\r
+       /* Subtract the performance counter value reading taken when the \r
+       application started to get a count from that reference point, then\r
+       scale to (simulated) 1/100ths of a millisecond. */\r
+       if( llTicksPerHundedthMillisecond == 0 )\r
+       {\r
+               /* The trace macros are probably calling this function before the\r
+               scheduler has been started. */\r
+               ulReturn = 0;\r
+       }\r
+       else\r
+       {\r
+               ulReturn = ( unsigned long ) ( ( liCurrentCount.QuadPart - llInitialRunTimeCounterValue ) / llTicksPerHundedthMillisecond );\r
+       }\r
+\r
+       return ulReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
diff --git a/FreeRTOS/Demo/WIN32-MingW/Trace_Recorder_Configuration/trcConfig.h b/FreeRTOS/Demo/WIN32-MingW/Trace_Recorder_Configuration/trcConfig.h
new file mode 100644 (file)
index 0000000..7a38d67
--- /dev/null
@@ -0,0 +1,510 @@
+/*******************************************************************************\r
+ * Tracealyzer v2.4.1 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcConfig.h\r
+ *\r
+ * Configuration parameters for the trace recorder library. Before using the \r
+ * trace recorder library, please check that the default settings are \r
+ * appropriate for your system, and if necessary adjust these. Most likely, you \r
+ * will need to adjust the NTask, NISR, NQueue, NMutex and NSemaphore values to \r
+ * reflect the number of such objects in your system. These may be \r
+ * over-approximated, although larger values values implies more RAM usage.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcHardwarePort.c/.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * Copyright Percepio AB, 2013.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#ifndef TRCCONFIG_H\r
+#define TRCCONFIG_H\r
+\r
+#include <stdint.h>\r
+\r
+/*******************************************************************************\r
+ * CONFIGURATION RELATED TO CAPACITY AND ALLOCATION \r
+ ******************************************************************************/\r
+\r
+/*******************************************************************************\r
+ * EVENT_BUFFER_SIZE\r
+ *\r
+ * Macro which should be defined as an integer value.\r
+ *\r
+ * This defines the capacity of the event buffer, i.e., the number of records\r
+ * it may store. Each registered event typically use one record (4 byte), but\r
+ * vTracePrintF may use multiple records depending on the number of data args.\r
+ ******************************************************************************/\r
+\r
+#define EVENT_BUFFER_SIZE 100000 /* Adjust wrt. to available RAM */\r
+\r
+\r
+/*******************************************************************************\r
+ * USE_LINKER_PRAGMA\r
+ *\r
+ * Macro which should be defined as an integer value, default is 0.\r
+ *\r
+ * If this is 1, the header file "recorderdata_linker_pragma.h" is included just\r
+ * before the declaration of RecorderData (in trcBase.c), i.e., the trace data \r
+ * structure. This allows the user to specify a pragma with linker options. \r
+ *\r
+ * Example (for IAR Embedded Workbench and NXP LPC17xx):\r
+ * #pragma location="AHB_RAM_MEMORY"\r
+ * \r
+ * This example instructs the IAR linker to place RecorderData in another RAM \r
+ * bank, the AHB RAM. This can also be used for other compilers with a similar\r
+ * pragmas for linker options.\r
+ * \r
+ * Note that this only applies if using static allocation, see below.\r
+ ******************************************************************************/\r
+\r
+#define USE_LINKER_PRAGMA 0\r
+\r
+\r
+/*******************************************************************************\r
+ * SYMBOL_TABLE_SIZE\r
+ *\r
+ * Macro which should be defined as an integer value.\r
+ *\r
+ * This defines the capacity of the symbol table, in bytes. This symbol table \r
+ * stores User Events labels and names of deleted tasks, queues, or other kernel\r
+ * objects. Note that the names of active objects not stored here but in the \r
+ * Object Table. Thus, if you don't use User Events or delete any kernel \r
+ * objects you set this to zero (0) to minimize RAM usage.\r
+ ******************************************************************************/\r
+#define SYMBOL_TABLE_SIZE 5000\r
+\r
+/*******************************************************************************\r
+ * USE_SEPARATE_USER_EVENT_BUFFER\r
+ *\r
+ * Macro which should be defined as an integer value.\r
+ * Default is zero (0).\r
+ *\r
+ * This enables and disables the use of the separate user event buffer.\r
+ *\r
+ * Note: When using the separate user event buffer, you may get an artificial\r
+ * task instance named "Unknown actor". This is added as a placeholder when the \r
+ * user event history is longer than the task scheduling history.\r
+ ******************************************************************************/\r
+#define USE_SEPARATE_USER_EVENT_BUFFER 0\r
+\r
+/*******************************************************************************\r
+ * USER_EVENT_BUFFER_SIZE\r
+ *\r
+ * Macro which should be defined as an integer value.\r
+ *\r
+ * This defines the capacity of the user event buffer, in number of slots.\r
+ * A single user event can use between 1 and X slots, depending on the data.\r
+ *\r
+ * Only in use if USE_SEPARATE_USER_EVENT_BUFFER is set to 1.\r
+ ******************************************************************************/\r
+#define USER_EVENT_BUFFER_SIZE 500\r
+\r
+/*******************************************************************************\r
+ * USER_EVENT_CHANNELS\r
+ *\r
+ * Macro which should be defined as an integer value.\r
+ *\r
+ * This defines the number of allowed user event channels.\r
+ *\r
+ * Only in use if USE_SEPARATE_USER_EVENT_BUFFER is set to 1.\r
+ ******************************************************************************/\r
+#define CHANNEL_FORMAT_PAIRS 32\r
+\r
+/*******************************************************************************\r
+ * NTask, NISR, NQueue, NSemaphore, NMutex\r
+ *\r
+ * A group of Macros which should be defined as an integer value of zero (0) \r
+ * or larger.\r
+ *\r
+ * This defines the capacity of the Object Property Table - the maximum number\r
+ * of objects active at any given point within each object class.\r
+ * \r
+ * NOTE: In case objects are deleted and created during runtime, this setting\r
+ * does not limit the total amount of objects, only the number of concurrently\r
+ * active objects. \r
+ *\r
+ * Using too small values will give an error message through the vTraceError\r
+ * routine, which makes the error message appear when opening the trace data\r
+ * in Tracealyzer. If you are using the recorder status monitor task,\r
+ * any error messages are displayed in console prints, assuming that the\r
+ * print macro has been defined properly (vConsolePrintMessage). \r
+ *\r
+ * It can be wise to start with very large values for these constants, \r
+ * unless you are very confident on these numbers. Then do a recording and\r
+ * check the actual usage in Tracealyzer. This is shown by selecting\r
+ * View -> Trace Details -> Resource Usage -> Object Table\r
+ * \r
+ * NOTE 2: Remember to account for all tasks created by the kernel, such as the \r
+ * IDLE task, timer task, and any tasks created by other 3rd party \r
+ * software components, such as communication stacks. The recorder also has an \r
+ * optional monitor task to account for, if this is used.\r
+ * Moreover, one task slot is used to indicate "(startup)", i.e., a fictive \r
+ * task that represent the time before the scheduler starts. \r
+ * NTask should thus be at least 2-3 slots larger than your application task count.\r
+ *\r
+ ******************************************************************************/\r
+#define NTask             100\r
+#define NISR              20\r
+#define NQueue            60\r
+#define NSemaphore        60\r
+#define NMutex            60\r
+\r
+/* Maximum object name length for each class (includes zero termination) */\r
+#define NameLenTask       15\r
+#define NameLenISR        15\r
+#define NameLenQueue      15\r
+#define NameLenSemaphore  15\r
+#define NameLenMutex      15\r
+\r
+/******************************************************************************\r
+ * TRACE_DESCRIPTION\r
+ *\r
+ * Macro which should be defined as a string.\r
+ *\r
+ * This string is stored in the trace and displayed in Tracealyzer. Can be\r
+ * used to store, e.g., system version or build date. This is also used to store\r
+ * internal error messages from the recorder, which if occurs overwrites the\r
+ * value defined here. This may be maximum 256 chars.\r
+ *****************************************************************************/\r
+#define TRACE_DESCRIPTION "Tracealyzer Recorder Test Program"\r
+\r
+/******************************************************************************\r
+ * TRACE_DESCRIPTION_MAX_LENGTH\r
+ *\r
+ * The maximum length (including zero termination) for the TRACE_DESCRIPTION\r
+ * string. Since this string also is used for internal error messages from the \r
+ * recorder do not make it too short, as this may truncate the error messages.\r
+ * Default is 80. \r
+ * Maximum allowed length is 256 - the trace will fail to load if longer.\r
+ *****************************************************************************/\r
+#define TRACE_DESCRIPTION_MAX_LENGTH 80\r
+\r
+\r
+/******************************************************************************\r
+ * TRACE_DATA_ALLOCATION\r
+ *\r
+ * This defines how to allocate the recorder data structure, i.e., using a \r
+ * static declaration or using a dynamic allocation in runtime (malloc).\r
+ *\r
+ * Should be one of these two options:\r
+ * - TRACE_DATA_ALLOCATION_STATIC (default)\r
+ * - TRACE_DATA_ALLOCATION_DYNAMIC\r
+ *\r
+ * Using static allocation has the benefits of compile-time errors if the buffer \r
+ * is too large (too large constants in trcConfig.h) and no need to call the \r
+ * initialization routine (xTraceInitTraceData).\r
+ *\r
+ * Using dynamic allocation may give more flexibility in some cases.\r
+ *****************************************************************************/\r
+\r
+#define TRACE_DATA_ALLOCATION TRACE_DATA_ALLOCATION_STATIC\r
+\r
+\r
+/******************************************************************************\r
+ * CONFIGURATION REGARDING WHAT CODE/FEATURES TO INCLUDE\r
+ *****************************************************************************/\r
+\r
+/******************************************************************************\r
+ * USE_TRACE_ASSERT\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 0.\r
+ *\r
+ * If this is one (1), the TRACE_ASSERT macro will verify that a condition is \r
+ * true. If the condition is false, vTraceError() will be called.\r
+ *****************************************************************************/\r
+#define USE_TRACE_ASSERT 1\r
+\r
+/******************************************************************************\r
+ * INCLUDE_FLOAT_SUPPORT\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * If this is zero (0), all references to floating point values are removed,\r
+ * in case floating point values are not supported by the platform used.\r
+ * Floating point values are only used in vTracePrintF and its subroutines, to \r
+ * store float (%f) or double (%lf) argments. \r
+ *\r
+ * Note: vTracePrintF can still be used with integer and string arguments in\r
+ * either case.\r
+ *****************************************************************************/\r
+#define INCLUDE_FLOAT_SUPPORT 0\r
+\r
+/******************************************************************************\r
+ * INCLUDE_USER_EVENTS\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * If this is zero (0) the code for creating User Events is excluded to\r
+ * reduce code size. User Events are application-generated events, like \r
+ * "printf" but for the trace log instead of console output. User Events are \r
+ * much faster than a printf and can therefore be used in timing critical code.\r
+ * See vTraceUserEvent() and vTracePrintF() in trcUser.h\r
+ * \r
+ * Note that Tracealyzer Standard Edition or Professional Edition is required\r
+ * for User Events, they are not displayed in Tracealyzer Free Edition.\r
+ *****************************************************************************/\r
+#define INCLUDE_USER_EVENTS 1\r
+\r
+/*****************************************************************************\r
+ * INCLUDE_READY_EVENTS\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * If this is zero (0), the code for recording Ready events is \r
+ * excluded. Note, this will make it impossible to calculate the correct\r
+ * response times.\r
+ *****************************************************************************/\r
+#define INCLUDE_READY_EVENTS 1\r
+\r
+/*****************************************************************************\r
+ * INCLUDE_NEW_TIME_EVENTS\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 0.\r
+ *\r
+ * If this is zero (1), events will be generated whenever the os clock is\r
+ * increased.\r
+ *****************************************************************************/\r
+#define INCLUDE_NEW_TIME_EVENTS 0\r
+\r
+/*****************************************************************************\r
+ * INCLUDE_ISR_TRACING\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * If this is zero (0), the code for recording Interrupt Service Routines is \r
+ * excluded to reduce code size.\r
+ * \r
+ * Note, if the kernel has no central interrupt dispatcher, recording ISRs \r
+ * require that you insert calls to vTraceStoreISRBegin and vTraceStoreISREnd \r
+ * in your interrupt handlers.\r
+ *****************************************************************************/\r
+#define INCLUDE_ISR_TRACING 1\r
+\r
+/******************************************************************************\r
+ * INCLUDE_OBJECT_DELETE\r
+ * \r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * This must be enabled (1) if tasks, queues or other \r
+ * traced kernel objects are deleted at runtime. If no deletes are made, this \r
+ * can be set to 0 in order to exclude the delete-handling code.\r
+ *****************************************************************************/\r
+#define INCLUDE_OBJECT_DELETE 0\r
+\r
+/******************************************************************************\r
+ * CONFIGURATION RELATED TO BEHAVIOR\r
+ *****************************************************************************/\r
+\r
+/******************************************************************************\r
+ * TRACE_RECORDER_STORE_MODE\r
+ *\r
+ * Macro which should be defined as one of:\r
+ * - TRACE_STORE_MODE_RING_BUFFER\r
+ * - TRACE_STORE_MODE_STOP_WHEN_FULL\r
+ * Default is TRACE_STORE_MODE_RING_BUFFER.\r
+ *\r
+ * With TRACE_RECORDER_STORE_MODE set to TRACE_STORE_MODE_RING_BUFFER, the events are \r
+ * stored in a ring buffer, i.e., where the oldest events are overwritten when \r
+ * the buffer becomes full. This allows you to get the last events leading up \r
+ * to an interesting state, e.g., an error, without having a large trace buffer\r
+ * for string the whole run since startup. In this mode, the recorder can run\r
+ * "forever" as the buffer never gets full, i.e., in the sense that it always\r
+ * has room for more events.\r
+ *\r
+ * To fetch the trace in mode TRACE_STORE_MODE_RING_BUFFER, you need to first halt the\r
+ * system using your debugger and then do a RAM dump, or to explicitly stop the\r
+ * recorder using vTraceStop() and then store/upload the trace data using a\r
+ * task that you need to provide yourself. The trace data is found in the struct\r
+ * RecorderData, initialized in trcBase.c.\r
+ *\r
+ * Note that, if you upload the trace using a RAM dump, i.e., when the system is \r
+ * halted on a breakpoint or by a debugger command, there is no need to stop the \r
+ * recorder first.\r
+ *\r
+ * When TRACE_RECORDER_STORE_MODE is TRACE_STORE_MODE_STOP_WHEN_FULL, the recording is\r
+ * stopped when the buffer becomes full. When the recorder stops itself this way\r
+ * vTracePortEnd() is called which allows for custom actions, such as triggering\r
+ * a task that stores the trace buffer, i.e., in case taking a RAM dump\r
+ * using an on-chip debugger is not possible. In the Windows port, vTracePortEnd\r
+ * saves the trace to file directly, but this is not recommended in a real-time\r
+ * system since the scheduler is blocked during the processing of vTracePortEnd.\r
+ *****************************************************************************/\r
+\r
+#define TRACE_RECORDER_STORE_MODE TRACE_STORE_MODE_RING_BUFFER\r
+\r
+/******************************************************************************\r
+ * STOP_AFTER_N_EVENTS\r
+ *\r
+ * Macro which should be defined as an integer value, or not defined.\r
+ * Default is -1\r
+ *\r
+ * STOP_AFTER_N_EVENTS is intended for tests of the ring buffer mode (when\r
+ * RECORDER_STORE_MODE is STORE_MODE_RING_BUFFER). It stops the recording when\r
+ * the specified number of events has been observed. This value can be larger\r
+ * than the buffer size, to allow for test of the "wrapping around" that occurs\r
+ * in ring buffer mode . A negative value (or no definition of this macro)\r
+ * disables this feature.\r
+ *****************************************************************************/\r
+#define STOP_AFTER_N_EVENTS -1\r
+\r
+/******************************************************************************\r
+ * USE_IMPLICIT_IFE_RULES\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1). \r
+ * Default is 1.\r
+ *\r
+ * ### Instance Finish Events (IFE) ###\r
+ *\r
+ * For tasks with "infinite" main loops (non-terminating tasks), the concept\r
+ * of a task instance has no clear definition, it is an application-specific\r
+ * thing. Tracealyzer allows you to define Instance Finish Events (IFEs),\r
+ * which marks the point in a cyclic task when the "task instance" ends.\r
+ * The IFE is a blocking kernel call, typically in the main loop of a task\r
+ * which typically reads a message queue, waits for a semaphore or performs\r
+ * an explicit delay.\r
+ *\r
+ * If USE_IMPLICIT_IFE_RULES is one (1), the kernel macros (trcKernelPort.h)\r
+ * will define what kernel calls are considered by default to be IFEs.\r
+ *\r
+ * However, Implicit IFEs only applies to blocking kernel calls. If a\r
+ * service reads a message without blocking, it does not create a new\r
+ * instance since no blocking occurred.\r
+ *\r
+ * Moreover, the actual IFE might sometimes be another blocking call. We \r
+ * therefore allow for user-defined Explicit IFEs by calling\r
+ *\r
+ *     vTraceTaskInstanceIsFinished()\r
+ *\r
+ * right before the kernel call considered as IFE. This does not create an\r
+ * additional event but instead stores the service code and object handle\r
+ * of the IFE call as properties of the task.\r
+ *\r
+ * If using Explicit IFEs and the task also calls an Implicit IFE, this may \r
+ * result in additional incorrect task instances.\r
+ * This is solved by disabling the Implicit IFEs for the task, by adding\r
+ * a call to\r
+ * \r
+ *     vTraceTaskSkipDefaultInstanceFinishedEvents()\r
+ * \r
+ * in the very beginning of that task. This allows you to combine Explicit IFEs\r
+ * for some tasks with Implicit IFEs for the rest of the tasks, if\r
+ * USE_IMPLICIT_IFE_RULES is 1.\r
+ *\r
+ * By setting USE_IMPLICIT_IFE_RULES to zero (0), the implicit IFEs are disabled\r
+ * for all tasks. Tasks will then be considered to have a single instance only, \r
+ * covering all execution fragments, unless you define an explicit IFE in each\r
+ * task by calling vTraceTaskInstanceIsFinished before the blocking call.\r
+ *****************************************************************************/\r
+#define USE_IMPLICIT_IFE_RULES 1\r
+\r
+/******************************************************************************\r
+ * INCLUDE_SAVE_TO_FILE\r
+ *\r
+ * Macro which should be defined as either zero (0) or one (1).\r
+ * Default is 0.\r
+ *\r
+ * If enabled (1), the recorder will include code for saving the trace\r
+ * to a local file system.\r
+ ******************************************************************************/\r
+#ifdef WIN32\r
+    #define INCLUDE_SAVE_TO_FILE 1\r
+#else\r
+    #define INCLUDE_SAVE_TO_FILE 0\r
+#endif\r
+\r
+/******************************************************************************\r
+ * TRACE_PROGRESS_MONITOR_TASK_PRIORITY\r
+ *\r
+ * Macro which sets the priority of the "recorder status monitor" task.\r
+ *\r
+ * This task, vTraceMonitorTask in trcUser.c, periodically writes\r
+ * the recorder status using the vTraceConsoleMessage macro, which is to\r
+ * be mapped to your console "printf" routine. The task is named TraceMon but \r
+ * is intentionally excluded from the demo trace.\r
+ *\r
+ * Default is tskIDLE_PRIORITY + 1\r
+ * Note that if your system constantly has a high CPU load from high-priority \r
+ * tasks, this might not be get a chance to execute.\r
+ * \r
+ * See vTraceMonitorTask in trcUser.c\r
+ *****************************************************************************/\r
+#define TRACE_PROGRESS_MONITOR_TASK_PRIORITY (tskIDLE_PRIORITY + 1)\r
+\r
+/******************************************************************************\r
+ * TRACE_PROGRESS_MONITOR_TASK_STACKSIZE\r
+ *\r
+ * Macro which sets the stack size of the "recorder status monitor" task.\r
+ *\r
+ * This task, vTraceMonitorTask in trcUser.c, periodically writes\r
+ * the recorder status using the vTraceConsoleMessage macro, which is to\r
+ * be mapped to your console "printf" routine. The task is intentionally \r
+ * excluded from the demo trace.\r
+ *\r
+ * See vTraceMonitorTask in trcUser.c\r
+ *****************************************************************************/\r
+#define TRACE_PROGRESS_MONITOR_TASK_STACKSIZE 500\r
+\r
+/******************************************************************************\r
+ * TRACE_PROGRESS_MONITOR_TASK_PERIOD\r
+ *\r
+ * Macro which sets the period of the "recorder status monitor" task.\r
+ *\r
+ * This task, vTraceMonitorTask in trcUser.c, periodically writes\r
+ * the recorder status using the vTraceConsoleMessage macro, which is to\r
+ * be mapped to your console "printf" routine. The task is named TraceMon but \r
+ * is intentionally excluded from the demo trace.\r
+ *\r
+ * Default is 1000 ticks (typically 1 second). On the Windows port, a lower \r
+ * value is suggested since the Windows port runs very slowly, often 20-40\r
+ * times slower than the simulated time.\r
+ *\r
+ * See vTraceMonitorTask in trcUser.c\r
+ *****************************************************************************/\r
+#ifdef WIN32\r
+    #define TRACE_PROGRESS_MONITOR_TASK_PERIOD 100\r
+#else\r
+    #define TRACE_PROGRESS_MONITOR_TASK_PERIOD 1000\r
+#endif\r
+\r
+/******************************************************************************\r
+ * TEAM_LICENSE_CODE\r
+ *\r
+ * Macro which defines a string - the team license code.\r
+ * If no team license is available, this should be an empty string "".\r
+ * This should be maximum 32 chars, including zero-termination.\r
+ *****************************************************************************/\r
+#define TEAM_LICENSE_CODE ""\r
+\r
+#endif\r
+\r
diff --git a/FreeRTOS/Demo/WIN32-MingW/Trace_Recorder_Configuration/trcHardwarePort.h b/FreeRTOS/Demo/WIN32-MingW/Trace_Recorder_Configuration/trcHardwarePort.h
new file mode 100644 (file)
index 0000000..ac83477
--- /dev/null
@@ -0,0 +1,474 @@
+/******************************************************************************* \r
+ * Tracealyzer v2.4.1 Recorder Library\r
+ * Percepio AB, www.percepio.com\r
+ *\r
+ * trcHardwarePort.h\r
+ *\r
+ * Contains together with trcHardwarePort.c all hardware portability issues of \r
+ * the trace recorder library.\r
+ *\r
+ * Terms of Use\r
+ * This software is copyright Percepio AB. The recorder library is free for\r
+ * use together with Percepio products. You may distribute the recorder library\r
+ * in its original form, including modifications in trcPort.c and trcPort.h\r
+ * given that these modification are clearly marked as your own modifications\r
+ * and documented in the initial comment section of these source files. \r
+ * This software is the intellectual property of Percepio AB and may not be \r
+ * sold or in other ways commercially redistributed without explicit written \r
+ * permission by Percepio AB.\r
+ *\r
+ * Disclaimer \r
+ * The trace tool and recorder library is being delivered to you AS IS and \r
+ * Percepio AB makes no warranty as to its use or performance. Percepio AB does \r
+ * not and cannot warrant the performance or results you may obtain by using the \r
+ * software or documentation. Percepio AB make no warranties, express or \r
+ * implied, as to noninfringement of third party rights, merchantability, or \r
+ * fitness for any particular purpose. In no event will Percepio AB, its \r
+ * technology partners, or distributors be liable to you for any consequential, \r
+ * incidental or special damages, including any lost profits or lost savings, \r
+ * even if a representative of Percepio AB has been advised of the possibility \r
+ * of such damages, or for any claim by any third party. Some jurisdictions do \r
+ * not allow the exclusion or limitation of incidental, consequential or special \r
+ * damages, or the exclusion of implied warranties or limitations on how long an \r
+ * implied warranty may last, so the above limitations may not apply to you.\r
+ *\r
+ * Copyright Percepio AB, 2013.\r
+ * www.percepio.com\r
+ ******************************************************************************/\r
+\r
+#ifndef TRCPORT_H\r
+#define TRCPORT_H\r
+\r
+#include "trcKernelPort.h"\r
+\r
+/* If Win32 port */\r
+#ifdef WIN32\r
+\r
+   #undef _WIN32_WINNT\r
+   #define _WIN32_WINNT 0x0600\r
+\r
+   /* Standard includes. */\r
+   #include <stdio.h>\r
+   #include <windows.h>\r
+   #include <direct.h>\r
+\r
+/*******************************************************************************\r
+ * The Win32 port by default saves the trace to file and then kills the\r
+ * program when the recorder is stopped, to facilitate quick, simple tests\r
+ * of the recorder.\r
+ ******************************************************************************/\r
+   #define WIN32_PORT_SAVE_WHEN_STOPPED 1\r
+   #define WIN32_PORT_EXIT_WHEN_STOPPED 1\r
+\r
+#endif\r
+\r
+#define DIRECTION_INCREMENTING 1\r
+#define DIRECTION_DECREMENTING 2\r
+\r
+/******************************************************************************\r
+ * Supported ports\r
+ * \r
+ * PORT_HWIndependent\r
+ * A hardware independent fallback option for event timestamping. Provides low \r
+ * resolution timestamps based on the OS tick.\r
+ * This may be used on the Win32 port, but may also be used on embedded hardware \r
+ * platforms. All time durations will be truncated to the OS tick frequency, \r
+ * typically 1 KHz. This means that a task or ISR that executes in less than \r
+ * 1 ms get an execution time of zero.\r
+ *\r
+ * PORT_Win32\r
+ * "Accurate" timestamping based on the Windows performance counter. Note that\r
+ * this gives the host machine time.\r
+ *\r
+ * Officially supported hardware timer ports:\r
+ * - PORT_Atmel_AT91SAM7\r
+ * - PORT_Atmel_UC3A0\r
+ * - PORT_ARM_CortexM \r
+ * - PORT_Renesas_RX600\r
+ * - PORT_Microchip_dsPIC_AND_PIC24\r
+ *\r
+ * We also provide several "unofficial" hardware-specific ports. There have \r
+ * been developed by external contributors, and have not yet been verified \r
+ * by Percepio AB. Let us know if you have problems getting these to work.\r
+ * \r
+ * Unofficial hardware specific ports provided are:\r
+ * - PORT_TEXAS_INSTRUMENTS_TMS570\r
+ * - PORT_TEXAS_INSTRUMENTS_MSP430\r
+ * - PORT_MICROCHIP_PIC32\r
+ * - PORT_XILINX_PPC405\r
+ * - PORT_XILINX_PPC440\r
+ * - PORT_XILINX_MICROBLAZE\r
+ * - PORT_NXP_LPC210X\r
+ *\r
+ *****************************************************************************/\r
+\r
+#define PORT_NOT_SET                          -1\r
+\r
+/*** Officially supported hardware timer ports *******************************/\r
+#define PORT_HWIndependent                     0\r
+#define PORT_Win32                             1\r
+#define PORT_Atmel_AT91SAM7                    2\r
+#define PORT_Atmel_UC3A0                       3\r
+#define PORT_ARM_CortexM                       4\r
+#define PORT_Renesas_RX600                     5\r
+#define PORT_Microchip_dsPIC_AND_PIC24         6\r
+\r
+/*** Unofficial ports, provided by external developers, not yet verified *****/\r
+#define PORT_TEXAS_INSTRUMENTS_TMS570          7\r
+#define PORT_TEXAS_INSTRUMENTS_MSP430          8\r
+#define PORT_MICROCHIP_PIC32                   9\r
+#define PORT_XILINX_PPC405                    10\r
+#define PORT_XILINX_PPC440                    11\r
+#define PORT_XILINX_MICROBLAZE                12\r
+#define PORT_NXP_LPC210X                      13\r
+\r
+/*** Select your port here! **************************************************/\r
+#define SELECTED_PORT PORT_Win32\r
+/*****************************************************************************/\r
+\r
+#if (SELECTED_PORT == PORT_NOT_SET) \r
+#error "You need to define SELECTED_PORT here!"\r
+#endif\r
+\r
+/*******************************************************************************\r
+ * IRQ_PRIORITY_ORDER\r
+ *\r
+ * Macro which should be defined as an integer of 0 or 1.\r
+ *\r
+ * This should be 0 if lower IRQ priority values implies higher priority \r
+ * levels, such as on ARM Cortex M. If the opposite scheme is used, i.e., \r
+ * if higher IRQ priority values means higher priority, this should be 1.\r
+ *\r
+ * This setting is not critical. It is used only to sort and colorize the \r
+ * interrupts in priority order, in case you record interrupts using\r
+ * the vTraceStoreISRBegin and vTraceStoreISREnd routines.\r
+ *\r
+ * We provide this setting for some hardware architectures below:\r
+ * - ARM Cortex M:       0 (lower IRQ priority values are more significant)\r
+ * - Atmel AT91SAM7x:    1 (higher IRQ priority values are more significant)\r
+ * - Atmel AVR32:        1 (higher IRQ priority values are more significant)\r
+ * - Renesas RX600:      1 (higher IRQ priority values are more significant)\r
+ * - Microchip PIC24:    0 (lower IRQ priority values are more significant)\r
+ * - Microchip dsPIC:    0 (lower IRQ priority values are more significant)\r
+ * - TI TMS570:          0 (lower IRQ priority values are more significant)\r
+ * - Freescale HCS08:    0 (lower IRQ priority values are more significant)\r
+ * - Freescale HCS12:    0 (lower IRQ priority values are more significant)\r
+ * - PowerPC 405:        0 (lower IRQ priority values are more significant)\r
+ * - PowerPC 440:        0 (lower IRQ priority values are more significant)\r
+ * - Freescale ColdFire: 1 (higher IRQ priority values are more significant)\r
+ * - NXP LPC210x:        0 (lower IRQ priority values are more significant)\r
+ * - MicroBlaze:        0  (lower IRQ priority values are more significant)\r
+ *\r
+ * If your chip is not on the above list, and you perhaps know this detail by \r
+ * heart, please inform us by e-mail to support@percepio.com.\r
+ *\r
+ ******************************************************************************\r
+ *\r
+ * HWTC Macros \r
+ *\r
+ * These four HWTC macros provides a hardware isolation layer representing a \r
+ * generic hardware timer/counter used for driving the operating system tick, \r
+ * such as the SysTick feature of ARM Cortex M3/M4, or the PIT of the Atmel \r
+ * AT91SAM7X.\r
+ *\r
+ * HWTC_COUNT: The current value of the counter. This is expected to be reset \r
+ * a each tick interrupt. Thus, when the tick handler starts, the counter has \r
+ * already wrapped.\r
+ *\r
+ * HWTC_COUNT_DIRECTION: Should be one of:\r
+ * - DIRECTION_INCREMENTING - for hardware timer/counters of incrementing type\r
+ *   such as the PIT on Atmel AT91SAM7X.\r
+ *   When the counter value reach HWTC_PERIOD, it is reset to zero and the\r
+ *   interrupt is signaled.\r
+ * - DIRECTION_DECREMENTING - for hardware timer/counters of decrementing type\r
+ *   such as the SysTick on ARM Cortex M3/M4 chips.\r
+ *   When the counter value reach 0, it is reset to HWTC_PERIOD and the\r
+ *   interrupt is signaled.\r
+ *\r
+ * HWTC_PERIOD: The number of increments or decrements of HWTC_COUNT between\r
+ * two tick interrupts. This should preferably be mapped to the reload\r
+ * register of the hardware timer, to make it more portable between chips in the \r
+ * same family. The macro should in most cases be (reload register + 1).\r
+ *\r
+ * HWTC_DIVISOR: If the timer frequency is very high, like on the Cortex M chips\r
+ * (where the SysTick runs at the core clock frequency), the "differential \r
+ * timestamping" used in the recorder will more frequently insert extra XTS \r
+ * events to store the timestamps, which increases the event buffer usage. \r
+ * In such cases, to reduce the number of XTS events and thereby get longer \r
+ * traces, you use HWTC_DIVISOR to scale down the timestamps and frequency.\r
+ * Assuming a OS tick rate of 1 KHz, it is suggested to keep the effective timer\r
+ * frequency below 65 MHz to avoid an excessive amount of XTS events. Thus, a\r
+ * Cortex M chip running at 72 MHZ should use a HWTC_DIVISOR of 2, while a \r
+ * faster chip require a higher HWTC_DIVISOR value. \r
+ *\r
+ * The HWTC macros and vTracePortGetTimeStamp is the main porting issue\r
+ * or the trace recorder library. Typically you should not need to change\r
+ * the code of vTracePortGetTimeStamp if using the HWTC macros.\r
+ *\r
+ ******************************************************************************/\r
+\r
+#if (SELECTED_PORT == PORT_Win32)\r
+    \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (ulGetRunTimeCounterValue())\r
+    #define HWTC_PERIOD 0\r
+    #define HWTC_DIVISOR 1\r
+    \r
+    #define IRQ_PRIORITY_ORDER 1  // Please update according to your hardware...\r
+\r
+#elif (SELECTED_PORT == PORT_HWIndependent)\r
+    \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT 0\r
+    #define HWTC_PERIOD 1\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // Please update according to your hardware...\r
+\r
+#elif (SELECTED_PORT == PORT_Atmel_AT91SAM7)\r
+\r
+    /* HWTC_PERIOD is hardcoded for AT91SAM7X256-EK Board (48 MHz)\r
+    A more generic solution is to get the period from pxPIT->PITC_PIMR */\r
+    \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (AT91C_BASE_PITC->PITC_PIIR & 0xFFFFF)\r
+    #define HWTC_PERIOD 2995 \r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // higher IRQ priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_Atmel_UC3A0) \r
+  \r
+    /* For Atmel AVR32 (AT32UC3A) */\r
+  \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT sysreg_read(AVR32_COUNT)\r
+    #define HWTC_PERIOD ( TRACE_CPU_CLOCK_HZ / TRACE_TICK_RATE_HZ )\r
+    #define HWTC_DIVISOR 1    \r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // higher IRQ priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_ARM_CortexM)\r
+\r
+    /* For all chips using ARM Cortex M cores */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
+    #define HWTC_COUNT (*((uint32_t*)0xE000E018))\r
+    #define HWTC_PERIOD ((*(uint32_t*)0xE000E014) + 1)\r
+    #define HWTC_DIVISOR 2\r
+    \r
+    #define IRQ_PRIORITY_ORDER 0  // lower IRQ priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_Renesas_RX600)    \r
+\r
+    #include "iodefine.h"\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (CMT0.CMCNT)\r
+    #define HWTC_PERIOD ((((TRACE_PERIPHERAL_CLOCK_HZ/TRACE_TICK_RATE_HZ)-1)/8))\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // higher IRQ priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_Microchip_dsPIC_AND_PIC24) \r
+\r
+    /* For Microchip PIC24 and dsPIC (16 bit) */\r
+\r
+    /* Note: The trace library was originally designed for 32-bit MCUs, and is slower\r
+       than intended on 16-bit MCUs. Storing an event on a PIC24 takes about 70 Âµs. \r
+       In comparison, 32-bit MCUs are often 10-20 times faster. If recording overhead \r
+       becomes a problem on PIC24, use the filters to exclude less interesting tasks \r
+       or system calls. */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (TMR1)\r
+    #define HWTC_PERIOD (PR1+1)\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower IRQ priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_NXP_LPC210X)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+    \r
+    /* Tested with LPC2106, but should work with most LPC21XX chips. */\r
+      \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT  *((uint32_t *)0xE0004008 )\r
+    #define HWTC_PERIOD ( TRACE_CPU_CLOCK_HZ / TRACE_TICK_RATE_HZ ) \r
+    #define HWTC_DIVISOR 1    \r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower IRQ priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_TEXAS_INSTRUMENTS_TMS570)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    #define RTIFRC0 *((uint32_t *)0xFFFFFC10)\r
+    #define RTICOMP0 *((uint32_t *)0xFFFFFC50)\r
+    #define RTIUDCP0 *((uint32_t *)0xFFFFFC54)\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (RTIFRC0 - (RTICOMP0 - RTIUDCP0))\r
+    #define HWTC_PERIOD (RTIUDCP0)\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower IRQ priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_TEXAS_INSTRUMENTS_MSP430)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (TA0R)\r
+    #define HWTC_PERIOD TRACE_CPU_CLOCKS_PER_TICK      \r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 1  // higher IRQ priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_MICROCHIP_PIC32)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_INCREMENTING\r
+    #define HWTC_COUNT (ReadTimer1())     /* Should be available in BSP */\r
+    #define HWTC_PERIOD (ReadPeriod1()+1) /* Should be available in BSP */\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower IRQ priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_XILINX_PPC405) \r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
+    #define HWTC_COUNT  mfspr( 0x3db)\r
+    #define HWTC_PERIOD ( TRACE_CPU_CLOCK_HZ / TRACE_TICK_RATE_HZ )\r
+    #define HWTC_DIVISOR 1\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower IRQ priority values are more significant\r
+\r
+#elif (SELECTED_PORT == PORT_XILINX_PPC440) \r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    /* This should work with most PowerPC chips */\r
+    \r
+    #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
+    #define HWTC_COUNT  mfspr( 0x016 )\r
+    #define HWTC_PERIOD ( TRACE_CPU_CLOCK_HZ / TRACE_TICK_RATE_HZ )\r
+    #define HWTC_DIVISOR 1    \r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower IRQ priority values are more significant\r
+    \r
+#elif (SELECTED_PORT == PORT_XILINX_MICROBLAZE)\r
+    /* UNOFFICIAL PORT - NOT YET VERIFIED BY PERCEPIO */\r
+\r
+    /* This should work with most Microblaze configurations.\r
+     * It uses the AXI Timer 0 - the tick interrupt source.\r
+     * If an AXI Timer 0 peripheral is available on your hardware platform, no modifications are required.\r
+     */\r
+    #include "xtmrctr_l.h"\r
+\r
+    #define HWTC_COUNT_DIRECTION DIRECTION_DECREMENTING\r
+    #define HWTC_COUNT XTmrCtr_GetTimerCounterReg( XPAR_TMRCTR_0_BASEADDR, 0 )\r
+    #define HWTC_PERIOD ( TRACE_CPU_CLOCK_HZ / TRACE_TICK_RATE_HZ )\r
+    #define HWTC_DIVISOR 16\r
+\r
+    #define IRQ_PRIORITY_ORDER 0  // lower IRQ priority values are more significant\r
+\r
+#elif (SELECTED_PORT != PORT_NOT_SET)\r
+\r
+    #error "SELECTED_PORT had unsupported value!"\r
+    #define SELECTED_PORT PORT_NOT_SET\r
+\r
+#endif\r
+\r
+#if (SELECTED_PORT != PORT_NOT_SET)\r
+    \r
+    #ifndef HWTC_COUNT_DIRECTION\r
+    #error "HWTC_COUNT_DIRECTION is not set!"\r
+    #endif \r
+    \r
+    #ifndef HWTC_COUNT\r
+    #error "HWTC_COUNT is not set!"    \r
+    #endif \r
+    \r
+    #ifndef HWTC_PERIOD\r
+    #error "HWTC_PERIOD is not set!"\r
+    #endif \r
+    \r
+    #ifndef HWTC_DIVISOR\r
+    #error "HWTC_DIVISOR is not set!"    \r
+    #endif \r
+    \r
+    #ifndef IRQ_PRIORITY_ORDER\r
+    #error "IRQ_PRIORITY_ORDER is not set!"\r
+    #elif (IRQ_PRIORITY_ORDER != 0) && (IRQ_PRIORITY_ORDER != 1)\r
+    #error "IRQ_PRIORITY_ORDER has bad value!"\r
+    #endif \r
+    \r
+    #if (HWTC_DIVISOR < 1)\r
+    #error "HWTC_DIVISOR must be a non-zero positive value!"\r
+    #endif \r
+\r
+#endif\r
+/*******************************************************************************\r
+ * vTraceConsoleMessage\r
+ *\r
+ * A wrapper for your system-specific console "printf" console output function.\r
+ * This needs to be correctly defined to see status reports from the trace \r
+ * status monitor task (this is defined in trcUser.c).\r
+ ******************************************************************************/         \r
+#if (SELECTED_PORT == PORT_Atmel_AT91SAM7)\r
+/* Port specific includes */\r
+#include "console.h"\r
+#endif\r
+\r
+#define vTraceConsoleMessage(x)\r
+\r
+/*******************************************************************************\r
+ * vTracePortGetTimeStamp\r
+ *\r
+ * Returns the current time based on the HWTC macros which provide a hardware\r
+ * isolation layer towards the hardware timer/counter.\r
+ *\r
+ * The HWTC macros and vTracePortGetTimeStamp is the main porting issue\r
+ * or the trace recorder library. Typically you should not need to change\r
+ * the code of vTracePortGetTimeStamp if using the HWTC macros.\r
+ *\r
+ ******************************************************************************/\r
+void vTracePortGetTimeStamp(uint32_t *puiTimestamp);\r
+\r
+/*******************************************************************************\r
+ * vTracePortEnd\r
+ * \r
+ * This function is called when the recorder is stopped due to full buffer.\r
+ * Mainly intended to show a message in the console.\r
+ * This is used by the Win32 port to store the trace to a file. The file path is\r
+ * set using vTracePortSetFileName.\r
+ ******************************************************************************/\r
+void vTracePortEnd(void);\r
+\r
+#if (INCLUDE_SAVE_TO_FILE == 1)\r
+\r
+/*******************************************************************************\r
+ * vTracePortSetOutFile\r
+ *\r
+ * Sets the filename/path used in vTracePortSave.\r
+ * This is set in a separate function, since the Win32 port calls vTracePortSave\r
+ * in vTracePortEnd if WIN32_PORT_SAVE_WHEN_STOPPED is set.\r
+ ******************************************************************************/\r
+void vTracePortSetOutFile(char* path);\r
+\r
+/******************************************************************************\r
+ * vTracePortSave\r
+ *\r
+ * Saves the trace to a file on a target-side file system. The path is set in a \r
+ * separate function, vTracePortSetOutFile, since the Win32 port may call\r
+ * vTracePortSave in vTracePortEnd, if using WIN32_PORT_SAVE_WHEN_STOPPED.\r
+ ******************************************************************************/\r
+void vTracePortSave(void);\r
+\r
+#else\r
+\r
+#define vTraceConsoleMessage(x)\r
+#define vTracePortSetOutFile(path)\r
+#define vTracePortSave(void)\r
+\r
+#endif\r
+\r
+#endif\r
index 35ad0939dc286b7ccf9ffa20441e3e7188d8d1e6..6d451b4626a10c676e3b6a20f290e5ec33f5c134 100644 (file)
     1 tab == 4 spaces!\r
 */\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 is used to select between the two.  \r
+ * The simply blinky demo is implemented and described in main_blinky.c.  The \r
+ * more comprehensive test and demo application is implemented and described in \r
+ * 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
  * -NOTE- The Win32 port is a simulation (or is that emulation?) only!  Do not\r
  * expect to get real time behaviour from the Win32 port or this demo\r
  * application.  It is provided as a convenient development and demonstration\r
  * test bed only.  This was tested using Windows XP on a dual core laptop.\r
  *\r
+ * Windows will not be running the FreeRTOS simulator threads continuously, so \r
+ * the timing information in the FreeRTOS+Trace logs have no meaningful units.  \r
+ * See the documentation page for the Windows simulator for an explanation of \r
+ * the slow timing:\r
+ * http://www.freertos.org/FreeRTOS-Windows-Simulator-Emulator-for-Visual-Studio-and-Eclipse-MingW.html\r
  * - READ THE WEB DOCUMENTATION FOR THIS PORT FOR MORE INFORMATION ON USING IT -\r
  *******************************************************************************\r
  *\r
- * main() creates all the demo application tasks, then starts the scheduler.  \r
- * The web documentation provides more details of the standard demo application \r
- * tasks, which provide no particular functionality but do provide a good \r
- * example of how to use the FreeRTOS API.\r
- *\r
- * In addition to the standard demo tasks, the following tasks and tests are\r
- * defined and/or created within this file:\r
- *\r
- * "Check" task - This only executes every five seconds but has a high priority\r
- * to ensure it gets processor time.  Its main function is to check that all the\r
- * standard demo tasks are still operational.  While no errors have been\r
- * discovered the check task will print out "OK" and the current simulated tick\r
- * time.  If an error is discovered in the execution of a task then the check\r
- * task will print out an appropriate error message.\r
- *\r
  */\r
 \r
-\r
 /* Standard includes. */\r
 #include <stdio.h>\r
+#include <stdlib.h>\r
+#include <conio.h>\r
 \r
-/* Kernel includes. */\r
-#include <FreeRTOS.h>\r
+/* FreeRTOS kernel includes. */\r
+#include "FreeRTOS.h"\r
 #include "task.h"\r
-#include "queue.h"\r
-\r
-/* Standard demo includes. */\r
-#include "BlockQ.h"\r
-#include "integer.h"\r
-#include "semtest.h"\r
-#include "PollQ.h"\r
-#include "GenQTest.h"\r
-#include "QPeek.h"\r
-#include "recmutex.h"\r
-#include "flop.h"\r
-\r
-/* Priorities at which the tasks are created. */\r
-#define mainCHECK_TASK_PRIORITY                ( configMAX_PRIORITIES - 1 )\r
-#define mainQUEUE_POLL_PRIORITY                ( tskIDLE_PRIORITY + 1 )\r
-#define mainSEM_TEST_PRIORITY          ( tskIDLE_PRIORITY + 1 )\r
-#define mainBLOCK_Q_PRIORITY           ( tskIDLE_PRIORITY + 2 )\r
-#define mainCREATOR_TASK_PRIORITY   ( tskIDLE_PRIORITY + 3 )\r
-#define mainFLASH_TASK_PRIORITY                ( tskIDLE_PRIORITY + 1 )\r
-#define mainuIP_TASK_PRIORITY          ( tskIDLE_PRIORITY + 2 )\r
-#define mainINTEGER_TASK_PRIORITY   ( tskIDLE_PRIORITY )\r
-#define mainGEN_QUEUE_TASK_PRIORITY    ( tskIDLE_PRIORITY )\r
-#define mainFLOP_TASK_PRIORITY         ( tskIDLE_PRIORITY )\r
-\r
-/* Task function prototypes. */\r
-static void prvCheckTask( void *pvParameters );\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 is used to select between the two.  \r
+The simply blinky demo is implemented and described in main_blinky.c.  The more \r
+comprehensive test and demo application is implemented and described in \r
+main_full.c. */\r
+#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY     0\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
+/* Some of the RTOS hook (callback) functions only need special processing when\r
+the full demo is being used.  The simply blinky demo has no special requirements,\r
+so these functions are called from the hook functions defined in this file, but\r
+are defined in main_full.c. */\r
+void vFullDemoTickHookFunction( void );\r
+void vFullDemoIdleFunction( void );\r
+\r
+/* Prototypes for the standard FreeRTOS callback/hook functions implemented\r
+within this file. */\r
+void vApplicationMallocFailedHook( void );\r
+void vApplicationIdleHook( void );\r
+void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName );\r
+void vApplicationTickHook( void );\r
+\r
+/*\r
+ * Writes trace data to a disk file when the trace recording is stopped.\r
+ * This function will simply overwrite any trace files that already exist.\r
+ */\r
+static void prvSaveTraceFile( void );\r
+\r
+/* The user trace event posted to the trace recording on each tick interrupt.\r
+Note tick events will not appear in the trace recording with regular period\r
+because this project runs in a Windows simulator, and does not therefore\r
+exhibit deterministic behaviour. */\r
+traceLabel xTickTraceUserEvent;\r
+static portBASE_TYPE xTraceRunning = pdTRUE;\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
+\r
 int main( void )\r
 {\r
-       /* Start the check task as described at the top of this file. */\r
-       xTaskCreate( prvCheckTask, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
-\r
-       /* Create the standard demo tasks. */\r
-       vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
-       vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
-       vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
-       vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY );\r
-       vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );\r
-       vStartQueuePeekTasks();\r
-       vStartMathTasks( mainFLOP_TASK_PRIORITY );\r
-       vStartRecursiveMutexTasks();\r
-\r
-       /* Start the scheduler itself. */\r
-       vTaskStartScheduler();\r
-\r
-    /* Should never get here unless there was not enough heap space to create \r
-       the idle and other system tasks. */\r
-    return 0;\r
+       /* Initialise the trace recorder and create the label used to post user\r
+       events to the trace recording on each tick interrupt. */\r
+       vTraceInitTraceData();\r
+       xTickTraceUserEvent = xTraceOpenLabel( "tick" );\r
+\r
+       /* Start the trace recording - the recording is written to a file if\r
+       configASSERT() is called. */\r
+       printf( "\r\nTrace started.  Hit a key to dump trace file to disk.\r\n" );\r
+       printf( "Note stdin does not work when using the Eclipse console with MingW.\r\n" );\r
+       fflush( stdout );\r
+       uiTraceStart();\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 prvCheckTask( void *pvParameters )\r
+void vApplicationMallocFailedHook( void )\r
 {\r
-portTickType xNextWakeTime;\r
-const portTickType xCycleFrequency = 2500 / portTICK_RATE_MS;\r
-char *pcStatusMessage = "OK";\r
-\r
-       /* Just to remove compiler warning. */\r
-       ( void ) pvParameters;\r
-\r
-       /* Initialise xNextWakeTime - this only needs to be done once. */\r
-       xNextWakeTime = xTaskGetTickCount();\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
+       vAssertCalled( __LINE__, __FILE__ );\r
+}\r
+/*-----------------------------------------------------------*/\r
 \r
-       for( ;; )\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
+       /* The trace can be stopped with any key press. */\r
+       if( kbhit() != pdFALSE )\r
        {\r
-               /* Place this task in the blocked state until it is time to run again. */\r
-               vTaskDelayUntil( &xNextWakeTime, xCycleFrequency );\r
-\r
-               /* Check the standard demo tasks are running without error. */\r
-           if( xAreIntegerMathsTaskStillRunning() != pdTRUE )\r
-           {\r
-                       pcStatusMessage = "Error: IntMath";\r
-           }   \r
-               else if( xAreGenericQueueTasksStillRunning() != pdTRUE )\r
-               {                       \r
-                       pcStatusMessage = "Error: GenQueue";\r
-               }\r
-               else if( xAreQueuePeekTasksStillRunning() != pdTRUE )\r
-               {\r
-                       pcStatusMessage = "Error: QueuePeek";\r
-               }\r
-               else if( xAreBlockingQueuesStillRunning() != pdTRUE )\r
+               if( xTraceRunning == pdTRUE )\r
                {\r
-                       pcStatusMessage = "Error: BlockQueue";\r
-               }\r
-           else if( xAreSemaphoreTasksStillRunning() != pdTRUE )\r
-           {\r
-                       pcStatusMessage = "Error: SemTest";\r
-           }\r
-           else if( xArePollingQueuesStillRunning() != pdTRUE )\r
-           {\r
-                       pcStatusMessage = "Error: PollQueue";\r
-           }\r
-               else if( xAreMathsTaskStillRunning() != pdPASS )\r
-               {\r
-                       pcStatusMessage = "Error: Flop";\r
-               }\r
-           else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )\r
-           {\r
-                       pcStatusMessage = "Error: RecMutex";\r
+                       vTraceStop();\r
+                       prvSaveTraceFile();\r
+                       xTraceRunning = pdFALSE;\r
                }\r
+       }\r
 \r
-               /* This is the only task that uses stdout so its ok to call printf() \r
-               directly. */\r
-               printf( "%s - %d\r\n", pcStatusMessage, ( int ) xTaskGetTickCount() );\r
-               fflush( stdout ); /* Required by Eclipse console. */\r
+       #if ( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY != 1 )\r
+       {\r
+               /* Call the idle task processing used by the full demo.  The simple\r
+               blinky demo does not use the idle task hook. */\r
+               vFullDemoIdleFunction();\r
        }\r
+       #endif\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-void vApplicationIdleHook( void )\r
+void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName )\r
 {\r
-const unsigned long ulMSToSleep = 5;\r
+       ( void ) pcTaskName;\r
+       ( void ) pxTask;\r
 \r
-       /* Sleep to reduce CPU load, but don't sleep indefinitely in case there are\r
-       tasks waiting to be terminated by the idle task. */\r
-       Sleep( ulMSToSleep );\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
+       vAssertCalled( __LINE__, __FILE__ );\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-void vApplicationMallocFailedHook( void )\r
+void vApplicationTickHook( void )\r
 {\r
-       /* Can be implemented if required, but probably not required in this \r
-       environment and running this demo. */\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
+       #if ( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY != 1 )\r
+       {\r
+               vFullDemoTickHookFunction();\r
+       }\r
+       #endif /* mainCREATE_SIMPLE_BLINKY_DEMO_ONLY */\r
+\r
+       /* Write a user event to the trace log.  \r
+       Note tick events will not appear in the trace recording with regular period\r
+       because this project runs in a Windows simulator, and does not therefore\r
+       exhibit deterministic behaviour.  Windows will run the simulator in \r
+       bursts. */\r
+       vTraceUserEvent( xTickTraceUserEvent );\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-void vApplicationStackOverflowHook( void )\r
+void vAssertCalled( unsigned long ulLine, const char * const pcFileName )\r
 {\r
-       /* Can be implemented if required, but not required in this \r
-       environment and running this demo. */\r
+       /* Parameters are not used. */\r
+       ( void ) ulLine;\r
+       ( void ) pcFileName;\r
+\r
+       taskDISABLE_INTERRUPTS();\r
+       __asm volatile( "int $3" );\r
+\r
+       /* Stop the trace recording. */\r
+       if( xTraceRunning == pdTRUE )\r
+       {\r
+               vTraceStop();\r
+               prvSaveTraceFile();\r
+       }\r
+\r
+       taskENABLE_INTERRUPTS();\r
 }\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvSaveTraceFile( void )\r
+{\r
+FILE* pxOutputFile;\r
 \r
+       pxOutputFile = fopen( "Trace.dump", "wb");\r
+\r
+       if( pxOutputFile != NULL )\r
+       {\r
+               fwrite( RecorderDataPtr, sizeof( RecorderDataType ), 1, pxOutputFile );\r
+               fclose( pxOutputFile );\r
+               printf( "\r\nTrace output saved to Trace.dump\r\n" );\r
+               fflush( stdout );\r
+       }\r
+       else\r
+       {\r
+               printf( "\r\nFailed to create trace dump file\r\n" );\r
+               fflush( stdout );\r
+       }\r
+}\r
diff --git a/FreeRTOS/Demo/WIN32-MingW/main_blinky.c b/FreeRTOS/Demo/WIN32-MingW/main_blinky.c
new file mode 100644 (file)
index 0000000..bc41911
--- /dev/null
@@ -0,0 +1,253 @@
+/*\r
+    FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+    All rights reserved\r
+\r
+    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS provides completely free yet professionally developed,    *\r
+     *    robust, strictly quality controlled, supported, and cross          *\r
+     *    platform software that has become a de facto standard.             *\r
+     *                                                                       *\r
+     *    Help yourself get started quickly and support the FreeRTOS         *\r
+     *    project by purchasing a FreeRTOS tutorial book, reference          *\r
+     *    manual, or both from: http://www.FreeRTOS.org/Documentation        *\r
+     *                                                                       *\r
+     *    Thank you!                                                         *\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
+\r
+    >>! NOTE: The modification to the GPL is included to allow you to distribute\r
+    >>! a combined work that includes FreeRTOS without being obliged to provide\r
+    >>! the source code for proprietary components outside of the FreeRTOS\r
+    >>! kernel.\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  Full license text is available from the following\r
+    link: http://www.freertos.org/a00114.html\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
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
+    license and Real Time Engineers Ltd. contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
+    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
+    Integrity Systems to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
+    licenses offer ticketed support, indemnification and middleware.\r
+\r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
+    engineered and independently SIL3 certified version for use in safety and\r
+    mission critical applications that require provable dependability.\r
+\r
+    1 tab == 4 spaces!\r
+*/\r
+\r
+/******************************************************************************\r
+ * NOTE 1: The Win32 port is a simulation (or is that emulation?) only!  Do not\r
+ * expect to get real time behaviour from the Win32 port or this demo\r
+ * application.  It is provided as a convenient development and demonstration\r
+ * test bed only.  This was tested using Windows XP on a dual core laptop.\r
+ *\r
+ * Windows will not be running the FreeRTOS simulator threads continuously, so \r
+ * the timing information in the FreeRTOS+Trace logs have no meaningful units.  \r
+ * See the documentation page for the Windows simulator for an explanation of \r
+ * the slow timing:\r
+ * http://www.freertos.org/FreeRTOS-Windows-Simulator-Emulator-for-Visual-Studio-and-Eclipse-MingW.html\r
+ * - READ THE WEB DOCUMENTATION FOR THIS PORT FOR MORE INFORMATION ON USING IT -\r
+ *\r
+ * NOTE 2:  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 3:  This file only contains the source code that is specific to the\r
+ * basic demo.  Generic functions, such FreeRTOS hook functions, are defined \r
+ * 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 (simulated as far as the scheduler is concerned, but in\r
+ * reality much longer - see notes above) milliseconds, before sending the \r
+ * value 100 to the queue that was created within main_blinky().  Once the \r
+ * value is sent, the task loops back around to block for another 200 \r
+ * (simulated) 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, outputs a message.  The \r
+ * 'block time' parameter passed to the queue receive function specifies that \r
+ * the task should be held in the Blocked state indefinitely to wait for data \r
+ * to 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 (simulated - see notes above) \r
+ * milliseconds, the queue receive task leaves the Blocked state every 200 \r
+ * milliseconds, and therefore outputs a message 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
+/* 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
+\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
+       /* Remove compiler warning in the case that configASSERT() is not \r
+       defined. */\r
+       ( void ) pvParameters;\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
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvQueueReceiveTask( void *pvParameters )\r
+{\r
+unsigned long ulReceivedValue;\r
+\r
+       /* Remove compiler warning in the case that configASSERT() is not \r
+       defined. */\r
+       ( void ) pvParameters;\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
+                       /* Normally calling printf() from a task is not a good idea.  Here\r
+                       there is lots of stack space and only one task is using console  IO\r
+                       so it is ok. */\r
+                       printf( "Message received\r\n" );\r
+                       fflush( stdout );\r
+                       ulReceivedValue = 0U;\r
+               }\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
diff --git a/FreeRTOS/Demo/WIN32-MingW/main_full.c b/FreeRTOS/Demo/WIN32-MingW/main_full.c
new file mode 100644 (file)
index 0000000..90fbe4e
--- /dev/null
@@ -0,0 +1,555 @@
+/*\r
+    FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+    All rights reserved\r
+\r
+    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS provides completely free yet professionally developed,    *\r
+     *    robust, strictly quality controlled, supported, and cross          *\r
+     *    platform software that has become a de facto standard.             *\r
+     *                                                                       *\r
+     *    Help yourself get started quickly and support the FreeRTOS         *\r
+     *    project by purchasing a FreeRTOS tutorial book, reference          *\r
+     *    manual, or both from: http://www.FreeRTOS.org/Documentation        *\r
+     *                                                                       *\r
+     *    Thank you!                                                         *\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
+\r
+    >>! NOTE: The modification to the GPL is included to allow you to distribute\r
+    >>! a combined work that includes FreeRTOS without being obliged to provide\r
+    >>! the source code for proprietary components outside of the FreeRTOS\r
+    >>! kernel.\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  Full license text is available from the following\r
+    link: http://www.freertos.org/a00114.html\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
+    http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
+    license and Real Time Engineers Ltd. contact details.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
+    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
+    Integrity Systems to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
+    licenses offer ticketed support, indemnification and middleware.\r
+\r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
+    engineered and independently SIL3 certified version for use in safety and\r
+    mission critical applications that require provable dependability.\r
+\r
+    1 tab == 4 spaces!\r
+*/\r
+\r
+/*\r
+ *******************************************************************************\r
+ * NOTE 1: The Win32 port is a simulation (or is that emulation?) only!  Do not\r
+ * expect to get real time behaviour from the Win32 port or this demo\r
+ * application.  It is provided as a convenient development and demonstration\r
+ * test bed only.  This was tested using Windows XP on a dual core laptop.\r
+ *\r
+ * Windows will not be running the FreeRTOS simulator threads continuously, so \r
+ * the timing information in the FreeRTOS+Trace logs have no meaningful units.  \r
+ * See the documentation page for the Windows simulator for an explanation of \r
+ * the slow timing:\r
+ * http://www.freertos.org/FreeRTOS-Windows-Simulator-Emulator-for-Visual-Studio-and-Eclipse-MingW.html\r
+ * - READ THE WEB DOCUMENTATION FOR THIS PORT FOR MORE INFORMATION ON USING IT -\r
+ *\r
+ * NOTE 2:  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 comprehensive test and demo version.\r
+ *\r
+ * NOTE 3:  This file only contains the source code that is specific to the\r
+ * basic demo.  Generic functions, such FreeRTOS hook functions, are defined in \r
+ * main.c.\r
+ *******************************************************************************\r
+ *\r
+ * main() creates all the demo application tasks, then starts the scheduler.  \r
+ * The web documentation provides more details of the standard demo application \r
+ * tasks, which provide no particular functionality but do provide a good \r
+ * example of how to use the FreeRTOS API.\r
+ *\r
+ * In addition to the standard demo tasks, the following tasks and tests are\r
+ * defined and/or created within this file:\r
+ *\r
+ * "Check" task - This only executes every five seconds but has a high priority\r
+ * to ensure it gets processor time.  Its main function is to check that all the\r
+ * standard demo tasks are still operational.  While no errors have been\r
+ * discovered the check task will print out "OK" and the current simulated tick\r
+ * time.  If an error is discovered in the execution of a task then the check\r
+ * task will print out an appropriate error message.\r
+ *\r
+ */\r
+\r
+\r
+/* Standard includes. */\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+\r
+/* Kernel includes. */\r
+#include <FreeRTOS.h>\r
+#include "task.h"\r
+#include "queue.h"\r
+#include "timers.h"\r
+#include "semphr.h"\r
+\r
+/* Standard demo includes. */\r
+#include "BlockQ.h"\r
+#include "integer.h"\r
+#include "semtest.h"\r
+#include "PollQ.h"\r
+#include "GenQTest.h"\r
+#include "QPeek.h"\r
+#include "recmutex.h"\r
+#include "flop.h"\r
+#include "TimerDemo.h"\r
+#include "countsem.h"\r
+#include "death.h"\r
+#include "dynamic.h"\r
+#include "QueueSet.h"\r
+#include "QueueOverwrite.h"\r
+#include "EventGroupsDemo.h"\r
+\r
+/* Priorities at which the tasks are created. */\r
+#define mainCHECK_TASK_PRIORITY                        ( configMAX_PRIORITIES - 1 )\r
+#define mainQUEUE_POLL_PRIORITY                        ( tskIDLE_PRIORITY + 1 )\r
+#define mainSEM_TEST_PRIORITY                  ( tskIDLE_PRIORITY + 1 )\r
+#define mainBLOCK_Q_PRIORITY                   ( tskIDLE_PRIORITY + 2 )\r
+#define mainCREATOR_TASK_PRIORITY              ( tskIDLE_PRIORITY + 3 )\r
+#define mainFLASH_TASK_PRIORITY                        ( tskIDLE_PRIORITY + 1 )\r
+#define mainuIP_TASK_PRIORITY                  ( tskIDLE_PRIORITY + 2 )\r
+#define mainINTEGER_TASK_PRIORITY              ( tskIDLE_PRIORITY )\r
+#define mainGEN_QUEUE_TASK_PRIORITY            ( tskIDLE_PRIORITY )\r
+#define mainFLOP_TASK_PRIORITY                 ( tskIDLE_PRIORITY )\r
+#define mainQUEUE_OVERWRITE_PRIORITY   ( tskIDLE_PRIORITY )\r
+\r
+#define mainTIMER_TEST_PERIOD                  ( 50 )\r
+\r
+/* Task function prototypes. */\r
+static void prvCheckTask( void *pvParameters );\r
+\r
+/* A task that is created from the idle task to test the functionality of \r
+eTaskStateGet(). */\r
+static void prvTestTask( void *pvParameters );\r
+\r
+/*\r
+ * Called from the idle task hook function to demonstrate a few utility\r
+ * functions that are not demonstrated by any of the standard demo tasks.\r
+ */\r
+static void prvDemonstrateTaskStateAndHandleGetFunctions( void );\r
+\r
+/*\r
+ * A task to demonstrate the use of the xQueueSpacesAvailable() function.\r
+ */\r
+static void prvDemoQueueSpaceFunctions( void *pvParameters );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/* The variable into which error messages are latched. */\r
+static char *pcStatusMessage = "OK";\r
+\r
+/* This semaphore is created purely to test using the vSemaphoreDelete() and\r
+semaphore tracing API functions.  It has no other purpose. */\r
+static xSemaphoreHandle xMutexToDelete = NULL;\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+int main_full( void )\r
+{\r
+       /* Start the check task as described at the top of this file. */\r
+       xTaskCreate( prvCheckTask, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+\r
+       /* Create the standard demo tasks. */\r
+       vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
+       vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
+       vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
+       vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY );\r
+       vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );\r
+       vStartQueuePeekTasks();\r
+       vStartMathTasks( mainFLOP_TASK_PRIORITY );\r
+       vStartRecursiveMutexTasks();\r
+       vStartCountingSemaphoreTasks();\r
+       vStartDynamicPriorityTasks();\r
+       vStartQueueSetTasks();\r
+       vStartQueueOverwriteTask( mainQUEUE_OVERWRITE_PRIORITY );\r
+       xTaskCreate( prvDemoQueueSpaceFunctions, ( signed char * ) "QSpace", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+       vStartEventGroupTasks();\r
+\r
+       #if( configUSE_PREEMPTION != 0  )\r
+       {\r
+               /* Don't expect these tasks to pass when preemption is not used. */\r
+               vStartTimerDemoTask( mainTIMER_TEST_PERIOD );\r
+       }\r
+       #endif\r
+\r
+       /* The suicide tasks must be created last as they need to know how many\r
+       tasks were running prior to their creation.  This then allows them to\r
+       ascertain whether or not the correct/expected number of tasks are running at\r
+       any given time. */\r
+       vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
+\r
+       /* Create the semaphore that will be deleted in the idle task hook.  This\r
+       is done purely to test the use of vSemaphoreDelete(). */\r
+       xMutexToDelete = xSemaphoreCreateMutex();\r
+\r
+       /* Start the scheduler itself. */\r
+       vTaskStartScheduler();\r
+\r
+    /* Should never get here unless there was not enough heap space to create \r
+       the idle and other system tasks. */\r
+    return 0;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvCheckTask( void *pvParameters )\r
+{\r
+portTickType xNextWakeTime;\r
+const portTickType xCycleFrequency = 2500 / portTICK_RATE_MS;\r
+\r
+       /* Just to remove compiler warning. */\r
+       ( void ) pvParameters;\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
+               vTaskDelayUntil( &xNextWakeTime, xCycleFrequency );\r
+\r
+               /* Check the standard demo tasks are running without error. */\r
+               #if( configUSE_PREEMPTION != 0 )\r
+               {\r
+                       /* These tasks are only created when preemption is used. */\r
+                       if( xAreTimerDemoTasksStillRunning( xCycleFrequency ) != pdTRUE )\r
+                       {\r
+                               pcStatusMessage = "Error: TimerDemo";\r
+                       }\r
+               }\r
+               #endif\r
+\r
+               if( xAreEventGroupTasksStillRunning() != pdTRUE )\r
+               {\r
+                       pcStatusMessage = "Error: EventGroup";\r
+               }\r
+           else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )\r
+           {\r
+                       pcStatusMessage = "Error: IntMath";\r
+           }   \r
+               else if( xAreGenericQueueTasksStillRunning() != pdTRUE )\r
+               {                       \r
+                       pcStatusMessage = "Error: GenQueue";\r
+               }\r
+               else if( xAreQueuePeekTasksStillRunning() != pdTRUE )\r
+               {\r
+                       pcStatusMessage = "Error: QueuePeek";\r
+               }\r
+               else if( xAreBlockingQueuesStillRunning() != pdTRUE )\r
+               {\r
+                       pcStatusMessage = "Error: BlockQueue";\r
+               }\r
+           else if( xAreSemaphoreTasksStillRunning() != pdTRUE )\r
+           {\r
+                       pcStatusMessage = "Error: SemTest";\r
+           }\r
+           else if( xArePollingQueuesStillRunning() != pdTRUE )\r
+           {\r
+                       pcStatusMessage = "Error: PollQueue";\r
+           }\r
+               else if( xAreMathsTaskStillRunning() != pdPASS )\r
+               {\r
+                       pcStatusMessage = "Error: Flop";\r
+               }\r
+           else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )\r
+           {\r
+                       pcStatusMessage = "Error: RecMutex";\r
+               }\r
+               else if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE )\r
+               {\r
+                       pcStatusMessage = "Error: CountSem";\r
+               }\r
+               else if( xIsCreateTaskStillRunning() != pdTRUE )\r
+               {\r
+                       pcStatusMessage = "Error: Death";\r
+               }\r
+               else if( xAreDynamicPriorityTasksStillRunning() != pdPASS )\r
+               {\r
+                       pcStatusMessage = "Error: Dynamic";\r
+               }\r
+               else if( xAreQueueSetTasksStillRunning() != pdPASS )\r
+               {\r
+                       pcStatusMessage = "Error: Queue set";\r
+               }\r
+               else if( xIsQueueOverwriteTaskStillRunning() != pdPASS )\r
+               {\r
+                       pcStatusMessage = "Error: Queue overwrite";\r
+               }\r
+\r
+               /* This is the only task that uses stdout so its ok to call printf() \r
+               directly. */\r
+               printf( ( char * ) "%s - %u\r\n", pcStatusMessage, ( unsigned int ) xTaskGetTickCount() );\r
+               fflush( stdout );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvTestTask( void *pvParameters )\r
+{\r
+const unsigned long ulMSToSleep = 5;\r
+\r
+       /* Just to remove compiler warnings. */\r
+       ( void ) pvParameters;\r
+\r
+       /* This task is just used to test the eTaskStateGet() function.  It\r
+       does not have anything to do. */\r
+       for( ;; )\r
+       {\r
+               /* Sleep to reduce CPU load, but don't sleep indefinitely in case there are\r
+               tasks waiting to be terminated by the idle task. */\r
+               Sleep( ulMSToSleep );\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+/* Called from vApplicationIdleHook(), which is defined in main.c. */\r
+void vFullDemoIdleFunction( void )\r
+{\r
+const unsigned long ulMSToSleep = 15;\r
+const unsigned portBASE_TYPE uxConstQueueNumber = 0xaaU;\r
+void *pvAllocated;\r
+\r
+/* These three functions are only meant for use by trace code, and not for\r
+direct use from application code, hence their prototypes are not in queue.h. */\r
+extern void vQueueSetQueueNumber( xQueueHandle pxQueue, unsigned portBASE_TYPE uxQueueNumber );\r
+extern unsigned portBASE_TYPE uxQueueGetQueueNumber( xQueueHandle pxQueue );\r
+extern unsigned char ucQueueGetQueueType( xQueueHandle pxQueue );\r
+extern void vTaskSetTaskNumber( xTaskHandle xTask, unsigned portBASE_TYPE uxHandle );\r
+extern unsigned portBASE_TYPE uxTaskGetTaskNumber( xTaskHandle xTask );\r
+\r
+       /* Sleep to reduce CPU load, but don't sleep indefinitely in case there are\r
+       tasks waiting to be terminated by the idle task. */\r
+       Sleep( ulMSToSleep );\r
+\r
+       /* Demonstrate a few utility functions that are not demonstrated by any of\r
+       the standard demo tasks. */\r
+       prvDemonstrateTaskStateAndHandleGetFunctions();\r
+\r
+       /* If xMutexToDelete has not already been deleted, then delete it now.\r
+       This is done purely to demonstrate the use of, and test, the \r
+       vSemaphoreDelete() macro.  Care must be taken not to delete a semaphore\r
+       that has tasks blocked on it. */\r
+       if( xMutexToDelete != NULL )\r
+       {\r
+               /* Before deleting the semaphore, test the function used to set its\r
+               number.  This would normally only be done from trace software, rather\r
+               than application code. */\r
+               vQueueSetQueueNumber( xMutexToDelete, uxConstQueueNumber );\r
+\r
+               /* Before deleting the semaphore, test the functions used to get its\r
+               type and number.  Again, these would normally only be done from trace\r
+               software, rather than application code. */\r
+               configASSERT( uxQueueGetQueueNumber( xMutexToDelete ) == uxConstQueueNumber );\r
+               configASSERT( ucQueueGetQueueType( xMutexToDelete ) == queueQUEUE_TYPE_MUTEX );\r
+               vSemaphoreDelete( xMutexToDelete );\r
+               xMutexToDelete = NULL;\r
+       }\r
+\r
+       /* Exercise heap_4 a bit.  The malloc failed hook will trap failed \r
+       allocations so there is no need to test here. */\r
+       pvAllocated = pvPortMalloc( ( rand() % 100 ) + 1 );\r
+       vPortFree( pvAllocated );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+/* Called by vApplicationTickHook(), which is defined in main.c. */\r
+void vFullDemoTickHookFunction( void )\r
+{\r
+       /* Call the periodic timer test, which tests the timer API functions that\r
+       can be called from an ISR. */\r
+       #if( configUSE_PREEMPTION != 0 )\r
+       {\r
+               /* Only created when preemption is used. */\r
+               vTimerPeriodicISRTests();\r
+       }\r
+       #endif\r
+\r
+       /* Call the periodic queue overwrite from ISR demo. */\r
+       vQueueOverwritePeriodicISRDemo();\r
+\r
+       /* Write to a queue that is in use as part of the queue set demo to \r
+       demonstrate using queue sets from an ISR. */\r
+       vQueueSetAccessQueueSetFromISR();\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvDemonstrateTaskStateAndHandleGetFunctions( void )\r
+{\r
+xTaskHandle xIdleTaskHandle, xTimerTaskHandle;\r
+const unsigned char ucConstTaskNumber = 0x55U;\r
+signed char *pcTaskName;\r
+static portBASE_TYPE xPerformedOneShotTests = pdFALSE;\r
+xTaskHandle xTestTask;\r
+\r
+       /* Demonstrate the use of the xTimerGetTimerDaemonTaskHandle() and \r
+       xTaskGetIdleTaskHandle() functions.  Also try using the function that sets\r
+       the task number. */\r
+       xIdleTaskHandle = xTaskGetIdleTaskHandle();\r
+       xTimerTaskHandle = xTimerGetTimerDaemonTaskHandle();\r
+       vTaskSetTaskNumber( xIdleTaskHandle, ( unsigned long ) ucConstTaskNumber );\r
+       configASSERT( uxTaskGetTaskNumber( xIdleTaskHandle ) == ucConstTaskNumber );\r
+\r
+       /* This is the idle hook, so the current task handle should equal the \r
+       returned idle task handle. */\r
+       if( xTaskGetCurrentTaskHandle() != xIdleTaskHandle )\r
+       {\r
+               pcStatusMessage = "Error:  Returned idle task handle was incorrect";\r
+       }\r
+\r
+       /* Check the timer task handle was returned correctly. */\r
+       pcTaskName = pcTaskGetTaskName( xTimerTaskHandle );\r
+       if( strcmp( ( char * ) pcTaskName, "Tmr Svc" ) != 0 )\r
+       {\r
+               pcStatusMessage = "Error:  Returned timer task handle was incorrect";\r
+       }\r
+\r
+       /* This task is running, make sure it's state is returned as running. */\r
+       if( eTaskStateGet( xIdleTaskHandle ) != eRunning )\r
+       {\r
+               pcStatusMessage = "Error:  Returned idle task state was incorrect";\r
+       }\r
+\r
+       /* If this task is running, then the timer task must be blocked. */\r
+       if( eTaskStateGet( xTimerTaskHandle ) != eBlocked )\r
+       {\r
+               pcStatusMessage = "Error:  Returned timer task state was incorrect";\r
+       }\r
+\r
+       /* Other tests that should only be performed once follow.  The test task\r
+       is not created on each iteration because to do so would cause the death\r
+       task to report an error (too many tasks running). */\r
+       if( xPerformedOneShotTests == pdFALSE )\r
+       {\r
+               /* Don't run this part of the test again. */\r
+               xPerformedOneShotTests = pdTRUE;\r
+\r
+               /* Create a test task to use to test other eTaskStateGet() return values. */\r
+               if( xTaskCreate( prvTestTask, ( const signed char * const ) "Test", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xTestTask ) == pdPASS )\r
+               {\r
+                       /* If this task is running, the test task must be in the ready state. */\r
+                       if( eTaskStateGet( xTestTask ) != eReady )\r
+                       {\r
+                               pcStatusMessage = "Error: Returned test task state was incorrect 1";\r
+                       }\r
+\r
+                       /* Now suspend the test task and check its state is reported correctly. */\r
+                       vTaskSuspend( xTestTask );\r
+                       if( eTaskStateGet( xTestTask ) != eSuspended )\r
+                       {\r
+                               pcStatusMessage = "Error: Returned test task state was incorrect 2";\r
+                       }\r
+\r
+                       /* Now delete the task and check its state is reported correctly. */\r
+                       vTaskDelete( xTestTask );\r
+                       if( eTaskStateGet( xTestTask ) != eDeleted )\r
+                       {\r
+                               pcStatusMessage = "Error: Returned test task state was incorrect 3";\r
+                       }\r
+               }\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvDemoQueueSpaceFunctions( void *pvParameters )\r
+{\r
+xQueueHandle xQueue = NULL;\r
+const unsigned portBASE_TYPE uxQueueLength = 10;\r
+unsigned portBASE_TYPE uxReturn, x;\r
+\r
+       /* Remove compiler warnings. */\r
+       ( void ) pvParameters;\r
+\r
+       /* Create the queue that will be used.  Nothing is actually going to be\r
+       sent or received so the queue item size is set to 0. */\r
+       xQueue = xQueueCreate( uxQueueLength, 0 );\r
+       configASSERT( xQueue );\r
+\r
+       for( ;; )\r
+       {\r
+               for( x = 0; x < uxQueueLength; x++ )\r
+               {\r
+                       /* Ask how many messages are available... */\r
+                       uxReturn = uxQueueMessagesWaiting( xQueue );\r
+                       \r
+                       /* Check the number of messages being reported as being available\r
+                       is as expected, and force an assert if not. */\r
+                       if( uxReturn != x )\r
+                       {\r
+                               /* xQueue cannot be NULL so this is deliberately causing an\r
+                               assert to be triggered as there is an error. */\r
+                               configASSERT( xQueue == NULL );\r
+                       }\r
+\r
+                       /* Ask how many spaces remain in the queue... */\r
+                       uxReturn = uxQueueSpacesAvailable( xQueue );\r
+                       \r
+                       /* Check the number of spaces being reported as being available\r
+                       is as expected, and force an assert if not. */\r
+                       if( uxReturn != ( uxQueueLength - x ) )\r
+                       {\r
+                               /* xQueue cannot be NULL so this is deliberately causing an\r
+                               assert to be triggered as there is an error. */\r
+                               configASSERT( xQueue == NULL );\r
+                       }\r
+\r
+                       /* Fill one more space in the queue. */\r
+                       xQueueSendToBack( xQueue, NULL, 0 );\r
+               }\r
+\r
+               /* Perform the same check while the queue is full. */\r
+               uxReturn = uxQueueMessagesWaiting( xQueue );\r
+               if( uxReturn != uxQueueLength )\r
+               {\r
+                       configASSERT( xQueue == NULL );\r
+               }\r
+\r
+               uxReturn = uxQueueSpacesAvailable( xQueue );\r
+                       \r
+               if( uxReturn != 0 )\r
+               {\r
+                       configASSERT( xQueue == NULL );\r
+               }\r
+\r
+               /* The queue is full, start again. */\r
+               xQueueReset( xQueue );\r
+\r
+               #if( configUSE_PREEMPTION == 0 )\r
+                       taskYIELD();\r
+               #endif\r
+       }\r
+}\r
+\r
+\r