Fix Xtensa project file and some documentation improvements.

This commit is contained in:
Gaurav Aggarwal 2018-10-02 23:54:51 +00:00
parent c6de0001fa
commit 1af80854e6
9 changed files with 641 additions and 700 deletions

View file

@ -1,220 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<buildSystem id="Xtensa.600602548">
<storageModule id="Xtensa.600602548" moduleId="org.eclipse.cdt.core.settings"/>
</buildSystem>
<cconfiguration id="Xtensa.600602548">
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration buildProperties="" description="" errorParsers="org.eclipse.cdt.core.VCErrorParser;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.CWDLocator;com.tensilica.xide.cdt.XCCErrorParser;org.eclipse.cdt.core.GASErrorParser;com.tensilica.xide.cdt.XtLDErrorParser;com.tensilica.xide.cdt.TCErrorParser;com.tensilica.xide.cdt.FlexLmErrorParser" id="Xtensa.600602548" name="Xtensa" parent="org.eclipse.cdt.build.core.prefbase.cfg">
<folderInfo id="Xtensa.600602548." name="/" resourcePath="">
<toolChain errorParsers="" id="org.eclipse.cdt.build.core.prefbase.toolchain.1124911838" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
<targetPlatform binaryParser="com.tensilica.xide.cdt.XtensaELF" id="org.eclipse.cdt.build.core.prefbase.toolchain.1124911838.1653706502" name=""/>
<builder command="${default_xttools_make_path}" enableAutoBuild="false" errorParsers="org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.CWDLocator" id="org.eclipse.cdt.build.core.settings.default.builder.1420142413" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder">
<outputEntries>
<entry excluding="**/.genned|**/*.pstamp|**/*.props|**/*.d|**/objFiles.list|**/*.interlock|**/*.icmiss|**/*.dcmiss|**/*.icmiss_cyc|**/*.dcmiss_cyc|**/*.cc_miss|**/*.cc_miss_cyc|**/*.cyc|**/*.insn|**/*.bdelay" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="bin"/>
</outputEntries>
</builder>
<tool errorParsers="org.eclipse.cdt.core.VCErrorParser;org.eclipse.cdt.core.GASErrorParser" id="org.eclipse.cdt.build.core.settings.holder.libs.283188354" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
<tool errorParsers="org.eclipse.cdt.core.VCErrorParser;org.eclipse.cdt.core.GASErrorParser" id="org.eclipse.cdt.build.core.settings.holder.1363672131" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.818579882" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
<listOptionValue builtIn="false" value="C:/devtools/xtensa/XtDevTools/install/builds/RG-2017.8-win32/sample_controller/xtensa-elf/arch/include"/>
<listOptionValue builtIn="false" value="C:/devtools/xtensa/XtDevTools/install/builds/RG-2017.8-win32/sample_controller/xtensa-elf/include"/>
<listOptionValue builtIn="false" value="C:/devtools/xtensa/XtDevTools/install/tools/RG-2017.8-win32/XtensaTools/lib/xcc/include"/>
<listOptionValue builtIn="false" value="C:/devtools/xtensa/XtDevTools/install/tools/RG-2017.8-win32/XtensaTools/xtensa-elf/include"/>
<listOptionValue builtIn="false" value="C:/devtools/xtensa/XtDevTools/install/builds/RG-2017.8-win32/sample_controller/xtensa-elf/include/xcc/c++"/>
<listOptionValue builtIn="false" value="C:/devtools/xtensa/XtDevTools/install/builds/RG-2017.8-win32/sample_controller/xtensa-elf/include/xcc/c++/xtensa-elf"/>
<listOptionValue builtIn="false" value="C:/Users/ribarry/Dev/FreeRTOS/WorkingCopy/FreeRTOS/Demo/Tensilica_Simulator_Xplorer_XCC"/>
<listOptionValue builtIn="false" value="C:/Users/ribarry/Dev/FreeRTOS/WorkingCopy/FreeRTOS/Demo/Common/include"/>
<listOptionValue builtIn="false" value="C:/Users/ribarry/Dev/FreeRTOS/WorkingCopy/FreeRTOS/Source/include"/>
<listOptionValue builtIn="false" value="C:/Users/ribarry/Dev/FreeRTOS/WorkingCopy/FreeRTOS/Source/portable/XCC/Xtensa"/>
<listOptionValue builtIn="false" value="&quot;../${workspace_loc:RTOSDemo\FreeRTOS_Source\include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;../${workspace_loc:RTOSDemo\FreeRTOS_Source\portable\XCC}&quot;"/>
<listOptionValue builtIn="false" value="&quot;C:\Users\ribarry\Dev\FreeRTOS\WorkingCopy\FreeRTOS\Demo\Tensilica_Simulator_Xplorer_XCC&quot;"/>
</option>
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.1072492848" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__CHAR_BIT__=8"/>
<listOptionValue builtIn="false" value="__WCHAR_MAX__=65535U"/>
<listOptionValue builtIn="false" value="__FLT_EVAL_METHOD__=0"/>
<listOptionValue builtIn="false" value="__FINITE_MATH_ONLY__=0"/>
<listOptionValue builtIn="false" value="__GNUC_PATCHLEVEL__=0"/>
<listOptionValue builtIn="false" value="__SHRT_MAX__=32767"/>
<listOptionValue builtIn="false" value="__UINTMAX_TYPE__=long"/>
<listOptionValue builtIn="false" value="__CHAR_UNSIGNED__=1"/>
<listOptionValue builtIn="false" value="__XCC__=12000"/>
<listOptionValue builtIn="false" value="__SCHAR_MAX__=127"/>
<listOptionValue builtIn="false" value="__USER_LABEL_PREFIX__"/>
<listOptionValue builtIn="false" value="__STDC_HOSTED__=1"/>
<listOptionValue builtIn="false" value="__XTENSA_EL__=1"/>
<listOptionValue builtIn="false" value="__XCC_MINOR__=8"/>
<listOptionValue builtIn="false" value="__GNUC__=4"/>
<listOptionValue builtIn="false" value="__LONG_LONG_MAX__=9223372036854775807LL"/>
<listOptionValue builtIn="false" value="__GXX_ABI_VERSION=1002"/>
<listOptionValue builtIn="false" value="__REGISTER_PREFIX__"/>
<listOptionValue builtIn="false" value="__NO_INLINE__=1"/>
<listOptionValue builtIn="false" value="__VERSION__=&quot;4.2.0"/>
<listOptionValue builtIn="false" value="__XTENSA_SOFT_FLOAT__=1"/>
<listOptionValue builtIn="false" value="__SIZE_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__ELF__=1"/>
<listOptionValue builtIn="false" value="__xtensa__=1"/>
<listOptionValue builtIn="false" value="__LONG_MAX__=2147483647L"/>
<listOptionValue builtIn="false" value="__WCHAR_TYPE__=short"/>
<listOptionValue builtIn="false" value="__INT_MAX__=2147483647"/>
<listOptionValue builtIn="false" value="__WINT_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__XTENSA_WINDOWED_ABI__=1"/>
<listOptionValue builtIn="false" value="__XTENSA__=1"/>
<listOptionValue builtIn="false" value="__INTMAX_MAX__=9223372036854775807LL"/>
<listOptionValue builtIn="false" value="__INTMAX_TYPE__=long"/>
<listOptionValue builtIn="false" value="__XTENSA_SOFT_DOUBLE__=1"/>
<listOptionValue builtIn="false" value="__GNUC_MINOR__=2"/>
<listOptionValue builtIn="false" value="__STDC__=1"/>
<listOptionValue builtIn="false" value="__PTRDIFF_TYPE__=int"/>
<listOptionValue builtIn="false" value="__GNUC_GNU_INLINE__=1"/>
</option>
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1208833786" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
<tool errorParsers="org.eclipse.cdt.core.VCErrorParser;org.eclipse.cdt.core.GASErrorParser" id="org.eclipse.cdt.build.core.settings.holder.29534978" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1529034681" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
<listOptionValue builtIn="false" value="C:/devtools/xtensa/XtDevTools/install/builds/RG-2017.8-win32/sample_controller/xtensa-elf/arch/include"/>
<listOptionValue builtIn="false" value="C:/devtools/xtensa/XtDevTools/install/builds/RG-2017.8-win32/sample_controller/xtensa-elf/include"/>
<listOptionValue builtIn="false" value="C:/devtools/xtensa/XtDevTools/install/tools/RG-2017.8-win32/XtensaTools/lib/xcc/include"/>
<listOptionValue builtIn="false" value="C:/devtools/xtensa/XtDevTools/install/tools/RG-2017.8-win32/XtensaTools/xtensa-elf/include"/>
<listOptionValue builtIn="false" value="C:/devtools/xtensa/XtDevTools/install/builds/RG-2017.8-win32/sample_controller/xtensa-elf/include/xcc/c++"/>
<listOptionValue builtIn="false" value="C:/devtools/xtensa/XtDevTools/install/builds/RG-2017.8-win32/sample_controller/xtensa-elf/include/xcc/c++/xtensa-elf"/>
<listOptionValue builtIn="false" value="C:/Users/ribarry/Dev/FreeRTOS/WorkingCopy/FreeRTOS/Demo/Tensilica_Simulator_Xplorer_XCC"/>
<listOptionValue builtIn="false" value="C:/Users/ribarry/Dev/FreeRTOS/WorkingCopy/FreeRTOS/Demo/Common/include"/>
<listOptionValue builtIn="false" value="C:/Users/ribarry/Dev/FreeRTOS/WorkingCopy/FreeRTOS/Source/include"/>
<listOptionValue builtIn="false" value="C:/Users/ribarry/Dev/FreeRTOS/WorkingCopy/FreeRTOS/Source/portable/XCC/Xtensa"/>
<listOptionValue builtIn="false" value="&quot;../${workspace_loc:RTOSDemo\FreeRTOS_Source\include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;../${workspace_loc:RTOSDemo\FreeRTOS_Source\portable\XCC}&quot;"/>
<listOptionValue builtIn="false" value="&quot;C:\Users\ribarry\Dev\FreeRTOS\WorkingCopy\FreeRTOS\Demo\Tensilica_Simulator_Xplorer_XCC&quot;"/>
</option>
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.459736431" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__CHAR_BIT__=8"/>
<listOptionValue builtIn="false" value="__WCHAR_MAX__=65535U"/>
<listOptionValue builtIn="false" value="__FLT_EVAL_METHOD__=0"/>
<listOptionValue builtIn="false" value="__FINITE_MATH_ONLY__=0"/>
<listOptionValue builtIn="false" value="__GNUC_PATCHLEVEL__=0"/>
<listOptionValue builtIn="false" value="__SHRT_MAX__=32767"/>
<listOptionValue builtIn="false" value="__UINTMAX_TYPE__=long"/>
<listOptionValue builtIn="false" value="__CHAR_UNSIGNED__=1"/>
<listOptionValue builtIn="false" value="__XCC__=12000"/>
<listOptionValue builtIn="false" value="__SCHAR_MAX__=127"/>
<listOptionValue builtIn="false" value="__USER_LABEL_PREFIX__"/>
<listOptionValue builtIn="false" value="__STDC_HOSTED__=1"/>
<listOptionValue builtIn="false" value="__XTENSA_EL__=1"/>
<listOptionValue builtIn="false" value="__XCC_MINOR__=8"/>
<listOptionValue builtIn="false" value="__GNUC__=4"/>
<listOptionValue builtIn="false" value="__LONG_LONG_MAX__=9223372036854775807LL"/>
<listOptionValue builtIn="false" value="__GXX_ABI_VERSION=1002"/>
<listOptionValue builtIn="false" value="__REGISTER_PREFIX__"/>
<listOptionValue builtIn="false" value="__NO_INLINE__=1"/>
<listOptionValue builtIn="false" value="__VERSION__=&quot;4.2.0"/>
<listOptionValue builtIn="false" value="__XTENSA_SOFT_FLOAT__=1"/>
<listOptionValue builtIn="false" value="__SIZE_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__ELF__=1"/>
<listOptionValue builtIn="false" value="__xtensa__=1"/>
<listOptionValue builtIn="false" value="__LONG_MAX__=2147483647L"/>
<listOptionValue builtIn="false" value="__WCHAR_TYPE__=short"/>
<listOptionValue builtIn="false" value="__INT_MAX__=2147483647"/>
<listOptionValue builtIn="false" value="__WINT_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__XTENSA_WINDOWED_ABI__=1"/>
<listOptionValue builtIn="false" value="__XTENSA__=1"/>
<listOptionValue builtIn="false" value="__INTMAX_MAX__=9223372036854775807LL"/>
<listOptionValue builtIn="false" value="__INTMAX_TYPE__=long"/>
<listOptionValue builtIn="false" value="__XTENSA_SOFT_DOUBLE__=1"/>
<listOptionValue builtIn="false" value="__GNUC_MINOR__=2"/>
<listOptionValue builtIn="false" value="__STDC__=1"/>
<listOptionValue builtIn="false" value="__PTRDIFF_TYPE__=int"/>
<listOptionValue builtIn="false" value="__GNUC_GNU_INLINE__=1"/>
</option>
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1865337768" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
<tool errorParsers="org.eclipse.cdt.core.VCErrorParser;org.eclipse.cdt.core.GASErrorParser" id="org.eclipse.cdt.build.core.settings.holder.541186543" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.2101310742" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
<listOptionValue builtIn="false" value="C:/devtools/xtensa/XtDevTools/install/builds/RG-2017.8-win32/sample_controller/xtensa-elf/arch/include"/>
<listOptionValue builtIn="false" value="C:/devtools/xtensa/XtDevTools/install/builds/RG-2017.8-win32/sample_controller/xtensa-elf/include"/>
<listOptionValue builtIn="false" value="C:/devtools/xtensa/XtDevTools/install/tools/RG-2017.8-win32/XtensaTools/lib/xcc/include"/>
<listOptionValue builtIn="false" value="C:/devtools/xtensa/XtDevTools/install/tools/RG-2017.8-win32/XtensaTools/xtensa-elf/include"/>
<listOptionValue builtIn="false" value="C:/devtools/xtensa/XtDevTools/install/builds/RG-2017.8-win32/sample_controller/xtensa-elf/include/xcc/c++"/>
<listOptionValue builtIn="false" value="C:/devtools/xtensa/XtDevTools/install/builds/RG-2017.8-win32/sample_controller/xtensa-elf/include/xcc/c++/xtensa-elf"/>
<listOptionValue builtIn="false" value="C:/Users/ribarry/Dev/FreeRTOS/WorkingCopy/FreeRTOS/Demo/Tensilica_Simulator_Xplorer_XCC"/>
<listOptionValue builtIn="false" value="C:/Users/ribarry/Dev/FreeRTOS/WorkingCopy/FreeRTOS/Demo/Common/include"/>
<listOptionValue builtIn="false" value="C:/Users/ribarry/Dev/FreeRTOS/WorkingCopy/FreeRTOS/Source/include"/>
<listOptionValue builtIn="false" value="C:/Users/ribarry/Dev/FreeRTOS/WorkingCopy/FreeRTOS/Source/portable/XCC/Xtensa"/>
<listOptionValue builtIn="false" value="&quot;../${workspace_loc:RTOSDemo\FreeRTOS_Source\include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;../${workspace_loc:RTOSDemo\FreeRTOS_Source\portable\XCC}&quot;"/>
<listOptionValue builtIn="false" value="&quot;C:\Users\ribarry\Dev\FreeRTOS\WorkingCopy\FreeRTOS\Demo\Tensilica_Simulator_Xplorer_XCC&quot;"/>
</option>
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.740810983" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__CHAR_BIT__=8"/>
<listOptionValue builtIn="false" value="__WCHAR_MAX__=65535U"/>
<listOptionValue builtIn="false" value="__FLT_EVAL_METHOD__=0"/>
<listOptionValue builtIn="false" value="__FINITE_MATH_ONLY__=0"/>
<listOptionValue builtIn="false" value="__GNUC_PATCHLEVEL__=0"/>
<listOptionValue builtIn="false" value="__SHRT_MAX__=32767"/>
<listOptionValue builtIn="false" value="__UINTMAX_TYPE__=long"/>
<listOptionValue builtIn="false" value="__CHAR_UNSIGNED__=1"/>
<listOptionValue builtIn="false" value="__XCC__=12000"/>
<listOptionValue builtIn="false" value="__SCHAR_MAX__=127"/>
<listOptionValue builtIn="false" value="__USER_LABEL_PREFIX__"/>
<listOptionValue builtIn="false" value="__STDC_HOSTED__=1"/>
<listOptionValue builtIn="false" value="__XTENSA_EL__=1"/>
<listOptionValue builtIn="false" value="__XCC_MINOR__=8"/>
<listOptionValue builtIn="false" value="__GNUC__=4"/>
<listOptionValue builtIn="false" value="__LONG_LONG_MAX__=9223372036854775807LL"/>
<listOptionValue builtIn="false" value="__GXX_ABI_VERSION=1002"/>
<listOptionValue builtIn="false" value="__REGISTER_PREFIX__"/>
<listOptionValue builtIn="false" value="__NO_INLINE__=1"/>
<listOptionValue builtIn="false" value="__VERSION__=&quot;4.2.0"/>
<listOptionValue builtIn="false" value="__XTENSA_SOFT_FLOAT__=1"/>
<listOptionValue builtIn="false" value="__SIZE_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__ELF__=1"/>
<listOptionValue builtIn="false" value="__xtensa__=1"/>
<listOptionValue builtIn="false" value="__LONG_MAX__=2147483647L"/>
<listOptionValue builtIn="false" value="__WCHAR_TYPE__=short"/>
<listOptionValue builtIn="false" value="__INT_MAX__=2147483647"/>
<listOptionValue builtIn="false" value="__WINT_TYPE__=unsigned"/>
<listOptionValue builtIn="false" value="__XTENSA_WINDOWED_ABI__=1"/>
<listOptionValue builtIn="false" value="__XTENSA__=1"/>
<listOptionValue builtIn="false" value="__INTMAX_MAX__=9223372036854775807LL"/>
<listOptionValue builtIn="false" value="__INTMAX_TYPE__=long"/>
<listOptionValue builtIn="false" value="__XTENSA_SOFT_DOUBLE__=1"/>
<listOptionValue builtIn="false" value="__GNUC_MINOR__=2"/>
<listOptionValue builtIn="false" value="__STDC__=1"/>
<listOptionValue builtIn="false" value="__PTRDIFF_TYPE__=int"/>
<listOptionValue builtIn="false" value="__GNUC_GNU_INLINE__=1"/>
</option>
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1982908514" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="Xtensa.600602548" moduleId="org.eclipse.cdt.core.settings" name="Xtensa">
<externalSettings/>
<extensions>
<extension id="com.tensilica.xide.cdt.XtensaELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="com.tensilica.xide.cdt.FlexLmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="com.tensilica.xide.cdt.TCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="com.tensilica.xide.cdt.XtLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="com.tensilica.xide.cdt.XCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="RTOSDemo.null.2024905137" name="RTOSDemo"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="Xtensa.600602548">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
</cproject>

View file

@ -58,6 +58,11 @@
<type>1</type> <type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/Common/Minimal/GenQTest.c</locationURI> <locationURI>PARENT-1-PROJECT_LOC/Common/Minimal/GenQTest.c</locationURI>
</link> </link>
<link>
<name>CommonDemoTasks/IntQueue.c</name>
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/Common/Minimal/IntQueue.c</locationURI>
</link>
<link> <link>
<name>CommonDemoTasks/IntSemTest.c</name> <name>CommonDemoTasks/IntSemTest.c</name>
<type>1</type> <type>1</type>
@ -133,11 +138,6 @@
<type>1</type> <type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/Common/Minimal/death.c</locationURI> <locationURI>PARENT-1-PROJECT_LOC/Common/Minimal/death.c</locationURI>
</link> </link>
<link>
<name>CommonDemoTasks/dynamic.c</name>
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/Common/Minimal/dynamic.c</locationURI>
</link>
<link> <link>
<name>CommonDemoTasks/flop.c</name> <name>CommonDemoTasks/flop.c</name>
<type>1</type> <type>1</type>
@ -291,92 +291,92 @@
<link> <link>
<name>FreeRTOS_Source/portable/XCC/port.c</name> <name>FreeRTOS_Source/portable/XCC/port.c</name>
<type>1</type> <type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/Source/portable/XCC/Xtensa/port.c</locationURI> <locationURI>PARENT-2-PROJECT_LOC/Source/portable/ThirdParty/XCC/Xtensa/port.c</locationURI>
</link> </link>
<link> <link>
<name>FreeRTOS_Source/portable/XCC/portasm.S</name> <name>FreeRTOS_Source/portable/XCC/portasm.S</name>
<type>1</type> <type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/Source/portable/XCC/Xtensa/portasm.S</locationURI> <locationURI>PARENT-2-PROJECT_LOC/Source/portable/ThirdParty/XCC/Xtensa/portasm.S</locationURI>
</link> </link>
<link> <link>
<name>FreeRTOS_Source/portable/XCC/portbenchmark.h</name> <name>FreeRTOS_Source/portable/XCC/portbenchmark.h</name>
<type>1</type> <type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/Source/portable/XCC/Xtensa/portbenchmark.h</locationURI> <locationURI>PARENT-2-PROJECT_LOC/Source/portable/ThirdParty/XCC/Xtensa/portbenchmark.h</locationURI>
</link> </link>
<link> <link>
<name>FreeRTOS_Source/portable/XCC/portclib.c</name> <name>FreeRTOS_Source/portable/XCC/portclib.c</name>
<type>1</type> <type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/Source/portable/XCC/Xtensa/portclib.c</locationURI> <locationURI>PARENT-2-PROJECT_LOC/Source/portable/ThirdParty/XCC/Xtensa/portclib.c</locationURI>
</link> </link>
<link> <link>
<name>FreeRTOS_Source/portable/XCC/portmacro.h</name> <name>FreeRTOS_Source/portable/XCC/portmacro.h</name>
<type>1</type> <type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/Source/portable/XCC/Xtensa/portmacro.h</locationURI> <locationURI>PARENT-2-PROJECT_LOC/Source/portable/ThirdParty/XCC/Xtensa/portmacro.h</locationURI>
</link> </link>
<link> <link>
<name>FreeRTOS_Source/portable/XCC/porttrace.h</name> <name>FreeRTOS_Source/portable/XCC/porttrace.h</name>
<type>1</type> <type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/Source/portable/XCC/Xtensa/porttrace.h</locationURI> <locationURI>PARENT-2-PROJECT_LOC/Source/portable/ThirdParty/XCC/Xtensa/porttrace.h</locationURI>
</link> </link>
<link> <link>
<name>FreeRTOS_Source/portable/XCC/readme_xtensa.txt</name> <name>FreeRTOS_Source/portable/XCC/readme_xtensa.txt</name>
<type>1</type> <type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/Source/portable/XCC/Xtensa/readme_xtensa.txt</locationURI> <locationURI>PARENT-2-PROJECT_LOC/Source/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt</locationURI>
</link> </link>
<link> <link>
<name>FreeRTOS_Source/portable/XCC/xtensa_api.h</name> <name>FreeRTOS_Source/portable/XCC/xtensa_api.h</name>
<type>1</type> <type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/Source/portable/XCC/Xtensa/xtensa_api.h</locationURI> <locationURI>PARENT-2-PROJECT_LOC/Source/portable/ThirdParty/XCC/Xtensa/xtensa_api.h</locationURI>
</link> </link>
<link> <link>
<name>FreeRTOS_Source/portable/XCC/xtensa_config.h</name> <name>FreeRTOS_Source/portable/XCC/xtensa_config.h</name>
<type>1</type> <type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/Source/portable/XCC/Xtensa/xtensa_config.h</locationURI> <locationURI>PARENT-2-PROJECT_LOC/Source/portable/ThirdParty/XCC/Xtensa/xtensa_config.h</locationURI>
</link> </link>
<link> <link>
<name>FreeRTOS_Source/portable/XCC/xtensa_context.S</name> <name>FreeRTOS_Source/portable/XCC/xtensa_context.S</name>
<type>1</type> <type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/Source/portable/XCC/Xtensa/xtensa_context.S</locationURI> <locationURI>PARENT-2-PROJECT_LOC/Source/portable/ThirdParty/XCC/Xtensa/xtensa_context.S</locationURI>
</link> </link>
<link> <link>
<name>FreeRTOS_Source/portable/XCC/xtensa_context.h</name> <name>FreeRTOS_Source/portable/XCC/xtensa_context.h</name>
<type>1</type> <type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/Source/portable/XCC/Xtensa/xtensa_context.h</locationURI> <locationURI>PARENT-2-PROJECT_LOC/Source/portable/ThirdParty/XCC/Xtensa/xtensa_context.h</locationURI>
</link> </link>
<link> <link>
<name>FreeRTOS_Source/portable/XCC/xtensa_init.c</name> <name>FreeRTOS_Source/portable/XCC/xtensa_init.c</name>
<type>1</type> <type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/Source/portable/XCC/Xtensa/xtensa_init.c</locationURI> <locationURI>PARENT-2-PROJECT_LOC/Source/portable/ThirdParty/XCC/Xtensa/xtensa_init.c</locationURI>
</link> </link>
<link> <link>
<name>FreeRTOS_Source/portable/XCC/xtensa_intr.c</name> <name>FreeRTOS_Source/portable/XCC/xtensa_intr.c</name>
<type>1</type> <type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/Source/portable/XCC/Xtensa/xtensa_intr.c</locationURI> <locationURI>PARENT-2-PROJECT_LOC/Source/portable/ThirdParty/XCC/Xtensa/xtensa_intr.c</locationURI>
</link> </link>
<link> <link>
<name>FreeRTOS_Source/portable/XCC/xtensa_intr_asm.S</name> <name>FreeRTOS_Source/portable/XCC/xtensa_intr_asm.S</name>
<type>1</type> <type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/Source/portable/XCC/Xtensa/xtensa_intr_asm.S</locationURI> <locationURI>PARENT-2-PROJECT_LOC/Source/portable/ThirdParty/XCC/Xtensa/xtensa_intr_asm.S</locationURI>
</link> </link>
<link> <link>
<name>FreeRTOS_Source/portable/XCC/xtensa_overlay_os_hook.c</name> <name>FreeRTOS_Source/portable/XCC/xtensa_overlay_os_hook.c</name>
<type>1</type> <type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/Source/portable/XCC/Xtensa/xtensa_overlay_os_hook.c</locationURI> <locationURI>PARENT-2-PROJECT_LOC/Source/portable/ThirdParty/XCC/Xtensa/xtensa_overlay_os_hook.c</locationURI>
</link> </link>
<link> <link>
<name>FreeRTOS_Source/portable/XCC/xtensa_rtos.h</name> <name>FreeRTOS_Source/portable/XCC/xtensa_rtos.h</name>
<type>1</type> <type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/Source/portable/XCC/Xtensa/xtensa_rtos.h</locationURI> <locationURI>PARENT-2-PROJECT_LOC/Source/portable/ThirdParty/XCC/Xtensa/xtensa_rtos.h</locationURI>
</link> </link>
<link> <link>
<name>FreeRTOS_Source/portable/XCC/xtensa_timer.h</name> <name>FreeRTOS_Source/portable/XCC/xtensa_timer.h</name>
<type>1</type> <type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/Source/portable/XCC/Xtensa/xtensa_timer.h</locationURI> <locationURI>PARENT-2-PROJECT_LOC/Source/portable/ThirdParty/XCC/Xtensa/xtensa_timer.h</locationURI>
</link> </link>
<link> <link>
<name>FreeRTOS_Source/portable/XCC/xtensa_vectors.S</name> <name>FreeRTOS_Source/portable/XCC/xtensa_vectors.S</name>
<type>1</type> <type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/Source/portable/XCC/Xtensa/xtensa_vectors.S</locationURI> <locationURI>PARENT-2-PROJECT_LOC/Source/portable/ThirdParty/XCC/Xtensa/xtensa_vectors.S</locationURI>
</link> </link>
</linkedResources> </linkedResources>
</projectDescription> </projectDescription>

View file

@ -71,22 +71,19 @@
#define FREERTOS_CONFIG_H #define FREERTOS_CONFIG_H
/* Required for configuration-dependent settings */ /* Required for configuration-dependent settings. */
#include "xtensa_config.h" #include "xtensa_config.h"
/*----------------------------------------------------------- /*---------------------------------------------------------------------------
* Application specific definitions. * Application specific definitions.
* *
* These definitions should be adjusted for your particular hardware and * These definitions should be adjusted for your particular hardware and
* application requirements. * application requirements.
* *
* Note that the default heap size is deliberately kept small so that
* the build is more likely to succeed for configurations with limited
* memory.
*
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
*----------------------------------------------------------*/ *---------------------------------------------------------------------------
*/
#define configUSE_PREEMPTION 1 #define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0 #define configUSE_IDLE_HOOK 0
@ -100,19 +97,19 @@
#define configTICK_RATE_HZ ( 1000 ) #define configTICK_RATE_HZ ( 1000 )
/* Default clock rate for simulator */ /* Default clock rate for simulator */
#define configCPU_CLOCK_HZ 10000000 //_RB_ was 2MHz #define configCPU_CLOCK_HZ 10000000
/* This has impact on speed of search for highest priority */ /* Max possible priorities. */
#ifdef SMALL_TEST
#define configMAX_PRIORITIES ( 7 ) #define configMAX_PRIORITIES ( 7 )
#else
#define configMAX_PRIORITIES ( 7 ) //_RB_
#endif
/* Minimal stack size. This may need to be increased for your application */ /**
/* NOTE: The FreeRTOS demos may not work reliably with stack size < 4KB. */ * Minimal stack size. This may need to be increased for your application.
/* The Xtensa-specific examples should be fine with XT_STACK_MIN_SIZE. */ *
/* NOTE: the size is defined in terms of StackType_t units not bytes. */ * @note: The FreeRTOS demos may not work reliably with stack size < 4KB. The
* Xtensa-specific examples should be fine with XT_STACK_MIN_SIZE.
*
* @note: The size is defined in terms of StackType_t units not bytes.
*/
#if !( defined XT_STACK_MIN_SIZE ) #if !( defined XT_STACK_MIN_SIZE )
#error XT_STACK_MIN_SIZE not defined, did you include xtensa_config.h ? #error XT_STACK_MIN_SIZE not defined, did you include xtensa_config.h ?
#endif #endif
@ -123,15 +120,20 @@
#define configMINIMAL_STACK_SIZE ( XT_STACK_MIN_SIZE > 1024 ? XT_STACK_MIN_SIZE : 1024 ) #define configMINIMAL_STACK_SIZE ( XT_STACK_MIN_SIZE > 1024 ? XT_STACK_MIN_SIZE : 1024 )
#endif #endif
/* The Xtensa port uses a separate interrupt stack. Adjust the stack size */ /**
/* to suit the needs of your specific application. */ * The Xtensa port uses a separate interrupt stack. Adjust the stack size to
/* NOTE: the size is defined in bytes. */ * suit the needs of your specific application.
*
* @note: the size is defined in bytes.
*/
#ifndef configISR_STACK_SIZE #ifndef configISR_STACK_SIZE
#define configISR_STACK_SIZE 2048 #define configISR_STACK_SIZE 2048
#endif #endif
/* Minimal heap size to make sure examples can run on memory limited /**
configs. Adjust this to suit your system. */ * Minimal heap size to make sure examples can run on memory limited configs.
* Adjust this to suit your system.
*/
#ifdef SMALL_TEST #ifdef SMALL_TEST
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 16 * 1024 ) ) #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 16 * 1024 ) )
#else #else
@ -139,10 +141,10 @@
#endif #endif
#define configMAX_TASK_NAME_LEN ( 8 ) #define configMAX_TASK_NAME_LEN ( 8 )
#define configUSE_TRACE_FACILITY 0 /* Used by vTaskList in main.c */ #define configUSE_TRACE_FACILITY 0
#define configUSE_STATS_FORMATTING_FUNCTIONS 0 /* Used by vTaskList in main.c */ #define configUSE_STATS_FORMATTING_FUNCTIONS 0
#define configUSE_TRACE_FACILITY_2 0 /* Provided by Xtensa port patch */ #define configUSE_TRACE_FACILITY_2 0 /* Provided by Xtensa port patch. */
#define configBENCHMARK 0 /* Provided by Xtensa port patch */ #define configBENCHMARK 0 /* Provided by Xtensa port patch. */
#define configUSE_16_BIT_TICKS 0 #define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 0 #define configIDLE_SHOULD_YIELD 0
#define configQUEUE_REGISTRY_SIZE 0 #define configQUEUE_REGISTRY_SIZE 0
@ -163,8 +165,10 @@
#define configUSE_CO_ROUTINES 0 #define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) #define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Set the following definitions to 1 to include the API function, or zero /**
to exclude the API function. */ * Set the following definitions to 1 to include the API function, or zero to
* exclude the API function.
*/
#define INCLUDE_vTaskPrioritySet 1 #define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1 #define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1 #define INCLUDE_vTaskDelete 1
@ -177,24 +181,30 @@
#define INCLUDE_xTaskGetHandle 1 #define INCLUDE_xTaskGetHandle 1
#define INCLUDE_xSemaphoreGetMutexHolder 1 #define INCLUDE_xSemaphoreGetMutexHolder 1
/* The priority at which the tick interrupt runs. This should probably be /**
kept at 1. */ * The priority at which the tick interrupt runs. This should probably be kept
* at 1.
*/
#define configKERNEL_INTERRUPT_PRIORITY 1 #define configKERNEL_INTERRUPT_PRIORITY 1
/* The maximum interrupt priority from which FreeRTOS.org API functions can /**
be called. Only API functions that end in ...FromISR() can be used within * The maximum interrupt priority from which FreeRTOS.org API functions can be
interrupts. */ * called. Only API functions that end in ...FromISR() can be used within
* interrupts.
*/
#define configMAX_SYSCALL_INTERRUPT_PRIORITY XCHAL_EXCM_LEVEL #define configMAX_SYSCALL_INTERRUPT_PRIORITY XCHAL_EXCM_LEVEL
/* XT_USE_THREAD_SAFE_CLIB is defined in xtensa_config.h and can be /**
overridden from the compiler/make command line. The small test * XT_USE_THREAD_SAFE_CLIB is defined in xtensa_config.h and can be overridden
however always disables C lib thread safety to minimize size. */ * from the compiler/make command line. The small test however always disables C
* lib thread safety to minimize size.
*/
#ifdef SMALL_TEST #ifdef SMALL_TEST
#define configUSE_NEWLIB_REENTRANT 0 #define configUSE_NEWLIB_REENTRANT 0
#else #else
#if ( XT_USE_THREAD_SAFE_CLIB > 0u ) #if ( XT_USE_THREAD_SAFE_CLIB > 0u )
#if XT_HAVE_THREAD_SAFE_CLIB #if XT_HAVE_THREAD_SAFE_CLIB
#define configUSE_NEWLIB_REENTRANT 0 //_RB_ 1 #define configUSE_NEWLIB_REENTRANT 0
#else #else
#error "Error: thread-safe C library support not available for this C library." #error "Error: thread-safe C library support not available for this C library."
#endif #endif
@ -204,7 +214,6 @@
#endif #endif
/* Test FreeRTOS timers (with timer task) and more. */ /* Test FreeRTOS timers (with timer task) and more. */
/* Some files don't compile if this flag is disabled */
#define configUSE_TIMERS 1 #define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 2 ) #define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 2 )
#define configTIMER_QUEUE_LENGTH 10 #define configTIMER_QUEUE_LENGTH 10
@ -220,33 +229,34 @@
#define configUSE_QUEUE_SETS 1 #define configUSE_QUEUE_SETS 1
#endif #endif
/* Specific config for XTENSA (these can be deleted and they will take default values) */ /**
* Specific config for XTENSA (these can be deleted and they will take default
* values).
*/
#if ( !defined XT_SIMULATOR ) && ( !defined XT_BOARD ) #if ( !defined XT_SIMULATOR ) && ( !defined XT_BOARD )
#define configXT_SIMULATOR 1 /* Simulator mode */ #define configXT_SIMULATOR 1 /* Simulator mode. */
#define configXT_BOARD 0 /* Board mode */ #define configXT_BOARD 0 /* Board mode. */
#endif #endif
#ifndef SMALL_TEST #ifndef SMALL_TEST
#if ( !defined XT_INTEXC_HOOKS ) #if ( !defined XT_INTEXC_HOOKS )
#define configXT_INTEXC_HOOKS 1 /* Exception hooks used by certain tests */ #define configXT_INTEXC_HOOKS 1 /* Exception hooks used by certain tests. */
#endif #endif
#if configUSE_TRACE_FACILITY_2 #if configUSE_TRACE_FACILITY_2
#define configASSERT_2 1 /* Specific to Xtensa port */ #define configASSERT_2 1 /* Specific to Xtensa port. */
#endif
#endif #endif
#endif /**
* It is a good idea to define configASSERT() while developing. configASSERT()
/* It is a good idea to define configASSERT() while developing. configASSERT() * uses the same semantics as the standard C assert() macro.
uses the same semantics as the standard C assert() macro. */ */
#if !defined __ASSEMBLER__ #if !defined __ASSEMBLER__
extern void vAssertCalled( unsigned long ulLine, const char * const pcFileName ); extern void vAssertCalled( unsigned long ulLine, const char * const pcFileName );
#endif #endif
#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __LINE__, __FILE__ ) #define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __LINE__, __FILE__ )
#define configSTREAM_BUFFER_TRIGGER_LEVEL_TEST_MARGIN ( 2 ) #define configSTREAM_BUFFER_TRIGGER_LEVEL_TEST_MARGIN ( 2 ) /* Used by stream buffer tests. */
#endif /* FREERTOS_CONFIG_H */ #endif /* FREERTOS_CONFIG_H */

View file

@ -52,14 +52,18 @@
#define SECOND_TIMER_AVAILABLE 0 #define SECOND_TIMER_AVAILABLE 0
#endif #endif
/* Timer0 is used to drive systick and therefore we use Timer1 /**
* Timer0 is used to drive systick and therefore we use Timer1
* as second interrupt which runs on a higher priority than * as second interrupt which runs on a higher priority than
* Timer0. This ensures that systick will get interrupted by * Timer0. This ensures that systick will get interrupted by
* this timer and hence we can test interrupt nesting. */ * this timer and hence we can test interrupt nesting.
*/
#define SECOND_TIMER_INDEX 1 #define SECOND_TIMER_INDEX 1
/* Frequency of the second timer - This timer is configured at /**
* a frequency offset of 17 from the systick timer. */ * Frequency of the second timer - This timer is configured at
* a frequency offset of 17 from the systick timer.
*/
#define SECOND_TIMER_TICK_RATE_HZ ( configTICK_RATE_HZ + 17 ) #define SECOND_TIMER_TICK_RATE_HZ ( configTICK_RATE_HZ + 17 )
#define SECOND_TIMER_TICK_DIVISOR ( configCPU_CLOCK_HZ / SECOND_TIMER_TICK_RATE_HZ ) #define SECOND_TIMER_TICK_DIVISOR ( configCPU_CLOCK_HZ / SECOND_TIMER_TICK_RATE_HZ )
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -68,7 +72,9 @@
extern BaseType_t xTimerForQueueTestInitialized; extern BaseType_t xTimerForQueueTestInitialized;
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* Interrupt handler for timer interrupt. */ /**
* Interrupt handler for timer interrupt.
*/
#if( SECOND_TIMER_AVAILABLE == 1 ) #if( SECOND_TIMER_AVAILABLE == 1 )
static void prvTimer2Handler( void *arg ); static void prvTimer2Handler( void *arg );
#endif /* SECOND_TIMER_AVAILABLE */ #endif /* SECOND_TIMER_AVAILABLE */
@ -103,13 +109,15 @@ unsigned currentCycleCount, firstComparatorValue;
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* /*
* Xtensa timers work by comparing a cycle counter with a preset value. Once the match occurs * Xtensa timers work by comparing a cycle counter with a preset value.
* an interrupt is generated, and the handler has to set a new cycle count into the comparator. * Once the match occurs an interrupt is generated, and the handler has
* To avoid clock drift due to interrupt latency, the new cycle count is computed from the old, * to set a new cycle count into the comparator. To avoid clock drift
* not the time the interrupt was serviced. However if a timer interrupt is ever serviced more * due to interrupt latency, the new cycle count is computed from the
* than one tick late, it is necessary to process multiple ticks until the new cycle count is * old, not the time the interrupt was serviced. However if a timer
* in the future, otherwise the next timer interrupt would not occur until after the cycle * interrupt is ever serviced more than one tick late, it is necessary
* counter had wrapped (2^32 cycles later). * to process multiple ticks until the new cycle count is in the future,
* otherwise the next timer interrupt would not occur until after the
* cycle counter had wrapped (2^32 cycles later).
do { do {
ticks++; ticks++;

View file

@ -29,8 +29,9 @@
#ifndef INT_QUEUE_TIMER_H #ifndef INT_QUEUE_TIMER_H
#define INT_QUEUE_TIMER_H #define INT_QUEUE_TIMER_H
/**
* The function called from interrupt tests to initialise timer.
*/
void vInitialiseTimerForIntQueueTest( void ); void vInitialiseTimerForIntQueueTest( void );
void vTimer2Handler_C( void );
#endif /* INT_QUEUE_TIMER_H */ #endif /* INT_QUEUE_TIMER_H */

View file

@ -26,15 +26,17 @@
*/ */
/****************************************************************************** /******************************************************************************
* This project provides two demo applications. A simple blinky style project, * This project provides two demo applications:
* and a more comprehensive test and demo application. The * - A simple blinky style demo application.
* mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is used to select between the two. * - A more comprehensive test and demo application.
* The simply blinky demo is implemented and described in main_blinky.c. The * The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY macro is used to select between the two.
* more comprehensive test and demo application is implemented and described in
* main_full.c.
* *
* This file implements the code that is not demo specific, including the * The simply blinky demo is implemented and described in the file main_blinky.c.
* hardware setup and FreeRTOS hook functions. * The more comprehensive test and demo application is implemented and described
* in the file main_full.c.
*
* This file implements the code that is not demo specific, including the FreeRTOS
* hook functions.
* *
******************************************************************************* *******************************************************************************
*/ */
@ -47,48 +49,60 @@
#include "FreeRTOS.h" #include "FreeRTOS.h"
#include "task.h" #include "task.h"
/* This project provides two demo applications. A simple blinky style demo /**
application, and a more comprehensive test and demo application. The * This project provides two demo applications:
mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is used to select between the two. * - A simple blinky style demo application.
* - A more comprehensive test and demo application.
If mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is 1 then the blinky demo will be built. * The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY macro is used to select between the two.
The blinky demo is implemented and described in main_blinky.c. *
* If mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1 then the blinky demo will be
If mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is not 1 then the comprehensive test and * built. The blinky demo is implemented and described in main_blinky.c.
demo application will be built. The comprehensive test and demo application is *
implemented and described in main_full.c. */ * If mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 0 then the comprehensive test
* and demo application will be built. The comprehensive test and demo application
* is implemented and described in main_full.c.
*/
#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 0 #define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 0
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* /**
* main_blinky() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1. * The entry function for the blinky demo application.
* main_full() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 0. *
* This is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1.
*/ */
extern void main_blinky( void ); extern void main_blinky( void );
/**
* The entry function for the comprehensive test and demo application.
*
* This is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 0.
*/
extern void main_full( void ); extern void main_full( void );
/* /**
* Prototypes for the standard FreeRTOS application hook (callback) functions * Prototypes for the standard FreeRTOS application hook (callback) functions
* implemented within this file. See http://www.freertos.org/a00016.html . * implemented within this file.
*
* @see http://www.freertos.org/a00016.html
*/ */
void vApplicationMallocFailedHook( void ); void vApplicationMallocFailedHook( void );
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName ); void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName );
void vApplicationTickHook( void ); void vApplicationTickHook( void );
/* /**
* Only the comprehensive demo uses application hook (callback) functions. See * The function called from the tick hook.
* http://www.freertos.org/a00016.html for more information. *
* @note Only the comprehensive demo uses application hook (callback) functions.
*
* @see http://www.freertos.org/a00016.html
*/ */
void vFullDemoTickHookFunction( void ); void vFullDemoTickHookFunction( void );
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
int main( void ) int main( void )
{ {
/* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top /* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top
of this file. */ * of this file. */
#if ( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 ) #if ( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 )
{ {
main_blinky(); main_blinky();
@ -106,17 +120,17 @@ int main( void )
void vApplicationMallocFailedHook( void ) void vApplicationMallocFailedHook( void )
{ {
/* vApplicationMallocFailedHook() will only be called if /* vApplicationMallocFailedHook() will only be called if
configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook * configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook
function that will get called if a call to pvPortMalloc() fails. * function that will get called if a call to pvPortMalloc() fails.
pvPortMalloc() is called internally by the kernel whenever a task, queue, * pvPortMalloc() is called internally by the kernel whenever a task, queue,
timer or semaphore is created. It is also called by various parts of the * timer or semaphore is created. It is also called by various parts of the
demo application. If heap_1.c, heap_2.c or heap_4.c is being used, then the * demo application. If heap_1.c, heap_2.c or heap_4.c is being used, then
size of the heap available to pvPortMalloc() is defined by * the size of the heap available to pvPortMalloc() is defined by
configTOTAL_HEAP_SIZE in FreeRTOSConfig.h, and the xPortGetFreeHeapSize() * configTOTAL_HEAP_SIZE in FreeRTOSConfig.h, and the xPortGetFreeHeapSize()
API function can be used to query the size of free heap space that remains * API function can be used to query the size of free heap space that remains
(although it does not provide information on how the remaining heap might be * (although it does not provide information on how the remaining heap might be
fragmented). See http://www.freertos.org/a00111.html for more * fragmented). See http://www.freertos.org/a00111.html for more information.
information. */ */
vAssertCalled( __LINE__, __FILE__ ); vAssertCalled( __LINE__, __FILE__ );
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -127,10 +141,8 @@ void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
( void ) pxTask; ( void ) pxTask;
/* Run time stack overflow checking is performed if /* Run time stack overflow checking is performed if
configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook * configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook
function is called if a stack overflow is detected. This function is * function is called if a stack overflow is detected. */
provided as an example only as stack overflow checking does not function
when running the FreeRTOS Windows port. */
vAssertCalled( __LINE__, __FILE__ ); vAssertCalled( __LINE__, __FILE__ );
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -138,11 +150,10 @@ void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
void vApplicationTickHook( void ) void vApplicationTickHook( void )
{ {
/* This function will be called by each tick interrupt if /* This function will be called by each tick interrupt if
configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h. User code can be * configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h. User code can be
added here, but the tick hook is called from an interrupt context, so * added here, but the tick hook is called from an interrupt context, so
code must not attempt to block, and only the interrupt safe FreeRTOS API * code must not attempt to block, and only the interrupt safe FreeRTOS API
functions can be used (those that end in FromISR()). */ * functions can be used (those that end in FromISR()). */
#if ( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY != 1 ) #if ( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY != 1 )
{ {
vFullDemoTickHookFunction(); vFullDemoTickHookFunction();
@ -157,19 +168,17 @@ static BaseType_t xPrinted = pdFALSE;
volatile uint32_t ulSetToNonZeroInDebuggerToContinue = 0; volatile uint32_t ulSetToNonZeroInDebuggerToContinue = 0;
/* Called if an assertion passed to configASSERT() fails. See /* Called if an assertion passed to configASSERT() fails. See
http://www.freertos.org/a00110.html#configASSERT for more information. */ * http://www.freertos.org/a00110.html#configASSERT for more information. */
/* Parameters are not used. */ /* Parameters are not used. */
( void ) ulLine; ( void ) ulLine;
( void ) pcFileName; ( void ) pcFileName;
printf( "ASSERT! Line %ld, file %s\r\n", ulLine, pcFileName );
taskENTER_CRITICAL(); taskENTER_CRITICAL();
{ {
/* You can step out of this function to debug the assertion by using /* You can step out of this function to debug the assertion by using
the debugger to set ulSetToNonZeroInDebuggerToContinue to a non-zero * the debugger to set ulSetToNonZeroInDebuggerToContinue to a non-zero
value. */ * value. */
while( ulSetToNonZeroInDebuggerToContinue == 0 ) while( ulSetToNonZeroInDebuggerToContinue == 0 )
{ {
__asm volatile( "NOP" ); __asm volatile( "NOP" );

View file

@ -26,21 +26,7 @@
*/ */
/****************************************************************************** /******************************************************************************
* NOTE 1: Windows will not be running the FreeRTOS demo threads continuously, so * NOTE: This file only contains the source code that is specific to the
* do not expect to get real time behaviour from the FreeRTOS Windows port, or
* this demo application. Also, the timing information in the FreeRTOS+Trace
* logs have no meaningful units. See the documentation page for the Windows
* port for further information:
* http://www.freertos.org/FreeRTOS-Windows-Simulator-Emulator-for-Visual-Studio-and-Eclipse-MingW.html
*
* NOTE 2: This project provides two demo applications. A simple blinky style
* project, and a more comprehensive test and demo application. The
* mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting in main.c is used to select
* between the two. See the notes on using mainCREATE_SIMPLE_BLINKY_DEMO_ONLY
* in main.c. This file implements the simply blinky version. Console output
* is used in place of the normal LED toggling.
*
* NOTE 3: This file only contains the source code that is specific to the
* basic demo. Generic functions, such FreeRTOS hook functions, are defined * basic demo. Generic functions, such FreeRTOS hook functions, are defined
* in main.c. * in main.c.
****************************************************************************** ******************************************************************************
@ -51,8 +37,7 @@
* The Queue Send Task: * The Queue Send Task:
* The queue send task is implemented by the prvQueueSendTask() function in * The queue send task is implemented by the prvQueueSendTask() function in
* this file. It uses vTaskDelayUntil() to create a periodic task that sends * this file. It uses vTaskDelayUntil() to create a periodic task that sends
* the value 100 to the queue every 200 milliseconds (please read the notes * the value 100 to the queue every 200 milliseconds.
* above regarding the accuracy of timing under Windows).
* *
* The Queue Send Software Timer: * The Queue Send Software Timer:
* The timer is an auto-reload timer with a period of two seconds. The timer's * The timer is an auto-reload timer with a period of two seconds. The timer's
@ -66,19 +51,13 @@
* message to indicate if the data came from the queue send task or the queue * message to indicate if the data came from the queue send task or the queue
* send software timer. * send software timer.
* *
* Expected Behaviour: * Expected Behavior:
* - The queue send task writes to the queue every 200ms, so every 200ms the * - The queue send task writes to the queue every 200ms, so every 200ms the
* queue receive task will output a message indicating that data was received * queue receive task will output a message indicating that data was received
* on the queue from the queue send task. * on the queue from the queue send task.
* - The queue send software timer has a period of two seconds, and is reset * - The queue send software timer has a period of two seconds, so every two
* each time a key is pressed. So if two seconds expire without a key being * seconds the queue receive task will output a message indicating that data
* pressed then the queue receive task will output a message indicating that * was received on the queue from the queue send software timer.
* data was received on the queue from the queue send software timer.
*
* NOTE: Console input and output relies on Windows system calls, which can
* interfere with the execution of the FreeRTOS Windows port. This demo only
* uses Windows system call occasionally. Heavier use of Windows system calls
* can crash the port.
*/ */
/* Standard includes. */ /* Standard includes. */
@ -90,47 +69,55 @@
#include "timers.h" #include "timers.h"
#include "semphr.h" #include "semphr.h"
/* Priorities at which the tasks are created. */ /**
* Priorities at which the tasks are created.
*/
#define mainQUEUE_RECEIVE_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 ) #define mainQUEUE_RECEIVE_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainQUEUE_SEND_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) #define mainQUEUE_SEND_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
/* The rate at which data is sent to the queue. The times are converted from /**
milliseconds to ticks using the pdMS_TO_TICKS() macro. */ * The rate at which data is sent to the queue. The times are converted from
* milliseconds to ticks using the pdMS_TO_TICKS() macro.
*/
#define mainTASK_SEND_FREQUENCY_MS pdMS_TO_TICKS( 200UL ) #define mainTASK_SEND_FREQUENCY_MS pdMS_TO_TICKS( 200UL )
#define mainTIMER_SEND_FREQUENCY_MS pdMS_TO_TICKS( 2000UL ) #define mainTIMER_SEND_FREQUENCY_MS pdMS_TO_TICKS( 2000UL )
/* The number of items the queue can hold at once. */ /**
* The number of items the queue can hold at once.
*/
#define mainQUEUE_LENGTH ( 2 ) #define mainQUEUE_LENGTH ( 2 )
/* The values sent to the queue receive task from the queue send task and the /**
queue send software timer respectively. */ * The values sent to the queue receive task from the queue send task and the
* queue send software timer respectively.
*/
#define mainVALUE_SENT_FROM_TASK ( 100UL ) #define mainVALUE_SENT_FROM_TASK ( 100UL )
#define mainVALUE_SENT_FROM_TIMER ( 200UL ) #define mainVALUE_SENT_FROM_TIMER ( 200UL )
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* /**
* The tasks as described in the comments at the top of this file. * The tasks as described in the comments at the top of this file.
*/ */
static void prvQueueReceiveTask( void *pvParameters ); static void prvQueueReceiveTask( void *pvParameters );
static void prvQueueSendTask( void *pvParameters ); static void prvQueueSendTask( void *pvParameters );
/* /**
* The callback function executed when the software timer expires. * The callback function executed when the software timer expires.
*/ */
static void prvQueueSendTimerCallback( TimerHandle_t xTimerHandle ); static void prvQueueSendTimerCallback( TimerHandle_t xTimerHandle );
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* The queue used by both tasks. */ /**
* The queue used by both tasks.
*/
static QueueHandle_t xQueue = NULL; static QueueHandle_t xQueue = NULL;
/* A software timer that is started from the tick hook. */ /**
* A software timer that is started from the tick hook.
*/
static TimerHandle_t xTimer = NULL; static TimerHandle_t xTimer = NULL;
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/*** SEE THE COMMENTS AT THE TOP OF THIS FILE ***/
void main_blinky( void ) void main_blinky( void )
{ {
const TickType_t xTimerPeriod = mainTIMER_SEND_FREQUENCY_MS; const TickType_t xTimerPeriod = mainTIMER_SEND_FREQUENCY_MS;
@ -141,7 +128,7 @@ const TickType_t xTimerPeriod = mainTIMER_SEND_FREQUENCY_MS;
if( xQueue != NULL ) if( xQueue != NULL )
{ {
/* Start the two tasks as described in the comments at the top of this /* Start the two tasks as described in the comments at the top of this
file. */ * file. */
xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */ xTaskCreate( prvQueueReceiveTask, /* The function that implements the task. */
"Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */ "Rx", /* The text name assigned to the task - for debug only as it is not used by the kernel. */
configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */ configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */
@ -168,10 +155,10 @@ const TickType_t xTimerPeriod = mainTIMER_SEND_FREQUENCY_MS;
} }
/* If all is well, the scheduler will now be running, and the following /* If all is well, the scheduler will now be running, and the following
line will never be reached. If the following line does execute, then * line will never be reached. If the following line does execute, then
there was insufficient FreeRTOS heap memory available for the idle and/or * there was insufficient FreeRTOS heap memory available for the idle and/or
timer tasks to be created. See the memory management section on the * timer tasks to be created. See the memory management section on the
FreeRTOS web site for more details. */ * FreeRTOS web site for more details. */
for( ;; ); for( ;; );
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -191,15 +178,15 @@ const uint32_t ulValueToSend = mainVALUE_SENT_FROM_TASK;
for( ;; ) for( ;; )
{ {
/* Place this task in the blocked state until it is time to run again. /* Place this task in the blocked state until it is time to run again.
The block time is specified in ticks, pdMS_TO_TICKS() was used to * The block time is specified in ticks, pdMS_TO_TICKS() was used to
convert a time specified in milliseconds into a time specified in ticks. * convert a time specified in milliseconds into a time specified in ticks.
While in the Blocked state this task will not consume any CPU time. */ * While in the Blocked state this task will not consume any CPU time. */
vTaskDelayUntil( &xNextWakeTime, xBlockTime ); vTaskDelayUntil( &xNextWakeTime, xBlockTime );
/* Send to the queue - causing the queue receive task to unblock and /* Send to the queue - causing the queue receive task to unblock and
write to the console. 0 is used as the block time so the send operation * write to the console. 0 is used as the block time so the send operation
will not block - it shouldn't need to block as the queue should always * will not block - it shouldn't need to block as the queue should always
have at least one space at this point in the code. */ * have at least one space at this point in the code. */
xQueueSend( xQueue, &ulValueToSend, 0U ); xQueueSend( xQueue, &ulValueToSend, 0U );
} }
} }
@ -210,16 +197,16 @@ static void prvQueueSendTimerCallback( TimerHandle_t xTimerHandle )
const uint32_t ulValueToSend = mainVALUE_SENT_FROM_TIMER; const uint32_t ulValueToSend = mainVALUE_SENT_FROM_TIMER;
/* This is the software timer callback function. The software timer has a /* This is the software timer callback function. The software timer has a
period of two seconds and is reset each time a key is pressed. This * period of two seconds and is reset each time a key is pressed. This
callback function will execute if the timer expires, which will only happen * callback function will execute if the timer expires, which will only happen
if a key is not pressed for two seconds. */ * if a key is not pressed for two seconds. */
/* Avoid compiler warnings resulting from the unused parameter. */ /* Avoid compiler warnings resulting from the unused parameter. */
( void ) xTimerHandle; ( void ) xTimerHandle;
/* Send to the queue - causing the queue receive task to unblock and /* Send to the queue - causing the queue receive task to unblock and
write out a message. This function is called from the timer/daemon task, so * write out a message. This function is called from the timer/daemon task,
must not block. Hence the block time is set to 0. */ * so must not block. Hence the block time is set to 0. */
xQueueSend( xQueue, &ulValueToSend, 0U ); xQueueSend( xQueue, &ulValueToSend, 0U );
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -234,17 +221,14 @@ uint32_t ulReceivedValue;
for( ;; ) for( ;; )
{ {
/* Wait until something arrives in the queue - this task will block /* Wait until something arrives in the queue - this task will block
indefinitely provided INCLUDE_vTaskSuspend is set to 1 in * indefinitely provided INCLUDE_vTaskSuspend is set to 1 in
FreeRTOSConfig.h. It will not use any CPU time while it is in the * FreeRTOSConfig.h. It will not use any CPU time while it is in the
Blocked state. */ * Blocked state. */
xQueueReceive( xQueue, &ulReceivedValue, portMAX_DELAY ); xQueueReceive( xQueue, &ulReceivedValue, portMAX_DELAY );
/* To get here something must have been received from the queue, but /* To get here something must have been received from the queue, but
is it an expected value? Normally calling printf() from a task is not * is it an expected value? This is the only task that uses stdout so its
a good idea. Here there is lots of stack space and only one task is * ok to call printf() directly. Do not call printf from any other task. */
using console IO so it is ok. However, note the comments at the top of
this file about the risks of making Windows system calls (such as
console output) from a FreeRTOS task. */
if( ulReceivedValue == mainVALUE_SENT_FROM_TASK ) if( ulReceivedValue == mainVALUE_SENT_FROM_TASK )
{ {
printf( "Message received from task\r\n" ); printf( "Message received from task\r\n" );
@ -262,4 +246,3 @@ uint32_t ulReceivedValue;
} }
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/

View file

@ -1,6 +1,6 @@
/* /*
* FreeRTOS Kernel V10.1.1 * FreeRTOS Kernel V10.0.1
* Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
@ -25,8 +25,13 @@
* 1 tab == 4 spaces! * 1 tab == 4 spaces!
*/ */
/* /******************************************************************************
* main() creates all the demo application tasks, then starts the scheduler. * NOTE: This file only contains the source code that is specific to the
* basic demo. Generic functions, such FreeRTOS hook functions, are defined
* in main.c.
******************************************************************************
*
* main_full() creates all the demo application tasks, then starts the scheduler.
* The web documentation provides more details of the standard demo application * The web documentation provides more details of the standard demo application
* tasks, which provide no particular functionality but do provide a good * tasks, which provide no particular functionality but do provide a good
* example of how to use the FreeRTOS API. * example of how to use the FreeRTOS API.
@ -34,13 +39,21 @@
* In addition to the standard demo tasks, the following tasks and tests are * In addition to the standard demo tasks, the following tasks and tests are
* defined and/or created within this file: * defined and/or created within this file:
* *
* "Check" task - This only executes every five seconds but has a high priority * "Register tests":
* to ensure it gets processor time. Its main function is to check that all the * prvRegTest1Task and prvRegTest2Task implement register tests. These functions
* standard demo tasks are still operational. While no errors have been * are just entry points and actual tests are written in the assembler file
* discovered the check task will print out "OK" and the current simulated tick * regtest_xtensa.S. These tests populate core registers with a known set of
* time. If an error is discovered in the execution of a task then the check * values and keep verifying them in a loop. Any corruption will indicate an
* task will print out an appropriate error message. * error in context switching mechanism.
* *
* "Check" task:
* This only executes every five seconds but has a high priority to ensure it
* gets processor time. Its main function is to check that all the standard demo
* tasks are still operational. While no errors have been discovered the check
* task will print out "No errors", the current simulated tick time, free heap
* size and the minimum free heap size so far. If an error is discovered in the
* execution of a task then the check task will print out an appropriate error
* message.
*/ */
@ -67,7 +80,6 @@
#include "TimerDemo.h" #include "TimerDemo.h"
#include "countsem.h" #include "countsem.h"
#include "death.h" #include "death.h"
#include "dynamic.h"
#include "QueueSet.h" #include "QueueSet.h"
#include "QueueOverwrite.h" #include "QueueOverwrite.h"
#include "EventGroupsDemo.h" #include "EventGroupsDemo.h"
@ -81,7 +93,9 @@
#include "StreamBufferDemo.h" #include "StreamBufferDemo.h"
#include "StreamBufferInterrupt.h" #include "StreamBufferInterrupt.h"
/* Priorities at which the tasks are created. */ /**
* Priorities at which the tasks are created.
*/
#define mainCHECK_TASK_PRIORITY ( configMAX_PRIORITIES - 2 ) #define mainCHECK_TASK_PRIORITY ( configMAX_PRIORITIES - 2 )
#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 1 ) #define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 1 )
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 ) #define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
@ -93,18 +107,74 @@
#define mainFLOP_TASK_PRIORITY ( tskIDLE_PRIORITY ) #define mainFLOP_TASK_PRIORITY ( tskIDLE_PRIORITY )
#define mainQUEUE_OVERWRITE_PRIORITY ( tskIDLE_PRIORITY ) #define mainQUEUE_OVERWRITE_PRIORITY ( tskIDLE_PRIORITY )
/**
* Period used in timer tests.
*/
#define mainTIMER_TEST_PERIOD ( 50 ) #define mainTIMER_TEST_PERIOD ( 50 )
/* The task that periodically checks that all the standard demo tasks are /**
* Parameters that are passed into the register check tasks solely for the
* purpose of ensuring parameters are passed into tasks correctly.
*/
#define mainREG_TEST_TASK_1_PARAMETER ( ( void * ) 0x12345678 )
#define mainREG_TEST_TASK_2_PARAMETER ( ( void * ) 0x87654321 )
/**
* Determines whether to enable interrupt queue tests.
*
* Interrupt queue tests are used to test interrupt nesting and enabling them
* interferes with proper functioning of other tests. This macro controls
* whether to enable interrupt queue tests or all other tests:
*
* * When mainENABLE_INT_QUEUE_TESTS is set to 1, interrupt queue tests are
* enabled and every other test is disabled.
* * When mainENABLE_INT_QUEUE_TESTS is set to 0, interrupt queue tests are
* disabled and every other test is enabled.
*/
#define mainENABLE_INT_QUEUE_TESTS ( 0 )
/*-----------------------------------------------------------*/
/**
* The task that periodically checks that all the standard demo tasks are
* still executing and error free. * still executing and error free.
*/ */
static void prvCheckTask( void *pvParameters ); static void prvCheckTask( void *pvParameters );
/**
* Tasks that implement register tests.
*/
static void prvRegTest1Task( void *pvParameters );
static void prvRegTest2Task( void *pvParameters );
/**
* Functions that implement register tests.
*
* These are implemented in assembler file regtest_xtensa.S.
*/
extern void vRegTest1( void );
extern void vRegTest2( void );
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
/* The variable into which error messages are latched. */ /**
* The variable into which error messages are latched.
*/
static char *pcStatusMessage = "No errors"; static char *pcStatusMessage = "No errors";
/**
* The following two variables are used to communicate the status of the
* register check tasks to the check task. If the variables keep incrementing,
* then the register check tasks have not discovered any errors. If a variable
* stops incrementing, then an error has been found.
*/
volatile unsigned long ulRegTest1Counter = 0UL, ulRegTest2Counter = 0UL;
/**
* The following variable is used to communicate whether the timers for the
* IntQueue tests have been Initialized. This is needed to ensure that the queues
* are accessed from the tick hook only after they have been created in the
* interrupt queue test.
*/
volatile BaseType_t xTimerForQueueTestInitialized = pdFALSE;
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
int main_full( void ) int main_full( void )
@ -112,6 +182,8 @@ int main_full( void )
/* Start the check task as described at the top of this file. */ /* Start the check task as described at the top of this file. */
xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
#if( mainENABLE_INT_QUEUE_TESTS == 0 )
{
/* Create the standard demo tasks. */ /* Create the standard demo tasks. */
vStartTaskNotifyTask(); vStartTaskNotifyTask();
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
@ -124,7 +196,6 @@ int main_full( void )
vStartMathTasks( mainFLOP_TASK_PRIORITY ); vStartMathTasks( mainFLOP_TASK_PRIORITY );
vStartRecursiveMutexTasks(); vStartRecursiveMutexTasks();
vStartCountingSemaphoreTasks(); vStartCountingSemaphoreTasks();
vStartDynamicPriorityTasks();
vStartQueueSetTasks(); vStartQueueSetTasks();
vStartQueueOverwriteTask( mainQUEUE_OVERWRITE_PRIORITY ); vStartQueueOverwriteTask( mainQUEUE_OVERWRITE_PRIORITY );
@ -133,12 +204,6 @@ int main_full( void )
vStartQueueSetPollingTask(); vStartQueueSetPollingTask();
vCreateBlockTimeTasks(); vCreateBlockTimeTasks();
vCreateAbortDelayTasks();
vStartMessageBufferTasks( configMINIMAL_STACK_SIZE );
vStartStreamBufferTasks();
vStartStreamBufferInterruptDemo();
#if( configUSE_PREEMPTION != 0 ) #if( configUSE_PREEMPTION != 0 )
{ {
/* Don't expect these tasks to pass when preemption is not used. */ /* Don't expect these tasks to pass when preemption is not used. */
@ -146,17 +211,34 @@ int main_full( void )
} }
#endif #endif
vCreateAbortDelayTasks();
vStartMessageBufferTasks( configMINIMAL_STACK_SIZE );
vStartStreamBufferTasks();
vStartStreamBufferInterruptDemo();
/* Create the register check tasks, as described at the top of this file */
xTaskCreate( prvRegTest1Task, "Reg1", configMINIMAL_STACK_SIZE, mainREG_TEST_TASK_1_PARAMETER, tskIDLE_PRIORITY, NULL );
xTaskCreate( prvRegTest2Task, "Reg2", configMINIMAL_STACK_SIZE, mainREG_TEST_TASK_2_PARAMETER, tskIDLE_PRIORITY, NULL );
/* The suicide tasks must be created last as they need to know how many /* The suicide tasks must be created last as they need to know how many
tasks were running prior to their creation. This then allows them to * tasks were running prior to their creation. This then allows them to
ascertain whether or not the correct/expected number of tasks are running at * ascertain whether or not the correct/expected number of tasks are
any given time. */ * running at any given time. */
vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY ); vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );
}
#else /* mainENABLE_INT_QUEUE_TESTS */
{
/* Start interrupt queue test tasks. */
vStartInterruptQueueTasks();
}
#endif /* mainENABLE_INT_QUEUE_TESTS */
/* Start the scheduler itself. */ /* Start the scheduler itself. */
vTaskStartScheduler(); vTaskStartScheduler();
/* Should never get here unless there was not enough heap space to create /* Should never get here unless there was not enough heap space to create
the idle and other system tasks. */ * the idle and other system tasks. */
return 0; return 0;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -165,6 +247,7 @@ static void prvCheckTask( void *pvParameters )
{ {
TickType_t xNextWakeTime; TickType_t xNextWakeTime;
const TickType_t xCycleFrequency = pdMS_TO_TICKS( 5000UL ); const TickType_t xCycleFrequency = pdMS_TO_TICKS( 5000UL );
static unsigned long ulLastRegTest1Value = 0, ulLastRegTest2Value = 0;
/* Just to remove compiler warning. */ /* Just to remove compiler warning. */
( void ) pvParameters; ( void ) pvParameters;
@ -177,6 +260,8 @@ const TickType_t xCycleFrequency = pdMS_TO_TICKS( 5000UL );
/* Place this task in the blocked state until it is time to run again. */ /* Place this task in the blocked state until it is time to run again. */
vTaskDelayUntil( &xNextWakeTime, xCycleFrequency ); vTaskDelayUntil( &xNextWakeTime, xCycleFrequency );
#if( mainENABLE_INT_QUEUE_TESTS == 0 )
{
/* Check the standard demo tasks are running without error. */ /* Check the standard demo tasks are running without error. */
#if( configUSE_PREEMPTION != 0 ) #if( configUSE_PREEMPTION != 0 )
{ {
@ -192,14 +277,6 @@ const TickType_t xCycleFrequency = pdMS_TO_TICKS( 5000UL );
{ {
pcStatusMessage = "Error: Notification"; pcStatusMessage = "Error: Notification";
} }
else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: IntMath";
}
else if( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: GenQueue";
}
else if( xAreBlockingQueuesStillRunning() != pdTRUE ) else if( xAreBlockingQueuesStillRunning() != pdTRUE )
{ {
pcStatusMessage = "Error: BlockQueue"; pcStatusMessage = "Error: BlockQueue";
@ -212,10 +289,22 @@ const TickType_t xCycleFrequency = pdMS_TO_TICKS( 5000UL );
{ {
pcStatusMessage = "Error: PollQueue"; pcStatusMessage = "Error: PollQueue";
} }
else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: IntMath";
}
else if( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: GenQueue";
}
else if( xAreQueuePeekTasksStillRunning() != pdTRUE ) else if( xAreQueuePeekTasksStillRunning() != pdTRUE )
{ {
pcStatusMessage = "Error: QueuePeek"; pcStatusMessage = "Error: QueuePeek";
} }
else if( xAreMathsTaskStillRunning() != pdPASS )
{
pcStatusMessage = "Error: Flop";
}
else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE ) else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
{ {
pcStatusMessage = "Error: RecMutex"; pcStatusMessage = "Error: RecMutex";
@ -224,21 +313,21 @@ const TickType_t xCycleFrequency = pdMS_TO_TICKS( 5000UL );
{ {
pcStatusMessage = "Error: CountSem"; pcStatusMessage = "Error: CountSem";
} }
else if( xAreDynamicPriorityTasksStillRunning() != pdPASS )
{
pcStatusMessage = "Error: Dynamic";
}
else if( xAreQueueSetTasksStillRunning() != pdPASS ) else if( xAreQueueSetTasksStillRunning() != pdPASS )
{ {
pcStatusMessage = "Error: Queue set"; pcStatusMessage = "Error: Queue set";
} }
else if( xIsQueueOverwriteTaskStillRunning() != pdPASS )
{
pcStatusMessage = "Error: Queue overwrite";
}
else if( xAreEventGroupTasksStillRunning() != pdTRUE ) else if( xAreEventGroupTasksStillRunning() != pdTRUE )
{ {
pcStatusMessage = "Error: EventGroup"; pcStatusMessage = "Error: EventGroup";
} }
else if( xIsQueueOverwriteTaskStillRunning() != pdPASS ) else if( xAreInterruptSemaphoreTasksStillRunning() != pdTRUE )
{ {
pcStatusMessage = "Error: Queue overwrite"; pcStatusMessage = "Error: IntSem";
} }
else if( xAreQueueSetPollTasksStillRunning() != pdPASS ) else if( xAreQueueSetPollTasksStillRunning() != pdPASS )
{ {
@ -248,14 +337,14 @@ const TickType_t xCycleFrequency = pdMS_TO_TICKS( 5000UL );
{ {
pcStatusMessage = "Error: Block time"; pcStatusMessage = "Error: Block time";
} }
else if( xAreMessageBufferTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: MessageBuffer";
}
else if( xAreAbortDelayTestTasksStillRunning() != pdPASS ) else if( xAreAbortDelayTestTasksStillRunning() != pdPASS )
{ {
pcStatusMessage = "Error: Abort delay"; pcStatusMessage = "Error: Abort delay";
} }
else if( xAreMessageBufferTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: MessageBuffer";
}
else if( xAreStreamBufferTasksStillRunning() != pdTRUE ) else if( xAreStreamBufferTasksStillRunning() != pdTRUE )
{ {
pcStatusMessage = "Error: StreamBuffer"; pcStatusMessage = "Error: StreamBuffer";
@ -264,21 +353,34 @@ const TickType_t xCycleFrequency = pdMS_TO_TICKS( 5000UL );
{ {
pcStatusMessage = "Error: Stream buffer interrupt"; pcStatusMessage = "Error: Stream buffer interrupt";
} }
else if( xAreInterruptSemaphoreTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: IntSem";
}
else if( xIsCreateTaskStillRunning() != pdTRUE ) else if( xIsCreateTaskStillRunning() != pdTRUE )
{ {
pcStatusMessage = "Error: Death"; pcStatusMessage = "Error: Death";
} }
else if( xAreMathsTaskStillRunning() != pdPASS ) else if( ulLastRegTest1Value == ulRegTest1Counter )
{ {
pcStatusMessage = "Error: Flop"; pcStatusMessage = "Error: Reg Test 1";
}
else if( ulLastRegTest2Value == ulRegTest2Counter )
{
pcStatusMessage = "Error: Reg Test 2";
} }
/* Update register test counters. */
ulLastRegTest1Value = ulRegTest1Counter;
ulLastRegTest2Value = ulRegTest2Counter;
}
#else /* mainENABLE_INT_QUEUE_TESTS */
{
if( xAreIntQueueTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: IntQueue";
}
}
#endif /* mainENABLE_INT_QUEUE_TESTS */
/* This is the only task that uses stdout so its ok to call printf() /* This is the only task that uses stdout so its ok to call printf()
directly. */ * directly. Do not call printf from any other task. */
printf( "%s - tick count %zu - free heap %zu - min free heap %zu\r\n", pcStatusMessage, printf( "%s - tick count %zu - free heap %zu - min free heap %zu\r\n", pcStatusMessage,
xTaskGetTickCount(), xTaskGetTickCount(),
xPortGetFreeHeapSize(), xPortGetFreeHeapSize(),
@ -292,39 +394,89 @@ void vFullDemoTickHookFunction( void )
{ {
TaskHandle_t xTimerTask; TaskHandle_t xTimerTask;
/* Call the periodic timer test, which tests the timer API functions that #if( mainENABLE_INT_QUEUE_TESTS == 0 )
can be called from an ISR. */
#if( configUSE_PREEMPTION != 0 )
{ {
/* Only created when preemption is used. */ /* Exercise using task notifications from an interrupt. */
vTimerPeriodicISRTests(); xNotifyTaskFromISR();
}
#endif /* Write to a queue that is in use as part of the queue set demo to
* demonstrate using queue sets from an ISR. */
vQueueSetAccessQueueSetFromISR();
/* Call the periodic queue overwrite from ISR demo. */ /* Call the periodic queue overwrite from ISR demo. */
vQueueOverwritePeriodicISRDemo(); vQueueOverwritePeriodicISRDemo();
/* Write to a queue that is in use as part of the queue set demo to
demonstrate using queue sets from an ISR. */
vQueueSetAccessQueueSetFromISR();
vQueueSetPollingInterruptAccess();
/* Exercise event groups from interrupts. */ /* Exercise event groups from interrupts. */
vPeriodicEventGroupsProcessing(); vPeriodicEventGroupsProcessing();
/* Exercise giving mutexes from an interrupt. */ /* Exercise giving mutexes from an interrupt. */
vInterruptSemaphorePeriodicTest(); vInterruptSemaphorePeriodicTest();
/* Exercise using task notifications from an interrupt. */ /* Queue set access from interrupt. */
xNotifyTaskFromISR(); vQueueSetPollingInterruptAccess();
/* Call the periodic timer test, which tests the timer API functions that
* can be called from an ISR. */
#if( configUSE_PREEMPTION != 0 )
{
/* Only created when preemption is used. */
vTimerPeriodicISRTests();
}
#endif
/* Writes to stream buffer byte by byte to test the stream buffer trigger /* Writes to stream buffer byte by byte to test the stream buffer trigger
level functionality. */ * level functionality. */
vPeriodicStreamBufferProcessing(); vPeriodicStreamBufferProcessing();
/* Writes a string to a string buffer four bytes at a time to demonstrate /* Writes a string to a string buffer four bytes at a time to demonstrate
a stream being sent from an interrupt to a task. */ * a stream being sent from an interrupt to a task. */
vBasicStreamBufferSendFromISR(); vBasicStreamBufferSendFromISR();
} }
#else /* mainENABLE_INT_QUEUE_TESTS */
{
/* Access queues from interrupt. Make sure to access after the queues have
* been created. */
if( xTimerForQueueTestInitialized == pdTRUE )
{
portYIELD_FROM_ISR( xFirstTimerHandler() );
}
}
#endif /* mainENABLE_INT_QUEUE_TESTS */
}
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
static void prvRegTest1Task( void *pvParameters )
{
/* Although the regtest task is written in assembly, its entry point is
* written in C for convenience of checking the task parameter is being
* passed in correctly. */
if( pvParameters == mainREG_TEST_TASK_1_PARAMETER )
{
/* Start the part of the test that is written in assembly. */
vRegTest1();
}
/* The following line will only execute if the task parameter is found to
* be incorrect. The check task will detect that the regtest loop counter is
* not being incremented and flag an error. */
vTaskDelete( NULL );
}
/*-----------------------------------------------------------*/
static void prvRegTest2Task( void *pvParameters )
{
/* Although the regtest task is written in assembly, its entry point is
* written in C for convenience of checking the task parameter is being
* passed in correctly. */
if( pvParameters == mainREG_TEST_TASK_2_PARAMETER )
{
/* Start the part of the test that is written in assembly. */
vRegTest2();
}
/* The following line will only execute if the task parameter is found to
* be incorrect. The check task will detect that the regtest loop counter is
* not being incremented and flag an error. */
vTaskDelete( NULL );
}
/*-----------------------------------------------------------*/

View file

@ -43,15 +43,15 @@
vRegTest1: vRegTest1:
/* Set initial values into the general purpose registers. */ /* Set initial values into the general purpose registers.
/* a0 = return address, a1 = stack pointer. */ * a0 = return address, a1 = stack pointer. */
#ifdef __XTENSA_WINDOWED_ABI__ #ifdef __XTENSA_WINDOWED_ABI__
entry a1, 64 entry a1, 64
s32i a0, a1, 0 /* Save return address */ s32i a0, a1, 0 /* Save return address. */
#else #else
addi a1, a1, -64 addi a1, a1, -64
s32i a0, a1, 0 /* Save return address */ s32i a0, a1, 0 /* Save return address. */
s32i a12, a1, 4 /* Save callee-saved regs if call0 ABI */ s32i a12, a1, 4 /* Save callee-saved regs if call0 ABI. */
s32i a13, a1, 8 s32i a13, a1, 8
s32i a14, a1, 12 s32i a14, a1, 12
s32i a15, a1, 16 s32i a15, a1, 16
@ -74,7 +74,7 @@ vRegTest1:
_RegTest1Loop: _RegTest1Loop:
/* Loop checking the values originally loaded into the general purpose /* Loop checking the values originally loaded into the general purpose
registers remain through the life of the task. */ * registers remain through the life of the task. */
movi a0, 0x11111111 movi a0, 0x11111111
bne a0, a2, _RegTest1Error bne a0, a2, _RegTest1Error
movi a0, 0x22222222 movi a0, 0x22222222
@ -105,7 +105,7 @@ _RegTest1Loop:
bne a0, a15, _RegTest1Error bne a0, a15, _RegTest1Error
/* Incrememnt the loop counter to prove this task has not gone into the /* Incrememnt the loop counter to prove this task has not gone into the
error null loop. */ * error null loop. */
s32i a2, a1, 20 s32i a2, a1, 20
movi a2, ulRegTest1Counter movi a2, ulRegTest1Counter
l32i a0, a2, 0 l32i a0, a2, 0
@ -127,15 +127,15 @@ _RegTest1Error:
vRegTest2: vRegTest2:
/* Set initial values into the general purpose registers. */ /* Set initial values into the general purpose registers.
/* a0 = return address, a1 = stack pointer. */ * a0 = return address, a1 = stack pointer. */
#ifdef __XTENSA_WINDOWED_ABI__ #ifdef __XTENSA_WINDOWED_ABI__
entry a1, 64 entry a1, 64
s32i a0, a1, 0 /* Save return address */ s32i a0, a1, 0 /* Save return address. */
#else #else
addi a1, a1, -64 addi a1, a1, -64
s32i a0, a1, 0 /* Save return address */ s32i a0, a1, 0 /* Save return address. */
s32i a12, a1, 4 /* Save callee-saved regs if call0 ABI */ s32i a12, a1, 4 /* Save callee-saved regs if call0 ABI. */
s32i a13, a1, 8 s32i a13, a1, 8
s32i a14, a1, 12 s32i a14, a1, 12
s32i a15, a1, 16 s32i a15, a1, 16
@ -161,7 +161,7 @@ _ReInit:
_RegTest2Loop: _RegTest2Loop:
/* Loop checking the values originally loaded into the general purpose /* Loop checking the values originally loaded into the general purpose
registers remain through the life of the task. */ * registers remain through the life of the task. */
movi a0, 0x01010101 movi a0, 0x01010101
bne a0, a2, _RegTest1Error bne a0, a2, _RegTest1Error
movi a0, 0x02020202 movi a0, 0x02020202
@ -191,9 +191,9 @@ _RegTest2Loop:
movi a0, 0x0e0e0e0e movi a0, 0x0e0e0e0e
bne a0, a15, _RegTest1Error bne a0, a15, _RegTest1Error
/* Force a yield from one of the reg test tasks to increase coverage. */ /* Force a yield from one of the reg test tasks to increase coverage.
/* IMPORTANT: this call will trash some number of registers. Branch */ * IMPORTANT: this call will trash some number of registers. Branch
/* to _ReInit to set things up again. */ * to _ReInit to set things up again. */
#ifdef __XTENSA_WINDOWED_ABI__ #ifdef __XTENSA_WINDOWED_ABI__
call8 vPortYield call8 vPortYield
#else #else
@ -201,7 +201,7 @@ _RegTest2Loop:
#endif #endif
/* Increment the loop counter to prove this task has not gone into the /* Increment the loop counter to prove this task has not gone into the
error null loop. */ * error null loop. */
s32i a2, a1, 20 s32i a2, a1, 20
movi a2, ulRegTest2Counter movi a2, ulRegTest2Counter
l32i a0, a2, 0 l32i a0, a2, 0
@ -210,10 +210,8 @@ _RegTest2Loop:
l32i a2, a1, 20 l32i a2, a1, 20
/* Loop again. */ /* Loop again. */
j _ReInit /* See comments above */ j _ReInit /* See comments above about not using j _RegTest2Loop. */
/* j _RegTest2Loop */
_RegTest2Error: _RegTest2Error:
.L2: .L2:
j .L2 j .L2