]> git.sur5r.net Git - freertos/commitdiff
Update task pool so tasks and timer are allocated statically.
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Tue, 23 Jul 2019 01:46:59 +0000 (01:46 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Tue, 23 Jul 2019 01:46:59 +0000 (01:46 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2695 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

17 files changed:
FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/.cproject [deleted file]
FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/.project [deleted file]
FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/.settings/language.settings.xml [deleted file]
FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/.settings/org.eclipse.cdt.managedbuilder.core.prefs [deleted file]
FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/Configuration_Files/FreeRTOSConfig.h [deleted file]
FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/Configuration_Files/iot_config.h [deleted file]
FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/Configuration_Files/iot_config_common.h [deleted file]
FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/main.c [deleted file]
FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/task_pool/DemoTasks/SimpleTaskPoolExamples.c
FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/task_pool/FreeRTOSConfig.h
FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/task_pool/WIN32.vcxproj
FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/task_pool/WIN32.vcxproj.filters
FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/task_pool/iot_config.h
FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/task_pool/iot_config_common.h
FreeRTOS-Plus/Source/FreeRTOS-Plus-IoT-SDK/c_sdk/standard/common/include/private/iot_taskpool_internal.h
FreeRTOS-Plus/Source/FreeRTOS-Plus-IoT-SDK/c_sdk/standard/common/include/types/iot_taskpool_types.h
FreeRTOS-Plus/Source/FreeRTOS-Plus-IoT-SDK/c_sdk/standard/common/taskpool/iot_taskpool.c

diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/.cproject b/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/.cproject
deleted file mode 100644 (file)
index 30bb63e..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?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.1831810452">\r
-                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.1831810452" moduleId="org.eclipse.cdt.core.settings" name="Debug">\r
-                               <externalSettings/>\r
-                               <extensions>\r
-                                       <extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>\r
-                                       <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\r
-                                       <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>\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.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.debug.1831810452" name="Debug" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=" parent="cdt.managedbuild.config.gnu.mingw.exe.debug">\r
-                                       <folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.debug.1831810452." name="/" resourcePath="">\r
-                                               <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.debug.1903348216" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.debug">\r
-                                                       <targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.exe.debug.268983007" 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.1647672995" 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.584296416" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug">\r
-                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.589299609" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>\r
-                                                       </tool>\r
-                                                       <tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.1943902703" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>\r
-                                                       <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.542252967" 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.1925268657" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>\r
-                                                               <option defaultValue="gnu.cpp.compiler.debugging.level.max" id="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level.1472840188" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level" useByScannerDiscovery="false" valueType="enumerated"/>\r
-                                                       </tool>\r
-                                                       <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1633570708" 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.748078434" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.debug.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>\r
-                                                               <option defaultValue="gnu.c.debugging.level.max" id="gnu.c.compiler.mingw.exe.debug.option.debugging.level.447506110" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.debug.option.debugging.level" useByScannerDiscovery="false" valueType="enumerated"/>\r
-                                                               <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.1866853825" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">\r
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS-Plus-IoT-SDK/abstractions/platform/freertos/include}&quot;"/>\r
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS-Plus-IoT-SDK/abstractions/platform/include}&quot;"/>\r
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS-Plus-IoT-SDK/c_sdk/standard/common/include}&quot;"/>\r
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Kernel_Source/include}&quot;"/>\r
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/Configuration_Files}&quot;"/>\r
-                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Kernel_Source/portable/MSVC-MingW}&quot;"/>\r
-                                                               </option>\r
-                                                               <option id="gnu.c.compiler.option.dialect.std.384334774" superClass="gnu.c.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>\r
-                                                               <option id="gnu.c.compiler.option.warnings.extrawarn.1569496507" superClass="gnu.c.compiler.option.warnings.extrawarn" useByScannerDiscovery="false" value="true" valueType="boolean"/>\r
-                                                               <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1834606887" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>\r
-                                                       </tool>\r
-                                                       <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.1891140991" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug">\r
-                                                               <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.link.option.libs.497765000" name="Libraries (-l)" superClass="gnu.c.link.option.libs" useByScannerDiscovery="false" valueType="libs">\r
-                                                                       <listOptionValue builtIn="false" value="winmm"/>\r
-                                                               </option>\r
-                                                               <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.343304874" 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.1182698545" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug"/>\r
-                                               </toolChain>\r
-                                       </folderInfo>\r
-                                       <sourceEntries>\r
-                                               <entry excluding="FreeRTOS+IoT-SDK/standard/common/logging|FreeRTOS+IoT-SDK/standard/common/test" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>\r
-                                       </sourceEntries>\r
-                               </configuration>\r
-                       </storageModule>\r
-                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>\r
-               </cconfiguration>\r
-       </storageModule>\r
-       <storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
-               <project id="RTOSDemo.cdt.managedbuild.target.gnu.mingw.exe.838096059" name="Executable" projectType="cdt.managedbuild.target.gnu.mingw.exe"/>\r
-       </storageModule>\r
-       <storageModule moduleId="scannerConfiguration">\r
-               <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>\r
-               <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1831810452;cdt.managedbuild.config.gnu.mingw.exe.debug.1831810452.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1633570708;cdt.managedbuild.tool.gnu.c.compiler.input.1834606887">\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"/>\r
-</cproject>\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/.project b/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/.project
deleted file mode 100644 (file)
index ad46abe..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<projectDescription>\r
-       <name>RTOSDemo</name>\r
-       <comment></comment>\r
-       <projects>\r
-       </projects>\r
-       <buildSpec>\r
-               <buildCommand>\r
-                       <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>\r
-                       <triggers>clean,full,incremental,</triggers>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-               <buildCommand>\r
-                       <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>\r
-                       <triggers>full,incremental,</triggers>\r
-                       <arguments>\r
-                       </arguments>\r
-               </buildCommand>\r
-       </buildSpec>\r
-       <natures>\r
-               <nature>org.eclipse.cdt.core.cnature</nature>\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-Plus-IoT-SDK</name>\r
-                       <type>2</type>\r
-                       <locationURI>virtual:/virtual</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS_Kernel_Source</name>\r
-                       <type>2</type>\r
-                       <locationURI>virtual:/virtual</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS-Plus-IoT-SDK/abstractions</name>\r
-                       <type>2</type>\r
-                       <locationURI>virtual:/virtual</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS-Plus-IoT-SDK/c_sdk</name>\r
-                       <type>2</type>\r
-                       <locationURI>virtual:/virtual</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS_Kernel_Source/event_groups.c</name>\r
-                       <type>1</type>\r
-                       <locationURI>FREERTOS_ROOT/FreeRTOS/Source/event_groups.c</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS_Kernel_Source/include</name>\r
-                       <type>2</type>\r
-                       <locationURI>FREERTOS_ROOT/FreeRTOS/Source/include</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS_Kernel_Source/list.c</name>\r
-                       <type>1</type>\r
-                       <locationURI>FREERTOS_ROOT/FreeRTOS/Source/list.c</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS_Kernel_Source/portable</name>\r
-                       <type>2</type>\r
-                       <locationURI>virtual:/virtual</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS_Kernel_Source/queue.c</name>\r
-                       <type>1</type>\r
-                       <locationURI>FREERTOS_ROOT/FreeRTOS/Source/queue.c</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS_Kernel_Source/readme.txt</name>\r
-                       <type>1</type>\r
-                       <locationURI>FREERTOS_ROOT/FreeRTOS/Source/readme.txt</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS_Kernel_Source/stream_buffer.c</name>\r
-                       <type>1</type>\r
-                       <locationURI>FREERTOS_ROOT/FreeRTOS/Source/stream_buffer.c</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS_Kernel_Source/tasks.c</name>\r
-                       <type>1</type>\r
-                       <locationURI>FREERTOS_ROOT/FreeRTOS/Source/tasks.c</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS_Kernel_Source/timers.c</name>\r
-                       <type>1</type>\r
-                       <locationURI>FREERTOS_ROOT/FreeRTOS/Source/timers.c</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS-Plus-IoT-SDK/abstractions/platform</name>\r
-                       <type>2</type>\r
-                       <locationURI>virtual:/virtual</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS-Plus-IoT-SDK/c_sdk/standard</name>\r
-                       <type>2</type>\r
-                       <locationURI>virtual:/virtual</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS_Kernel_Source/portable/MSVC-MingW</name>\r
-                       <type>2</type>\r
-                       <locationURI>FREERTOS_ROOT/FreeRTOS/Source/portable/MSVC-MingW</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS_Kernel_Source/portable/MemMang</name>\r
-                       <type>2</type>\r
-                       <locationURI>virtual:/virtual</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS-Plus-IoT-SDK/abstractions/platform/freertos</name>\r
-                       <type>2</type>\r
-                       <locationURI>virtual:/virtual</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS-Plus-IoT-SDK/abstractions/platform/include</name>\r
-                       <type>2</type>\r
-                       <locationURI>FREERTOS_ROOT/FreeRTOS-Plus/Source/FreeRTOS-Plus-IoT-SDK/abstractions/platform/include</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS-Plus-IoT-SDK/c_sdk/standard/common</name>\r
-                       <type>2</type>\r
-                       <locationURI>virtual:/virtual</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS_Kernel_Source/portable/MemMang/heap_4.c</name>\r
-                       <type>1</type>\r
-                       <locationURI>FREERTOS_ROOT/FreeRTOS/Source/portable/MemMang/heap_4.c</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS-Plus-IoT-SDK/abstractions/platform/freertos/include</name>\r
-                       <type>2</type>\r
-                       <locationURI>FREERTOS_ROOT/FreeRTOS-Plus/Source/FreeRTOS-Plus-IoT-SDK/abstractions/platform/freertos/include</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS-Plus-IoT-SDK/c_sdk/standard/common/include</name>\r
-                       <type>2</type>\r
-                       <locationURI>FREERTOS_ROOT/FreeRTOS-Plus/Source/FreeRTOS-Plus-IoT-SDK/c_sdk/standard/common/include</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS-Plus-IoT-SDK/c_sdk/standard/common/taskpool</name>\r
-                       <type>2</type>\r
-                       <locationURI>virtual:/virtual</locationURI>\r
-               </link>\r
-               <link>\r
-                       <name>FreeRTOS-Plus-IoT-SDK/c_sdk/standard/common/taskpool/iot_taskpool.c</name>\r
-                       <type>1</type>\r
-                       <locationURI>FREERTOS_ROOT/FreeRTOS-Plus/Source/FreeRTOS-Plus-IoT-SDK/c_sdk/standard/common/taskpool/iot_taskpool.c</locationURI>\r
-               </link>\r
-       </linkedResources>\r
-       <variableList>\r
-               <variable>\r
-                       <name>FREERTOS_ROOT</name>\r
-                       <value>$%7BPARENT-4-PROJECT_LOC%7D</value>\r
-               </variable>\r
-       </variableList>\r
-</projectDescription>\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/.settings/language.settings.xml b/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/.settings/language.settings.xml
deleted file mode 100644 (file)
index aa36f48..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
-<project>\r
-       <configuration id="cdt.managedbuild.config.gnu.mingw.exe.debug.1831810452" name="Debug">\r
-               <extension point="org.eclipse.cdt.core.LanguageSettingsProvider">\r
-                       <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>\r
-                       <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>\r
-                       <provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>\r
-                       <provider class="org.eclipse.cdt.managedbuilder.internal.language.settings.providers.GCCBuiltinSpecsDetectorMinGW" console="false" env-hash="1351656224547092082" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetectorMinGW" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings MinGW" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">\r
-                               <language-scope id="org.eclipse.cdt.core.gcc"/>\r
-                               <language-scope id="org.eclipse.cdt.core.g++"/>\r
-                       </provider>\r
-               </extension>\r
-       </configuration>\r
-</project>\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/.settings/org.eclipse.cdt.managedbuilder.core.prefs b/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/.settings/org.eclipse.cdt.managedbuilder.core.prefs
deleted file mode 100644 (file)
index b585672..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-eclipse.preferences.version=1\r
-environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1831810452/CPATH/delimiter=;\r
-environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1831810452/CPATH/operation=remove\r
-environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1831810452/C_INCLUDE_PATH/delimiter=;\r
-environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1831810452/C_INCLUDE_PATH/operation=remove\r
-environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1831810452/append=true\r
-environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1831810452/appendContributed=true\r
-environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1831810452/LIBRARY_PATH/delimiter=;\r
-environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1831810452/LIBRARY_PATH/operation=remove\r
-environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1831810452/append=true\r
-environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1831810452/appendContributed=true\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/Configuration_Files/FreeRTOSConfig.h b/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/Configuration_Files/FreeRTOSConfig.h
deleted file mode 100644 (file)
index 0fc6b57..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/*\r
- * FreeRTOS Kernel V10.2.1\r
- * Copyright (C) 2019 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
- * this software and associated documentation files (the "Software"), to deal in\r
- * the Software without restriction, including without limitation the rights to\r
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
- * the Software, and to permit persons to whom the Software is furnished to do so,\r
- * subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included in all\r
- * copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- *\r
- * http://www.FreeRTOS.org\r
- * http://aws.amazon.com/freertos\r
- *\r
- * 1 tab == 4 spaces!\r
- */\r
-#ifndef FREERTOS_CONFIG_H\r
-#define FREERTOS_CONFIG_H\r
-\r
-/*-----------------------------------------------------------\r
- * Application specific definitions.\r
- *\r
- * These definitions should be adjusted for your particular hardware and\r
- * application requirements.\r
- *\r
- * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE\r
- * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.  See\r
- * http://www.freertos.org/a00110.html\r
- *----------------------------------------------------------*/\r
-\r
-#define configUSE_PREEMPTION                                   1\r
-#define configUSE_PORT_OPTIMISED_TASK_SELECTION        1\r
-#define configUSE_IDLE_HOOK                                            1\r
-#define configUSE_TICK_HOOK                                            1\r
-#define configUSE_DAEMON_TASK_STARTUP_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 ) 70 ) /* 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 ) ( 65 * 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_MUTEXES                                              1\r
-#define configCHECK_FOR_STACK_OVERFLOW                 0\r
-#define configUSE_RECURSIVE_MUTEXES                            1\r
-#define configQUEUE_REGISTRY_SIZE                              20\r
-#define configUSE_APPLICATION_TASK_TAG                 1\r
-#define configUSE_COUNTING_SEMAPHORES                  1\r
-#define configUSE_ALTERNATIVE_API                              0\r
-#define configUSE_QUEUE_SETS                                   1\r
-#define configUSE_TASK_NOTIFICATIONS                   1\r
-#define configSUPPORT_STATIC_ALLOCATION                        1\r
-\r
-/* Software timer related configuration options.  The maximum possible task\r
-priority is configMAX_PRIORITIES - 1.  The priority of the timer task is\r
-deliberately set higher to ensure it is correctly capped back to\r
-configMAX_PRIORITIES - 1. */\r
-#define configUSE_TIMERS                                               1\r
-#define configTIMER_TASK_PRIORITY                              ( configMAX_PRIORITIES - 1 )\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 configuration options. */\r
-#define configGENERATE_RUN_TIME_STATS                  0\r
-\r
-/* Co-routine related configuration options. */\r
-#define configUSE_CO_ROUTINES                                  0\r
-#define configMAX_CO_ROUTINE_PRIORITIES                        ( 2 )\r
-\r
-/* This demo can use of one or more example stats formatting functions.  These\r
-format the raw data provided by the uxTaskGetSystemState() function in to human\r
-readable ASCII form.  See the notes in the implementation of vTaskList() within\r
-FreeRTOS/Source/tasks.c for limitations. */\r
-#define configUSE_STATS_FORMATTING_FUNCTIONS   0\r
-\r
-/* Enables the test whereby a stack larger than the total heap size is\r
-requested. */\r
-#define configSTACK_DEPTH_TYPE uint32_t\r
-\r
-/* Set the following definitions to 1 to include the API function, or zero\r
-to exclude the API function.  In most cases the linker will remove unused\r
-functions anyway. */\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_uxTaskGetStackHighWaterMark2   1\r
-#define INCLUDE_xTaskGetSchedulerState                 1\r
-#define INCLUDE_xTimerGetTimerDaemonTaskHandle 1\r
-#define INCLUDE_xTaskGetIdleTaskHandle                 1\r
-#define INCLUDE_xTaskGetHandle                                 1\r
-#define INCLUDE_eTaskGetState                                  1\r
-#define INCLUDE_xSemaphoreGetMutexHolder               1\r
-#define INCLUDE_xTimerPendFunctionCall                 1\r
-#define INCLUDE_xTaskAbortDelay                                        1\r
-\r
-#define configINCLUDE_MESSAGE_BUFFER_AMP_DEMO  0\r
-#if ( configINCLUDE_MESSAGE_BUFFER_AMP_DEMO == 1 )\r
-       extern void vGenerateCoreBInterrupt( void * xUpdatedMessageBuffer );\r
-       #define sbSEND_COMPLETED( pxStreamBuffer ) vGenerateCoreBInterrupt( pxStreamBuffer )\r
-#endif /* configINCLUDE_MESSAGE_BUFFER_AMP_DEMO */\r
-\r
-extern void vAssertCalled( unsigned long ulLine, const char * const pcFileName );\r
-\r
-/* It is best practice to define configASSERT() while developing.  configASSERT()\r
-uses the same semantics as the standard C assert() macro.  Don't define\r
-configASSERT() when performing code coverage tests though, as it is not\r
-intended to asserts() to fail, some some code is intended not to run if no\r
-errors are present. */\r
-#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __LINE__, __FILE__ )\r
-\r
-#define configUSE_MALLOC_FAILED_HOOK                   1\r
-\r
-#endif /* FREERTOS_CONFIG_H */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/Configuration_Files/iot_config.h b/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/Configuration_Files/iot_config.h
deleted file mode 100644 (file)
index 3038f0b..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*\r
- * Copyright (C) 2018 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
- * this software and associated documentation files (the "Software"), to deal in\r
- * the Software without restriction, including without limitation the rights to\r
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
- * the Software, and to permit persons to whom the Software is furnished to do so,\r
- * subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included in all\r
- * copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- */\r
-\r
-/* This file contains configuration settings for the demos. */\r
-\r
-#ifndef IOT_CONFIG_H_\r
-#define IOT_CONFIG_H_\r
-\r
-/* How long the MQTT library will wait for PINGRESPs or PUBACKs. */\r
-#define IOT_MQTT_RESPONSE_WAIT_MS            ( 10000 )\r
-\r
-/* MQTT demo configuration. */\r
-#define IOT_DEMO_MQTT_PUBLISH_BURST_COUNT    ( 10 )\r
-#define IOT_DEMO_MQTT_PUBLISH_BURST_SIZE     ( 2 )\r
-\r
-/* Shadow demo configuration. The demo publishes periodic Shadow updates and responds\r
- * to changing Shadows. */\r
-#define AWS_IOT_DEMO_SHADOW_UPDATE_COUNT        ( 20 )   /* Number of updates to publish. */\r
-#define AWS_IOT_DEMO_SHADOW_UPDATE_PERIOD_MS    ( 3000 ) /* Period of Shadow updates. */\r
-\r
-/* Library logging configuration. IOT_LOG_LEVEL_GLOBAL provides a global log\r
- * level for all libraries; the library-specific settings override the global\r
- * setting. If both the library-specific and global settings are undefined,\r
- * no logs will be printed. */\r
-#define IOT_LOG_LEVEL_GLOBAL                    IOT_LOG_INFO\r
-#define IOT_LOG_LEVEL_DEMO                      IOT_LOG_INFO\r
-#define IOT_LOG_LEVEL_PLATFORM                  IOT_LOG_NONE\r
-#define IOT_LOG_LEVEL_NETWORK                   IOT_LOG_INFO\r
-#define IOT_LOG_LEVEL_TASKPOOL                  IOT_LOG_NONE\r
-#define IOT_LOG_LEVEL_MQTT                      IOT_LOG_INFO\r
-#define AWS_IOT_LOG_LEVEL_SHADOW                IOT_LOG_INFO\r
-#define AWS_IOT_LOG_LEVEL_DEFENDER              IOT_LOG_INFO\r
-\r
-/* Platform thread stack size and priority. */\r
-#define IOT_THREAD_DEFAULT_STACK_SIZE    2048\r
-#define IOT_THREAD_DEFAULT_PRIORITY      5\r
-\r
-/* Include the common configuration file for FreeRTOS. */\r
-#include "iot_config_common.h"\r
-\r
-#endif /* ifndef IOT_CONFIG_H_ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/Configuration_Files/iot_config_common.h b/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/Configuration_Files/iot_config_common.h
deleted file mode 100644 (file)
index ab85d95..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-/*\r
- * Amazon FreeRTOS V201906.00 Major\r
- * Copyright (C) 2019 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
- * this software and associated documentation files (the "Software"), to deal in\r
- * the Software without restriction, including without limitation the rights to\r
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
- * the Software, and to permit persons to whom the Software is furnished to do so,\r
- * subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included in all\r
- * copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- *\r
- * http://aws.amazon.com/freertos\r
- * http://www.FreeRTOS.org\r
- */\r
-\r
-/* This file contains default configuration settings for the demos on FreeRTOS. */\r
-\r
-#ifndef IOT_CONFIG_COMMON_H_\r
-#define IOT_CONFIG_COMMON_H_\r
-\r
-/* FreeRTOS include. */\r
-#include "FreeRTOS.h"\r
-\r
-/* Use platform types on FreeRTOS. */\r
-#include "platform/iot_platform_types_afr.h"\r
-\r
-/* Used to get the cloud broker endpoint for FreeRTOS. */\r
-//_RB_#include "aws_clientcredential.h"\r
-\r
-/* SDK version. */\r
-#define IOT_SDK_VERSION    "4.0.0"\r
-\r
-/* This config file is for the demos; disable any test code. */\r
-#define IOT_BUILD_TESTS    ( 0 )\r
-\r
-/* Logging puts function. */\r
-#define IotLogging_Puts( str )                 configPRINTF( ( "%s\r\n", str ) )\r
-\r
-/* Enable asserts in libraries by default. */\r
-#ifndef IOT_METRICS_ENABLE_ASSERTS\r
-    #define IOT_METRICS_ENABLE_ASSERTS         ( 1 )\r
-#endif\r
-#ifndef IOT_CONTAINERS_ENABLE_ASSERTS\r
-    #define IOT_CONTAINERS_ENABLE_ASSERTS      ( 1 )\r
-#endif\r
-#ifndef IOT_TASKPOOL_ENABLE_ASSERTS\r
-    #define IOT_TASKPOOL_ENABLE_ASSERTS        ( 1 )\r
-#endif\r
-#ifndef IOT_MQTT_ENABLE_ASSERTS\r
-    #define IOT_MQTT_ENABLE_ASSERTS            ( 1 )\r
-#endif\r
-#ifndef AWS_IOT_SHADOW_ENABLE_ASSERTS\r
-    #define AWS_IOT_SHADOW_ENABLE_ASSERTS      ( 1 )\r
-#endif\r
-#ifndef AWS_IOT_DEFENDER_ENABLE_ASSERTS\r
-    #define AWS_IOT_DEFENDER_ENABLE_ASSERTS    ( 1 )\r
-#endif\r
-#ifndef IOT_BLE_ENABLE_ASSERTS\r
-    #define IOT_BLE_ENABLE_ASSERTS             ( 1 )\r
-#endif\r
-\r
-/* Assert functions. */\r
-#define IotMetrics_Assert( expression )        configASSERT( expression )\r
-#define IotContainers_Assert( expression )     configASSERT( expression )\r
-#define IotTaskPool_Assert( expression )       configASSERT( expression )\r
-#define IotMqtt_Assert( expression )           configASSERT( expression )\r
-#define AwsIotShadow_Assert( expression )      configASSERT( expression )\r
-#define AwsIotDefender_Assert( expression )    configASSERT( expression )\r
-#define IotBle_Assert( expression )            configASSERT( expression )\r
-\r
-/* Control the usage of dynamic memory allocation. */\r
-#ifndef IOT_STATIC_MEMORY_ONLY\r
-    #define IOT_STATIC_MEMORY_ONLY    ( 0 )\r
-#endif\r
-\r
-/* Memory allocation configuration. Note that these functions will not be affected\r
- * by IOT_STATIC_MEMORY_ONLY. */\r
-#define IotNetwork_Malloc    pvPortMalloc\r
-#define IotNetwork_Free      vPortFree\r
-#define IotThreads_Malloc    pvPortMalloc\r
-#define IotThreads_Free      vPortFree\r
-#define IotLogging_Malloc    pvPortMalloc\r
-#define IotLogging_Free      vPortFree\r
-#define IotBle_Malloc        pvPortMalloc\r
-#define IotBle_Free          vPortFree\r
-/* #define IotLogging_StaticBufferSize */\r
-\r
-/* Memory allocation function configuration for the MQTT and Defender library.\r
- * These libraries will be affected by IOT_STATIC_MEMORY_ONLY. */\r
-#if IOT_STATIC_MEMORY_ONLY == 0\r
-    #define IotMetrics_MallocTcpConnection       pvPortMalloc\r
-    #define IotMetrics_FreeTcpConnection         vPortFree\r
-    #define IotMetrics_MallocIpAddress           pvPortMalloc\r
-    #define IotMetrics_FreeIpAddress             vPortFree\r
-\r
-    #define IotTaskPool_MallocTaskPool           pvPortMalloc\r
-    #define IotTaskPool_FreeTaskPool             vPortFree\r
-    #define IotTaskPool_MallocJob                pvPortMalloc\r
-    #define IotTaskPool_FreeJob                  vPortFree\r
-    #define IotTaskPool_MallocTimerEvent         pvPortMalloc\r
-    #define IotTaskPool_FreeTimerEvent           vPortFree\r
-\r
-    #define IotMqtt_MallocConnection             pvPortMalloc\r
-    #define IotMqtt_FreeConnection               vPortFree\r
-    #define IotMqtt_MallocMessage                pvPortMalloc\r
-    #define IotMqtt_FreeMessage                  vPortFree\r
-    #define IotMqtt_MallocOperation              pvPortMalloc\r
-    #define IotMqtt_FreeOperation                vPortFree\r
-    #define IotMqtt_MallocSubscription           pvPortMalloc\r
-    #define IotMqtt_FreeSubscription             vPortFree\r
-\r
-    #define IotSerializer_MallocCborEncoder      pvPortMalloc\r
-    #define IotSerializer_FreeCborEncoder        vPortFree\r
-    #define IotSerializer_MallocCborParser       pvPortMalloc\r
-    #define IotSerializer_FreeCborParser         vPortFree\r
-    #define IotSerializer_MallocCborValue        pvPortMalloc\r
-    #define IotSerializer_FreeCborValue          vPortFree\r
-    #define IotSerializer_MallocDecoderObject    pvPortMalloc\r
-    #define IotSerializer_FreeDecoderObject      vPortFree\r
-\r
-    #define AwsIotShadow_MallocOperation         pvPortMalloc\r
-    #define AwsIotShadow_FreeOperation           vPortFree\r
-    #define AwsIotShadow_MallocString            pvPortMalloc\r
-    #define AwsIotShadow_FreeString              vPortFree\r
-    #define AwsIotShadow_MallocSubscription      pvPortMalloc\r
-    #define AwsIotShadow_FreeSubscription        vPortFree\r
-\r
-    #define AwsIotDefender_MallocReport          pvPortMalloc\r
-    #define AwsIotDefender_FreeReport            vPortFree\r
-    #define AwsIotDefender_MallocTopic           pvPortMalloc\r
-    #define AwsIotDefender_FreeTopic             vPortFree\r
-#endif /* if IOT_STATIC_MEMORY_ONLY == 0 */\r
-\r
-/* Default platform thread stack size and priority. */\r
-#ifndef IOT_THREAD_DEFAULT_STACK_SIZE\r
-    #define IOT_THREAD_DEFAULT_STACK_SIZE    2048\r
-#endif\r
-#ifndef IOT_THREAD_DEFAULT_PRIORITY\r
-    #define IOT_THREAD_DEFAULT_PRIORITY      tskIDLE_PRIORITY\r
-#endif\r
-\r
-/* Platform network configuration. */\r
-#ifndef IOT_NETWORK_RECEIVE_TASK_PRIORITY\r
-    #define IOT_NETWORK_RECEIVE_TASK_PRIORITY      ( tskIDLE_PRIORITY + 1 )\r
-#endif\r
-#ifndef IOT_NETWORK_RECEIVE_TASK_STACK_SIZE\r
-    #define IOT_NETWORK_RECEIVE_TASK_STACK_SIZE    IOT_THREAD_DEFAULT_STACK_SIZE\r
-#endif\r
-\r
-/* Platform and SDK name for AWS IoT MQTT metrics. Only used when\r
- * AWS_IOT_MQTT_ENABLE_METRICS is 1. */\r
-#define IOT_SDK_NAME             "AmazonFreeRTOS"\r
-#ifdef configPLATFORM_NAME\r
-    #define IOT_PLATFORM_NAME    configPLATFORM_NAME\r
-#else\r
-    #define IOT_PLATFORM_NAME    "Unknown"\r
-#endif\r
-\r
-/* Cloud endpoint to which the device connects to. */\r
-#define IOT_CLOUD_ENDPOINT                    clientcredentialMQTT_BROKER_ENDPOINT\r
-\r
-/**\r
- * @brief Unique identifier used to recognize a device by the cloud.\r
- * This could be SHA-256 of the device certificate.\r
- */\r
-extern const char *getDeviceIdentifier( void );\r
-#define IOT_DEVICE_IDENTIFIER                getDeviceIdentifier()\r
-\r
-/**\r
- * @brief Metrics emitted by the device.\r
- */\r
-extern const char *getDeviceMetrics( void );\r
-#define AWS_IOT_METRICS_USERNAME     getDeviceMetrics()\r
-\r
-/**\r
- * @brief Length of the metrics emitted by device.\r
- */\r
-extern uint16_t getDeviceMetricsLength( void );\r
-#define AWS_IOT_METRICS_USERNAME_LENGTH getDeviceMetricsLength()\r
-\r
-/* Define the data type of metrics connection id as same as Socket_t in aws_secure_socket.h */\r
-#define IotMetricsConnectionId_t            void *\r
-\r
-/* Configuration for defender demo: set format to CBOR. */\r
-#define AWS_IOT_DEFENDER_FORMAT             AWS_IOT_DEFENDER_FORMAT_CBOR\r
-\r
-/* Configuration for defender demo: use long tag for readable output. Please use short tag for the real application. */\r
-#define AWS_IOT_DEFENDER_USE_LONG_TAG       ( 1 )\r
-\r
-/* Demo runner configuration. */\r
-//_RB_#include "aws_demo_config.h"\r
-\r
-#endif /* ifndef IOT_CONFIG_COMMON_H_ */\r
diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/main.c b/FreeRTOS-Plus/Demo/FreeRTOS_IoT_Libraries/TaskPool/main.c
deleted file mode 100644 (file)
index a18b366..0000000
+++ /dev/null
@@ -1,724 +0,0 @@
-/*\r
- * FreeRTOS Kernel V10.2.1\r
- * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
- * this software and associated documentation files (the "Software"), to deal in\r
- * the Software without restriction, including without limitation the rights to\r
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
- * the Software, and to permit persons to whom the Software is furnished to do so,\r
- * subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included in all\r
- * copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
- *\r
- * http://www.FreeRTOS.org\r
- * http://aws.amazon.com/freertos\r
- *\r
- * 1 tab == 4 spaces!\r
- */\r
-\r
-/* Kernel includes. */\r
-#include "FreeRTOS.h"\r
-#include "task.h"\r
-\r
-/* Standard includes. */\r
-#include <stdio.h>\r
-\r
-/* IoT SDK includes. */\r
-#include "iot_taskpool.h"\r
-\r
-/* The priority at which that tasks in the task pool (the worker tasks) get\r
-created. */\r
-#define tpTASK_POOL_WORKER_PRIORITY            1\r
-\r
-/*\r
- * Prototypes for the functions that demonstrate the task pool API.\r
- */\r
-static void prvExample_BasicSingleJob( void );\r
-static void prvExample_DeferredSingleJob( void );\r
-static void prvExample_BasicRecyclableJob( void );\r
-static void prvExample_ReuseRecyclableJobFromLowPriorityTask( void );\r
-static void prvExample_ReuseRecyclableJobFromHighPriorityTask( void );\r
-\r
-/* Prototypes of the callback functions used in the examples. */\r
-static void prvSimpleTaskNotifyCallback( IotTaskPool_t pTaskPool, IotTaskPoolJob_t pJob, void *pUserContext );\r
-\r
-/*\r
- * Prototypes for the standard FreeRTOS application hook (callback) functions\r
- * implemented within this file.  See http://www.freertos.org/a00016.html .\r
- */\r
-void vApplicationMallocFailedHook( void );\r
-void vApplicationIdleHook( void );\r
-void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName );\r
-void vApplicationTickHook( void );\r
-void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize );\r
-void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer, StackType_t **ppxTimerTaskStackBuffer, uint32_t *pulTimerTaskStackSize );\r
-\r
-/*\r
- * The task used to demonstrate the task pool API.\r
- */\r
-static void prvTaskPoolDemoTask( void *pvParameters );\r
-\r
-static const IotTaskPoolInfo_t xTaskPoolParameters = {\r
-                                                                                                               /* Minimum number of threads in a task pool. */\r
-                                                                                                               2,\r
-                                                                                                               /* Maximum number of threads in a task pool. */\r
-                                                                                                               2,\r
-                                                                                                               /* Stack size for every task pool thread - in words, not bytes. */\r
-                                                                                                               configMINIMAL_STACK_SIZE,\r
-                                                                                                               /* Priority for every task pool thread. */\r
-                                                                                                               tpTASK_POOL_WORKER_PRIORITY,\r
-                                                                                                        };\r
-\r
-/*-----------------------------------------------------------*/\r
-\r
-int main( void )\r
-{\r
-       /* This example uses a single application task, which in turn is used to\r
-       create and send jobs to task pool tasks. */\r
-       xTaskCreate( prvTaskPoolDemoTask,               /* Function that implements the task. */\r
-                                "PoolDemo",                            /* Text name for the task - only used for debugging. */\r
-                                configMINIMAL_STACK_SIZE,      /* Size of stack (in words, not bytes) to allocate for the task. */\r
-                                NULL,                                          /* Task parameter - not used in this case. */\r
-                                tskIDLE_PRIORITY,                      /* Task priority, must be between 0 and configMAX_PRIORITIES - 1. */\r
-                                NULL );                                        /* Used to pass out a handle to the created tsak - not used in this case. */\r
-\r
-       vTaskStartScheduler();\r
-\r
-       /* Should not reach here as vTaskStartScheduler() will only return if there\r
-       was insufficient FreeRTOS heap memory to create the Idle or Timer\r
-       Daemon task. */\r
-       return 0;\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static void prvTaskPoolDemoTask( void *pvParameters )\r
-{\r
-IotTaskPoolError_t xResult;\r
-uint32_t ulLoops;\r
-\r
-       /* Remove compiler warnings about unused parameters. */\r
-       ( void ) pvParameters;\r
-\r
-       /* The task pool must be created before it can be used. */\r
-       xResult = IotTaskPool_CreateSystemTaskPool( &xTaskPoolParameters );\r
-       configASSERT( xResult == IOT_TASKPOOL_SUCCESS );\r
-\r
-       /* Attempting to create the task pool again should then appear to succeed\r
-       (in case it is initialised by more than one library), but have no effect. */\r
-       xResult = IotTaskPool_CreateSystemTaskPool( &xTaskPoolParameters );\r
-       configASSERT( xResult == IOT_TASKPOOL_SUCCESS );\r
-\r
-       for( ;; )\r
-       {\r
-               /* Demonstrate the most basic use case where a non persistent job is\r
-               created and scheduled to run immediately.  The task pool worker tasks\r
-               (in which the job callback function executes) have a priority above the\r
-               priority of this task so the job's callback executes as soon as it is\r
-               scheduled. */\r
-               prvExample_BasicSingleJob();\r
-\r
-               /* Demonstrate a job being scheduled to run at some time in the\r
-               future, and how a job scheduled to run in the future can be cancelled if\r
-               it has not yet started executing.  */\r
-               prvExample_DeferredSingleJob();\r
-\r
-               /* Demonstrate the most basic use of a recyclable job.  This is similar\r
-               to prvExample_BasicSingleJob() but using a recyclable job.  Creating a\r
-               recyclable job will re-use a previously created and now spare job from\r
-               the task pool's job cache if one is available, or otherwise dynamically\r
-               create a new job if a spare job is not available in the cache but space\r
-               remains in the cache. */\r
-               prvExample_BasicRecyclableJob();\r
-\r
-               /* Demonstrate multiple recyclable jobs being created, used, and then\r
-               re-used.  In this the task pool worker tasks (in which the job callback\r
-               functions execute) have a priority above the priority of this task so\r
-               the job's callback functions execute as soon as they are scheduled. */\r
-               prvExample_ReuseRecyclableJobFromLowPriorityTask();\r
-\r
-               /* Again demonstrate multiple recyclable jobs being used, but this time\r
-               the priority of the task pool worker tasks (in which the job callback\r
-               functions execute) are lower than the priority of this task so the job's\r
-               callback functions don't execute until this task enteres the blocked\r
-               state. */\r
-               prvExample_ReuseRecyclableJobFromHighPriorityTask();\r
-\r
-               ulLoops++;\r
-               if( ( ulLoops % 10UL ) == 0 )\r
-               {\r
-                       printf( "Performed %u successful iterations.\r\n", ulLoops );\r
-                       fflush( stdout );\r
-               }\r
-       }\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static void prvSimpleTaskNotifyCallback( IotTaskPool_t pTaskPool, IotTaskPoolJob_t pJob, void *pUserContext )\r
-{\r
-TaskHandle_t xTaskToNotify = ( TaskHandle_t ) pUserContext;\r
-\r
-       /* Remove warnings about unused parameters. */\r
-       ( void ) pTaskPool;\r
-       ( void ) pJob;\r
-\r
-       /* Notify the task that created this job. */\r
-       xTaskNotifyGive( xTaskToNotify );\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static void prvExample_BasicSingleJob( void )\r
-{\r
-IotTaskPoolJobStorage_t xJobStorage;\r
-IotTaskPoolJob_t xJob;\r
-IotTaskPoolError_t xResult;\r
-uint32_t ulReturn;\r
-const uint32_t ulNoFlags = 0UL;\r
-const TickType_t xNoDelay = ( TickType_t ) 0;\r
-size_t xFreeHeapBeforeCreatingJob = xPortGetFreeHeapSize();\r
-IotTaskPoolJobStatus_t xJobStatus;\r
-\r
-       /* Don't expect any notifications to be pending yet. */\r
-       configASSERT( ulTaskNotifyTake( pdTRUE, 0 ) == 0 );\r
-\r
-       /* Create and schedule a job using the handle of this task as the job's\r
-       context and the function that sends a notification to the task handle as\r
-       the jobs callback function.  The job is created using storage allocated on\r
-       the stack of this function - so no memory is allocated. */\r
-       xResult = IotTaskPool_CreateJob(  prvSimpleTaskNotifyCallback, /* Callback function. */\r
-                                                                         ( void * ) xTaskGetCurrentTaskHandle(), /* Job context. */\r
-                                                                         &xJobStorage,\r
-                                                                         &xJob );\r
-       configASSERT( xResult == IOT_TASKPOOL_SUCCESS );\r
-\r
-       /* The job has been created but not scheduled so is now ready. */\r
-       IotTaskPool_GetStatus( NULL, xJob, &xJobStatus );\r
-       configASSERT( xJobStatus == IOT_TASKPOOL_STATUS_READY );\r
-\r
-       /* This is not a persistent (recyclable) job and its storage is on the\r
-       stack of this function, so the amount of heap space available should not\r
-       have chanced since entering this function. */\r
-       configASSERT( xFreeHeapBeforeCreatingJob == xPortGetFreeHeapSize() );\r
-\r
-       /* In the full task pool implementation the first parameter is used to\r
-       pass the handle of the task pool to schedule.  The lean task pool\r
-       implementation used in this demo only supports a single task pool, which\r
-       is created internally within the library, so the first parameter is NULL. */\r
-       xResult = IotTaskPool_Schedule( NULL, xJob, ulNoFlags );\r
-       configASSERT( xResult == IOT_TASKPOOL_SUCCESS );\r
-\r
-       /* Look for the notification coming from the job's callback function.  The\r
-       priority of the task pool worker task that executes the callback is higher\r
-       than the priority of this task so a block time is not needed - the task pool\r
-       worker task     pre-empts this task and sends the notification (from the job's\r
-       callback) as soon as the job is scheduled. */\r
-       ulReturn = ulTaskNotifyTake( pdTRUE, xNoDelay );\r
-       configASSERT( ulReturn );\r
-\r
-       /* The job's callback has executed so the job has now completed. */\r
-       IotTaskPool_GetStatus( NULL, xJob, &xJobStatus );\r
-       configASSERT( xJobStatus == IOT_TASKPOOL_STATUS_COMPLETED );\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static void prvExample_DeferredSingleJob( void )\r
-{\r
-IotTaskPoolJobStorage_t xJobStorage;\r
-IotTaskPoolJob_t xJob;\r
-IotTaskPoolError_t xResult;\r
-uint32_t ulReturn;\r
-const uint32_t ulShortDelay_ms = 100UL;\r
-const TickType_t xNoDelay = ( TickType_t ) 0, xAllowableMargin = ( TickType_t ) 5; /* Large margin for Windows port, which is not real time. */\r
-TickType_t xTimeBefore, xElapsedTime, xShortDelay_ticks;\r
-size_t xFreeHeapBeforeCreatingJob = xPortGetFreeHeapSize();\r
-IotTaskPoolJobStatus_t xJobStatus;\r
-\r
-       /* Don't expect any notifications to be pending yet. */\r
-       configASSERT( ulTaskNotifyTake( pdTRUE, 0 ) == 0 );\r
-\r
-       /* Create a job using the handle of this task as the job's context and the\r
-       function that sends a notification to the task handle as the jobs callback\r
-       function.  The job is created using storage allocated on the stack of this\r
-       function - so no memory is allocated. */\r
-       xResult = IotTaskPool_CreateJob(  prvSimpleTaskNotifyCallback, /* Callback function. */\r
-                                                                         ( void * ) xTaskGetCurrentTaskHandle(), /* Job context. */\r
-                                                                         &xJobStorage,\r
-                                                                         &xJob );\r
-       configASSERT( xResult == IOT_TASKPOOL_SUCCESS );\r
-\r
-       /* The job has been created but not scheduled so is now ready. */\r
-       IotTaskPool_GetStatus( NULL, xJob, &xJobStatus );\r
-       configASSERT( xJobStatus == IOT_TASKPOOL_STATUS_READY );\r
-\r
-       /* This is not a persistent (recyclable) job and its storage is on the\r
-       stack of this function, so the amount of heap space available should not\r
-       have chanced since entering this function. */\r
-       configASSERT( xFreeHeapBeforeCreatingJob == xPortGetFreeHeapSize() );\r
-\r
-       /* Schedule the job to run its callback in xShortDelay_ms milliseconds time.\r
-       In the full task pool implementation the first parameter is used to     pass the\r
-       handle of the task pool to schedule.  The lean task pool implementation used\r
-       in this demo only supports a single task pool, which is created internally\r
-       within the library, so the first parameter is NULL. */\r
-       xResult = IotTaskPool_ScheduleDeferred( NULL, xJob, ulShortDelay_ms );\r
-       configASSERT( xResult == IOT_TASKPOOL_SUCCESS );\r
-\r
-       /* The scheduled job should not have executed yet, so don't expect any\r
-       notifications and expect the job's status to be 'deferred'. */\r
-       ulReturn = ulTaskNotifyTake( pdTRUE, xNoDelay );\r
-       configASSERT( ulReturn == 0 );\r
-       IotTaskPool_GetStatus( NULL, xJob, &xJobStatus );\r
-       configASSERT( xJobStatus == IOT_TASKPOOL_STATUS_DEFERRED );\r
-\r
-       /* As the job has not yet been executed it can be stopped. */\r
-       xResult = IotTaskPool_TryCancel( NULL, xJob, &xJobStatus );\r
-       configASSERT( xResult == IOT_TASKPOOL_SUCCESS );\r
-       IotTaskPool_GetStatus( NULL, xJob, &xJobStatus );\r
-       configASSERT( xJobStatus == IOT_TASKPOOL_STATUS_CANCELED );\r
-\r
-       /* Schedule the job again, and this time wait until its callback is\r
-       executed (the callback function sends a notification to this task) to see\r
-       that it executes at the right time. */\r
-       xTimeBefore = xTaskGetTickCount();\r
-       xResult = IotTaskPool_ScheduleDeferred( NULL, xJob, ulShortDelay_ms );\r
-       configASSERT( xResult == IOT_TASKPOOL_SUCCESS );\r
-\r
-       /* Wait twice the deferred execution time to ensure the callback is executed\r
-       before the call below times out. */\r
-       ulReturn = ulTaskNotifyTake( pdTRUE, pdMS_TO_TICKS( ulShortDelay_ms * 2UL ) );\r
-       xElapsedTime = xTaskGetTickCount() - xTimeBefore;\r
-\r
-       /* A single notification should not have been received... */\r
-       configASSERT( ulReturn == 1 );\r
-\r
-       /* ...and the time since scheduling the job should be greater than or\r
-       equal to the deferred execution time - which is converted to ticks for\r
-       comparison. */\r
-       xShortDelay_ticks = pdMS_TO_TICKS( ulShortDelay_ms );\r
-       configASSERT( ( xElapsedTime >= xShortDelay_ticks ) && ( xElapsedTime  < ( xShortDelay_ticks + xAllowableMargin ) ) );\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static void prvExample_BasicRecyclableJob( void )\r
-{\r
-IotTaskPoolJob_t xJob;\r
-IotTaskPoolError_t xResult;\r
-uint32_t ulReturn;\r
-const uint32_t ulNoFlags = 0UL;\r
-const TickType_t xNoDelay = ( TickType_t ) 0;\r
-size_t xFreeHeapBeforeCreatingJob = xPortGetFreeHeapSize();\r
-\r
-       /* Don't expect any notifications to be pending yet. */\r
-       configASSERT( ulTaskNotifyTake( pdTRUE, 0 ) == 0 );\r
-\r
-       /* Create and schedule a job using the handle of this task as the job's\r
-       context and the function that sends a notification to the task handle as\r
-       the jobs callback function.  The job is created as a recyclable job and in\r
-       this case the memory used to hold the job status is allocated inside the\r
-       create function.  As the job is persistent it can be used multiple times,\r
-       as demonstrated in other examples within this demo.  In the full task pool\r
-       implementation the first parameter is used to pass the handle of the task\r
-       pool this recyclable job is to be associated with.  In the lean\r
-       implementation of the task pool used by this demo there is only one task\r
-       pool (the system task pool created within the task pool library) so the\r
-       first parameter is NULL. */\r
-       xResult = IotTaskPool_CreateRecyclableJob( NULL,\r
-                                                                                          prvSimpleTaskNotifyCallback,\r
-                                                                                          (void * ) xTaskGetCurrentTaskHandle(),\r
-                                                                                          &xJob );\r
-       configASSERT( xResult == IOT_TASKPOOL_SUCCESS );\r
-\r
-       /* This recyclable job is persistent, and in this case created dynamically,\r
-       so expect there to be less heap space then when entering the function. */\r
-       configASSERT( xPortGetFreeHeapSize() < xFreeHeapBeforeCreatingJob );\r
-\r
-       /* In the full task pool implementation the first parameter is used to\r
-       pass the handle of the task pool to schedule.  The lean task pool\r
-       implementation used in this demo only supports a single task pool, which\r
-       is created internally within the library, so the first parameter is NULL. */\r
-       xResult = IotTaskPool_Schedule( NULL, xJob, ulNoFlags );\r
-       configASSERT( xResult == IOT_TASKPOOL_SUCCESS );\r
-\r
-       /* Look for the notification coming from the job's callback function.  The\r
-       priority of the task pool worker task that executes the callback is higher\r
-       than the priority of this task so a block time is not needed - the task pool\r
-       worker task     pre-empts this task and sends the notification (from the job's\r
-       callback) as soon as the job is scheduled. */\r
-       ulReturn = ulTaskNotifyTake( pdTRUE, xNoDelay );\r
-       configASSERT( ulReturn );\r
-\r
-       /* Clean up recyclable job.  In the full implementation of the task pool\r
-       the first parameter is used to pass a handle to the task pool the job is\r
-       associated with.  In the lean implementation of the task pool used by this\r
-       demo there is only one task pool (the system task pool created in the\r
-       task pool library itself) so the first parameter is NULL. */\r
-       IotTaskPool_DestroyRecyclableJob( NULL, xJob );\r
-\r
-       /* Once the job has been deleted the memory used to hold the job is\r
-       returned, so the available heap should be exactly as when entering this\r
-       function. */\r
-       configASSERT( xPortGetFreeHeapSize() == xFreeHeapBeforeCreatingJob );\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static void prvExample_ReuseRecyclableJobFromLowPriorityTask( void )\r
-{\r
-IotTaskPoolError_t xResult;\r
-uint32_t x, xIndex, ulNotificationValue;\r
-const uint32_t ulJobsToCreate = 5UL, ulNoFlags = 0UL;\r
-IotTaskPoolJob_t xJobs[ ulJobsToCreate ];\r
-size_t xFreeHeapBeforeCreatingJob = xPortGetFreeHeapSize();\r
-IotTaskPoolJobStatus_t xJobStatus;\r
-\r
-       /* Don't expect any notifications to be pending yet. */\r
-       configASSERT( ulTaskNotifyTake( pdTRUE, 0 ) == 0 );\r
-\r
-       /* Create ulJobsToCreate jobs using the handle of this task as the job's\r
-       context and the function that sends a notification to the task handle as\r
-       the jobs callback function.  The jobs are created as a recyclable job and\r
-       in this case the memory to store the job information is allocated within\r
-       the create function as at this time there are no recyclable jobs in the\r
-       task pool jobs cache. As the jobs are persistent they can be used multiple\r
-       times.  In the full task pool implementation the first parameter is used to\r
-       pass the handle of the task pool this recyclable job is to be associated\r
-       with.  In the lean implementation of the task pool used by this demo there\r
-       is only one task pool (the system task pool created within the task pool\r
-       library) so the first parameter is NULL. */\r
-       for( x = 0; x < ulJobsToCreate; x++ )\r
-       {\r
-               xResult = IotTaskPool_CreateRecyclableJob( NULL,\r
-                                                                                                  prvSimpleTaskNotifyCallback,\r
-                                                                                                  (void * ) xTaskGetCurrentTaskHandle(),\r
-                                                                                                  &( xJobs[ x ] ) );\r
-               configASSERT( xResult == IOT_TASKPOOL_SUCCESS );\r
-\r
-               /* The job has been created but not scheduled so is now ready. */\r
-               IotTaskPool_GetStatus( NULL, xJobs[ x ], &xJobStatus );\r
-               configASSERT( xJobStatus == IOT_TASKPOOL_STATUS_READY );\r
-       }\r
-\r
-       /* Demonstrate that the jobs can be recycled by performing twice the number\r
-       of iterations of scheduling jobs than there actually are created jobs.  This\r
-       works because the task pool task priorities are above the priority of this\r
-       task, so the tasks that run the jobs pre-empt this task as soon as a job is\r
-       ready. */\r
-       for( x = 0; x < ( ulJobsToCreate * 2UL ); x++ )\r
-       {\r
-               /* Make sure array index does not go out of bounds. */\r
-               xIndex = x % ulJobsToCreate;\r
-\r
-               xResult = IotTaskPool_Schedule( NULL, xJobs[ xIndex ], ulNoFlags );\r
-               configASSERT( xResult == IOT_TASKPOOL_SUCCESS );\r
-\r
-               /* The priority of the task pool task(s) is higher than the priority\r
-               of this task, so the job's callback function should have already\r
-               executed, sending a notification to this task, and incrementing this\r
-               task's notification value. */\r
-               xTaskNotifyWait( 0UL, /* Don't clear any bits on entry. */\r
-                                                0UL, /* Don't clear any bits on exit. */\r
-                                                &ulNotificationValue, /* Obtain the notification value. */\r
-                                                0UL ); /* No block time, return immediately. */\r
-               configASSERT( ulNotificationValue == ( x + 1 ) );\r
-\r
-               /* The job's callback has executed so the job is now completed. */\r
-               IotTaskPool_GetStatus( NULL, xJobs[ xIndex ], &xJobStatus );\r
-               configASSERT( xJobStatus == IOT_TASKPOOL_STATUS_COMPLETED );\r
-\r
-               /* To leave the list of jobs empty we can stop re-creating jobs half\r
-               way through iterations of this loop. */\r
-               if( x < ulJobsToCreate )\r
-               {\r
-                       /* Recycle the job so it can be used again.  In the full task pool\r
-                       implementation the first parameter is used to pass the handle of the\r
-                       task pool this job will be associated with.  In this lean task pool\r
-                       implementation only the system task pool exists (the task pool created\r
-                       internally to the task pool library) so the first parameter is just\r
-                       passed as NULL. *//*_RB_ Why not recycle it automatically? */\r
-                       IotTaskPool_RecycleJob( NULL, xJobs[ xIndex ] );\r
-                       xResult = IotTaskPool_CreateRecyclableJob( NULL,\r
-                                                                                                          prvSimpleTaskNotifyCallback,\r
-                                                                                                          (void * ) xTaskGetCurrentTaskHandle(),\r
-                                                                                                          &( xJobs[ xIndex ] ) );\r
-               }\r
-       }\r
-\r
-       /* Clear all the notification value bits again. */\r
-       xTaskNotifyWait( portMAX_DELAY, /* Clear all bits on entry - portMAX_DELAY is used as it is a portable way of having all bits set. */\r
-                                        0UL, /* Don't clear any bits on exit. */\r
-                                        NULL, /* Don't need the notification value this time. */\r
-                                        0UL ); /* No block time, return immediately. */\r
-       configASSERT( ulTaskNotifyTake( pdTRUE, 0 ) == 0 );\r
-\r
-       /* Clean up all the recyclable job.  In the full implementation of the task\r
-       pool the first parameter is used to pass a handle to the task pool the job\r
-       is associated with.  In the lean implementation of the task pool used by\r
-       this demo there is only one task pool (the system task pool created in the\r
-       task pool library itself) so the first parameter is NULL. */\r
-       for( x = 0; x < ulJobsToCreate; x++ )\r
-       {\r
-               xResult = IotTaskPool_DestroyRecyclableJob( NULL, xJobs[ x ] );\r
-               configASSERT( xResult == IOT_TASKPOOL_SUCCESS );\r
-\r
-               /* Attempting to destroy the same job twice will fail. */\r
-//_RB_ vPortFree() asserts because it attempts to free memory again.           xResult = IotTaskPool_DestroyRecyclableJob( NULL, xJobs[ x ] );\r
-//             configASSERT( xResult != IOT_TASKPOOL_SUCCESS );\r
-       }\r
-\r
-       /* Once the job has been deleted the memory used to hold the job is\r
-       returned, so the available heap should be exactly as when entering this\r
-       function. */\r
-       configASSERT( xPortGetFreeHeapSize() == xFreeHeapBeforeCreatingJob );\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static void prvExample_ReuseRecyclableJobFromHighPriorityTask( void )\r
-{\r
-IotTaskPoolError_t xResult;\r
-uint32_t x, ulNotificationValue;\r
-const uint32_t ulJobsToCreate = 5UL;\r
-const uint32_t ulNoFlags = 0UL;\r
-IotTaskPoolJob_t xJobs[ ulJobsToCreate ];\r
-IotTaskPoolJobStorage_t xJobStorage[ ulJobsToCreate ];\r
-size_t xFreeHeapBeforeCreatingJob = xPortGetFreeHeapSize();\r
-TickType_t xShortDelay = pdMS_TO_TICKS( 150 );\r
-IotTaskPoolJobStatus_t xJobStatus;\r
-\r
-       /* Don't expect any notifications to be pending yet. */\r
-       configASSERT( ulTaskNotifyTake( pdTRUE, 0 ) == 0 );\r
-\r
-       /* prvExample_ReuseRecyclableJobFromLowPriorityTask() executes in a task\r
-       that has a lower [task] priority than the task pool's worker tasks.\r
-       Therefore a talk pool worker preempts the task that calls\r
-       prvExample_ReuseRecyclableJobFromHighPriorityTask() as soon as the job is\r
-       scheduled.  prvExample_ReuseRecyclableJobFromHighPriorityTask() reverses the\r
-       priorities - prvExample_ReuseRecyclableJobFromHighPriorityTask() raises its\r
-       priority to above the task pool's worker tasks, so the worker tasks do not\r
-       execute until the calling task enters the blocked state.  First raise the\r
-       priority - passing NULL means raise the priority of the calling task. */\r
-       vTaskPrioritySet( NULL, tpTASK_POOL_WORKER_PRIORITY + 1 );\r
-\r
-       /* Create ulJobsToCreate jobs using the handle of this task as the job's\r
-       context and the function that sends a notification to the task handle as\r
-       the jobs callback function. */\r
-       for( x = 0; x < ulJobsToCreate; x++ )\r
-       {\r
-               xResult = IotTaskPool_CreateJob(  prvSimpleTaskNotifyCallback, /* Callback function. */\r
-                                                                                 ( void * ) xTaskGetCurrentTaskHandle(), /* Job context. */\r
-                                                                                 &( xJobStorage[ x ] ),\r
-                                                                                 &( xJobs[ x ] ) );\r
-               configASSERT( xResult == IOT_TASKPOOL_SUCCESS );\r
-\r
-               /* This is not a persistent (recyclable) job and its storage is on the\r
-               stack of this function, so the amount of heap space available should not\r
-               have chanced since entering this function. */\r
-               configASSERT( xFreeHeapBeforeCreatingJob == xPortGetFreeHeapSize() );\r
-       }\r
-\r
-       for( x = 0; x < ulJobsToCreate; x++ )\r
-       {\r
-               /* Schedule the next job. */\r
-               xResult = IotTaskPool_Schedule( NULL, xJobs[ x ], ulNoFlags );\r
-               configASSERT( xResult == IOT_TASKPOOL_SUCCESS );\r
-\r
-               /* Although scheduled, the job's callback has not executed, so the job\r
-               reports itself as scheduled. */\r
-               IotTaskPool_GetStatus( NULL, xJobs[ x ], &xJobStatus );\r
-               configASSERT( xJobStatus == IOT_TASKPOOL_STATUS_SCHEDULED );\r
-\r
-               /* The priority of the task pool task(s) is lower than the priority\r
-               of this task, so the job's callback function should not have executed\r
-               yes, so don't expect the notification value for this task to have\r
-               changed. */\r
-               xTaskNotifyWait( 0UL, /* Don't clear any bits on entry. */\r
-                                                0UL, /* Don't clear any bits on exit. */\r
-                                                &ulNotificationValue, /* Obtain the notification value. */\r
-                                                0UL ); /* No block time, return immediately. */\r
-               configASSERT( ulNotificationValue == 0 );\r
-       }\r
-\r
-       /* At this point there are ulJobsToCreate scheduled, but none have executed\r
-       their callbacks because the priority of this task is higher than the\r
-       priority of the task pool worker threads.  When this task blocks to wait for\r
-       a notification a worker thread will be able to executes - but as soon as its\r
-       callback function sends a notification to this task this task will\r
-       preempt it (because it has a higher priority) so this task only expects to\r
-       receive one notification at a time. */\r
-       for( x = 0; x < ulJobsToCreate; x++ )\r
-       {\r
-               xTaskNotifyWait( 0UL, /* Don't clear any bits on entry. */\r
-                                                0UL, /* Don't clear any bits on exit. */\r
-                                                &ulNotificationValue, /* Obtain the notification value. */\r
-                                                xShortDelay ); /* Short delay to allow a task pool worker to execute. */\r
-               configASSERT( ulNotificationValue == ( x + 1 ) );\r
-       }\r
-\r
-       /* All the scheduled jobs have now executed, so waiting for another\r
-       notification should timeout without the notification value changing. */\r
-       xTaskNotifyWait( 0UL, /* Don't clear any bits on entry. */\r
-                                        0UL, /* Don't clear any bits on exit. */\r
-                                        &ulNotificationValue, /* Obtain the notification value. */\r
-                                        xShortDelay ); /* Short delay to allow a task pool worker to execute. */\r
-       configASSERT( ulNotificationValue == x );\r
-\r
-       /* Reset the priority of this task and clear the notifications ready for the\r
-       next example. */\r
-       vTaskPrioritySet( NULL, tskIDLE_PRIORITY );\r
-       xTaskNotifyWait( portMAX_DELAY, /* Clear all bits on entry - portMAX_DELAY is used as it is a portable way of having all bits set. */\r
-                                        0UL, /* Don't clear any bits on exit. */\r
-                                        NULL, /* Don't need the notification value this time. */\r
-                                        0UL ); /* No block time, return immediately. */\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-void vApplicationMallocFailedHook( void )\r
-{\r
-       /* vApplicationMallocFailedHook() will only be called if\r
-       configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h.  It is a hook\r
-       function that will get called if a call to pvPortMalloc() fails.\r
-       pvPortMalloc() is called internally by the kernel whenever a task, queue,\r
-       timer or semaphore is created.  It is also called by various parts of the\r
-       demo application.  If heap_1.c, heap_2.c or heap_4.c is being used, then the\r
-       size of the     heap available to pvPortMalloc() is defined by\r
-       configTOTAL_HEAP_SIZE in FreeRTOSConfig.h, and the xPortGetFreeHeapSize()\r
-       API function can be used to query the size of free heap space that remains\r
-       (although it does not provide information on how the remaining heap might be\r
-       fragmented).  See http://www.freertos.org/a00111.html for more\r
-       information. */\r
-       vAssertCalled( __LINE__, __FILE__ );\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-void vApplicationIdleHook( void )\r
-{\r
-       /* vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set\r
-       to 1 in FreeRTOSConfig.h.  It will be called on each iteration of the idle\r
-       task.  It is essential that code added to this hook function never attempts\r
-       to block in any way (for example, call xQueueReceive() with a block time\r
-       specified, or call vTaskDelay()).  If application tasks make use of the\r
-       vTaskDelete() API function to delete themselves then it is also important\r
-       that vApplicationIdleHook() is permitted to return to its calling function,\r
-       because it is the responsibility of the idle task to clean up memory\r
-       allocated by the kernel to any task that has since deleted itself. */\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )\r
-{\r
-       ( void ) pcTaskName;\r
-       ( void ) pxTask;\r
-\r
-       /* Run time stack overflow checking is performed if\r
-       configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2.  This hook\r
-       function is called if a stack overflow is detected.  This function is\r
-       provided as an example only as stack overflow checking does not function\r
-       when running the FreeRTOS Windows port. */\r
-       vAssertCalled( __LINE__, __FILE__ );\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-void vApplicationTickHook( void )\r
-{\r
-       /* This function will be called by each tick interrupt if\r
-       configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h.  User code can be\r
-       added here, but the tick hook is called from an interrupt context, so\r
-       code must not attempt to block, and only the interrupt safe FreeRTOS API\r
-       functions can be used (those that end in FromISR()). */\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-void vApplicationDaemonTaskStartupHook( void )\r
-{\r
-       /* This function will be called once only, when the daemon task starts to\r
-       execute (sometimes called the timer task).  This is useful if the\r
-       application includes initialisation code that would benefit from executing\r
-       after the scheduler has been started. */\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-void vAssertCalled( unsigned long ulLine, const char * const pcFileName )\r
-{\r
-volatile uint32_t ulSetToNonZeroInDebuggerToContinue = 0;\r
-\r
-       /* Called if an assertion passed to configASSERT() fails.  See\r
-       http://www.freertos.org/a00110.html#configASSERT for more information. */\r
-\r
-       /* Parameters are not used. */\r
-       ( void ) ulLine;\r
-       ( void ) pcFileName;\r
-\r
-\r
-       taskENTER_CRITICAL();\r
-       {\r
-               printf( "Assert hit on line %lu of %s\r\n", ulLine, pcFileName );\r
-               fflush( stdout );\r
-\r
-               /* You can step out of this function to debug the assertion by using\r
-               the debugger to set ulSetToNonZeroInDebuggerToContinue to a non-zero\r
-               value. */\r
-               while( ulSetToNonZeroInDebuggerToContinue == 0 )\r
-               {\r
-                       __asm volatile( "NOP" );\r
-                       __asm volatile( "NOP" );\r
-               }\r
-       }\r
-       taskEXIT_CRITICAL();\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-/* configUSE_STATIC_ALLOCATION is set to 1, so the application must provide an\r
-implementation of vApplicationGetIdleTaskMemory() to provide the memory that is\r
-used by the Idle task. */\r
-void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize )\r
-{\r
-/* If the buffers to be provided to the Idle task are declared inside this\r
-function then they must be declared static - otherwise they will be allocated on\r
-the stack and so not exists after this function exits. */\r
-static StaticTask_t xIdleTaskTCB;\r
-static StackType_t uxIdleTaskStack[ configMINIMAL_STACK_SIZE ];\r
-\r
-       /* Pass out a pointer to the StaticTask_t structure in which the Idle task's\r
-       state will be stored. */\r
-       *ppxIdleTaskTCBBuffer = &xIdleTaskTCB;\r
-\r
-       /* Pass out the array that will be used as the Idle task's stack. */\r
-       *ppxIdleTaskStackBuffer = uxIdleTaskStack;\r
-\r
-       /* Pass out the size of the array pointed to by *ppxIdleTaskStackBuffer.\r
-       Note that, as the array is necessarily of type StackType_t,\r
-       configMINIMAL_STACK_SIZE is specified in words, not bytes. */\r
-       *pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-/* configUSE_STATIC_ALLOCATION and configUSE_TIMERS are both set to 1, so the\r
-application must provide an implementation of vApplicationGetTimerTaskMemory()\r
-to provide the memory that is used by the Timer service task. */\r
-void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer, StackType_t **ppxTimerTaskStackBuffer, uint32_t *pulTimerTaskStackSize )\r
-{\r
-/* If the buffers to be provided to the Timer task are declared inside this\r
-function then they must be declared static - otherwise they will be allocated on\r
-the stack and so not exists after this function exits. */\r
-static StaticTask_t xTimerTaskTCB;\r
-static StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];\r
-\r
-       /* Pass out a pointer to the StaticTask_t structure in which the Timer\r
-       task's state will be stored. */\r
-       *ppxTimerTaskTCBBuffer = &xTimerTaskTCB;\r
-\r
-       /* Pass out the array that will be used as the Timer task's stack. */\r
-       *ppxTimerTaskStackBuffer = uxTimerTaskStack;\r
-\r
-       /* Pass out the size of the array pointed to by *ppxTimerTaskStackBuffer.\r
-       Note that, as the array is necessarily of type StackType_t,\r
-       configMINIMAL_STACK_SIZE is specified in words, not bytes. */\r
-       *pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;\r
-}\r
-\r
index e7fb1e070cca3fadb4b3c0c791c76d6ef1f9be0b..f1c7a42a4a96fcf3d15291f30c9ad105a92a02d4 100644 (file)
@@ -169,7 +169,7 @@ uint32_t ulLoops = 0;
                ulLoops++;\r
                if( ( ulLoops % 10UL ) == 0 )\r
                {\r
-                       printf( "prvTaskPoolDemoTask() performed %u iterations without hitting an assert.\r\n", ulLoops );\r
+                       configPRINTF( ( "prvTaskPoolDemoTask() performed %u iterations without hitting an assert.\r\n", ulLoops ) );\r
                        fflush( stdout );\r
                }\r
        }\r
index c60557decf7c9ee770bfcb4ecd538feeabd5634d..3b63eb06352a39b5f1389c84407fef514a54e301 100644 (file)
@@ -202,5 +202,7 @@ ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */
 #define strncasecmp _strnicmp\r
 #define strcmpi _strcmpi\r
 \r
+#define configPRINTF( X )    printf X\r
+\r
 #endif /* FREERTOS_CONFIG_H */\r
 \r
index 8d0c04cfad5fade723e7765ef9af5c75ff077eea..fd7b681183107749ba560395b0933a154e2b589f 100644 (file)
@@ -60,7 +60,6 @@
       <Optimization>Disabled</Optimization>\r
       <AdditionalIncludeDirectories>..\..\..\Source\FreeRTOS-Plus-TCP\include;..\..\..\Source\FreeRTOS-Plus-TCP\portable\BufferManagement;..\..\..\Source\FreeRTOS-Plus-TCP\portable\Compiler\MSVC;.\DemoTasks\include;.\WinPCap;..\..\..\..\FreeRTOS\Source\include;..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW;..\..\..\Source\FreeRTOS-Plus-IoT-SDK\c_sdk\standard\common\include;..\..\..\Source\FreeRTOS-Plus-IoT-SDK\abstractions\platform\include;..\..\..\Source\FreeRTOS-Plus-IoT-SDK\abstractions\platform\freertos\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;WINVER=0x400;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <MinimalRebuild>true</MinimalRebuild>\r
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
       <PrecompiledHeaderOutputFile>.\Debug/WIN32.pch</PrecompiledHeaderOutputFile>\r
     <ClCompile Include="..\..\..\..\FreeRTOS\Source\queue.c" />\r
     <ClCompile Include="..\..\..\..\FreeRTOS\Source\tasks.c" />\r
     <ClCompile Include="..\..\..\..\FreeRTOS\Source\timers.c" />\r
+    <ClCompile Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\abstractions\platform\freertos\iot_clock_freertos.c" />\r
+    <ClCompile Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\c_sdk\standard\common\logging\iot_logging.c" />\r
     <ClCompile Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\c_sdk\standard\common\taskpool\iot_taskpool.c" />\r
     <ClCompile Include="..\..\..\Source\FreeRTOS-Plus-TCP\FreeRTOS_ARP.c" />\r
     <ClCompile Include="..\..\..\Source\FreeRTOS-Plus-TCP\FreeRTOS_DHCP.c" />\r
index cc6020ab67ed1608ee55f2d65ad3a1d0f582ae5c..215f940ebb03b0bde98f01997f5d3c2eb02da746 100644 (file)
@@ -81,6 +81,9 @@
     <Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\abstractions\platform\freertos\include\platform\types">\r
       <UniqueIdentifier>{35ce7745-52a2-4220-be31-50dfaa35c0ab}</UniqueIdentifier>\r
     </Filter>\r
+    <Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\common\logging">\r
+      <UniqueIdentifier>{6c8bc003-a388-4666-99f4-a31faa932a36}</UniqueIdentifier>\r
+    </Filter>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClCompile Include="..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\port.c">\r
     <ClCompile Include="DemoTasks\SimpleTaskPoolExamples.c">\r
       <Filter>DemoTasks</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\c_sdk\standard\common\logging\iot_logging.c">\r
+      <Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\common\logging</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\abstractions\platform\freertos\iot_clock_freertos.c">\r
+      <Filter>FreeRTOS+\FreeRTOS IoT Libraries\abstractions\platform\freertos</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\..\..\Source\FreeRTOS-Plus-TCP\include\NetworkInterface.h">\r
index 3038f0b78c7095589c8715efabc9ce3178fc43e0..470a13d6daddd8045d9764e91524932a637e7c0e 100644 (file)
 #ifndef IOT_CONFIG_H_\r
 #define IOT_CONFIG_H_\r
 \r
-/* How long the MQTT library will wait for PINGRESPs or PUBACKs. */\r
-#define IOT_MQTT_RESPONSE_WAIT_MS            ( 10000 )\r
-\r
-/* MQTT demo configuration. */\r
-#define IOT_DEMO_MQTT_PUBLISH_BURST_COUNT    ( 10 )\r
-#define IOT_DEMO_MQTT_PUBLISH_BURST_SIZE     ( 2 )\r
-\r
-/* Shadow demo configuration. The demo publishes periodic Shadow updates and responds\r
- * to changing Shadows. */\r
-#define AWS_IOT_DEMO_SHADOW_UPDATE_COUNT        ( 20 )   /* Number of updates to publish. */\r
-#define AWS_IOT_DEMO_SHADOW_UPDATE_PERIOD_MS    ( 3000 ) /* Period of Shadow updates. */\r
-\r
-/* Library logging configuration. IOT_LOG_LEVEL_GLOBAL provides a global log\r
- * level for all libraries; the library-specific settings override the global\r
- * setting. If both the library-specific and global settings are undefined,\r
- * no logs will be printed. */\r
-#define IOT_LOG_LEVEL_GLOBAL                    IOT_LOG_INFO\r
-#define IOT_LOG_LEVEL_DEMO                      IOT_LOG_INFO\r
-#define IOT_LOG_LEVEL_PLATFORM                  IOT_LOG_NONE\r
-#define IOT_LOG_LEVEL_NETWORK                   IOT_LOG_INFO\r
-#define IOT_LOG_LEVEL_TASKPOOL                  IOT_LOG_NONE\r
-#define IOT_LOG_LEVEL_MQTT                      IOT_LOG_INFO\r
-#define AWS_IOT_LOG_LEVEL_SHADOW                IOT_LOG_INFO\r
-#define AWS_IOT_LOG_LEVEL_DEFENDER              IOT_LOG_INFO\r
-\r
-/* Platform thread stack size and priority. */\r
-#define IOT_THREAD_DEFAULT_STACK_SIZE    2048\r
-#define IOT_THREAD_DEFAULT_PRIORITY      5\r
+/* Use platform types on FreeRTOS. */\r
+#include "FreeRTOS.h"\r
+#include "platform/iot_platform_types_freertos.h" //_RB_Makes common config file FreeRTOS specific\r
+\r
+/*\r
+ * Set this to the number of recyclable tasks for the task pool to cache.\r
+ *\r
+ * Caching dynamically allocated tasks (recyclable tasks) helps the application\r
+ * to limit the number of allocations at runtime. Caching recyclable tasks may\r
+ * help making the application more responsive and predictable, by removing a\r
+ * potential for memory allocation failures, but it may also have negative\r
+ * repercussions on the amount of memory available at any given time. It is up\r
+ * to the application developer to strike the correct balance these competing\r
+ * needs. The task pool will cache when the application calling\r
+ * IotTaskPool_RecycleJob. Any recycled tasks in excess of\r
+ * IOT_TASKPOOL_JOBS_RECYCLE_LIMIT will be destroyed and its memory will be\r
+ * release.\r
+ *\r
+ * Default value (if undefined): 8\r
+ */\r
+#define IOT_TASKPOOL_JOBS_RECYCLE_LIMIT 8\r
+\r
+/*\r
+ * Set this to 1 to perform sanity checks when using the task pool library.\r
+ *\r
+ * Asserts are useful for debugging, but should be disabled in production code.\r
+ * If this is set to 1, IotTaskPool_Assert can be defined to set the assertion\r
+ * function; otherwise, the standard library's assert function will be used.\r
+ *\r
+ * Possible values: 0 (asserts disabled) or 1 (asserts enabled)\r
+ * Recommended values: 1 when debugging; 0 in production code.\r
+ * Default value (if undefined): 0\r
+ */\r
+#define IOT_TASKPOOL_ENABLE_ASSERTS 1\r
+\r
+/*\r
+ * Set the log level of the task pool library.\r
+ *\r
+ * Log messages from the task pool library at or below this setting will be\r
+ * printed.\r
+ *\r
+ * Possible values: One of the Log levels.\r
+ * Default value (if undefined): IOT_LOG_LEVEL_GLOBAL; if that is undefined,\r
+ * then IOT_LOG_NONE.\r
+ */\r
+#define IOT_LOG_LEVEL_TASKPOOL IOT_LOG_INFO\r
+\r
+/*\r
+ *\r
+ */\r
+#define IOT_TASKPOOL_NUMBER_OF_WORKERS 3\r
+\r
+/*\r
+ *\r
+ */\r
+#define IOT_TASKPOOL_WORKER_STACK_SIZE_BYTES 2048\r
 \r
 /* Include the common configuration file for FreeRTOS. */\r
 #include "iot_config_common.h"\r
index 7867744234245ae675b4ae8ac110f6d9a54b1898..8dd158db75c487a1f5bb5bdb5605d33e090885de 100644 (file)
 #ifndef IOT_CONFIG_COMMON_H_\r
 #define IOT_CONFIG_COMMON_H_\r
 \r
-/* FreeRTOS include. */\r
-#include "FreeRTOS.h" //_RB_Makes common config file FreeRTOS specific\r
-\r
-/* Use platform types on FreeRTOS. */\r
-#include "platform/iot_platform_types_freertos.h" //_RB_Makes common config file FreeRTOS specific\r
-\r
-/* Used to get the cloud broker endpoint for FreeRTOS. */\r
-//_RB_#include "aws_clientcredential.h"\r
-\r
 /* SDK version. */\r
 #define IOT_SDK_VERSION    "4.0.0"\r
 \r
@@ -197,7 +188,4 @@ extern uint16_t getDeviceMetricsLength( void );
 /* Configuration for defender demo: use long tag for readable output. Please use short tag for the real application. */\r
 #define AWS_IOT_DEFENDER_USE_LONG_TAG       ( 1 )\r
 \r
-/* Demo runner configuration. */\r
-//_RB_#include "aws_demo_config.h"\r
-\r
 #endif /* ifndef IOT_CONFIG_COMMON_H_ */\r
index b989c586ce112a5d195da69ac1e0f80f405d200b..3779ff95886e9ce3445dd288fe5e53ba74562e23 100644 (file)
@@ -255,7 +255,6 @@ typedef struct _taskPool
     int32_t priority;                        /**< @brief The priority for all task pool threads. */\r
     SemaphoreHandle_t dispatchSignal;        /**< @brief The synchronization object on which threads are waiting for incoming jobs. */\r
     StaticSemaphore_t dispatchSignalBuffer;  /**< @brief The semaphore buffer. */\r
-    SemaphoreHandle_t startStopSignal;       /**< @brief The synchronization object for threads to signal start and stop condition. */\r
     StaticSemaphore_t startStopSignalBuffer; /**< @brief The semaphore buffer. */\r
     TimerHandle_t timer;                     /**< @brief The timer for deferred jobs. */\r
     StaticTimer_t timerBuffer;               /**< @brief The timer buffer. */\r
index 96485fddf0cc376d0fb54121285a1022369c2c5a..ce80167c289c7ec3fbb3afe06f06a68244ea640e 100644 (file)
@@ -235,12 +235,12 @@ typedef struct IotTaskPoolJobStorage
 /**\r
  * @ingroup taskpool_datatypes_handles\r
  * @brief Opaque handle of a Task Pool Job.\r
- * \r
+ *\r
  * This type identifies a Task Pool Job instance, which is valid after a successful call\r
  * to @ref taskpool_function_createjob or @ref taskpool_function_createrecyclablejob.\r
  *\r
- * A call to @ref taskpool_function_recyclejob or @ref taskpool_function_destroyrecyclablejob makes a \r
- * task pool job handle invalid. Once @ref taskpool_function_recyclejob or \r
+ * A call to @ref taskpool_function_recyclejob or @ref taskpool_function_destroyrecyclablejob makes a\r
+ * task pool job handle invalid. Once @ref taskpool_function_recyclejob or\r
  * @ref taskpool_function_destroyrecyclablejob returns, the task job handle should no longer be used.\r
  *\r
  * @initializer{IotTaskPoolJob_t,IOT_TASKPOOL_JOB_INITIALIZER}\r
@@ -325,21 +325,21 @@ typedef struct IotTaskPoolInfo
  */\r
 /* @[define_taskpool_initializers] */\r
 /** @brief Initializer for a small #IotTaskPoolInfo_t. */\r
-#define IOT_TASKPOOL_INFO_INITIALIZER_SMALL     { .minThreads = 1, .maxThreads = 1, .stackSize = IOT_THREAD_DEFAULT_STACK_SIZE, .priority = IOT_THREAD_DEFAULT_PRIORITY } \r
+#define IOT_TASKPOOL_INFO_INITIALIZER_SMALL     { .minThreads = 1, .maxThreads = 1, .stackSize = IOT_THREAD_DEFAULT_STACK_SIZE, .priority = IOT_THREAD_DEFAULT_PRIORITY }\r
 /** @brief Initializer for a medium #IotTaskPoolInfo_t. */\r
-#define IOT_TASKPOOL_INFO_INITIALIZER_MEDIUM    { .minThreads = 1, .maxThreads = 2, .stackSize = IOT_THREAD_DEFAULT_STACK_SIZE, .priority = IOT_THREAD_DEFAULT_PRIORITY } \r
+#define IOT_TASKPOOL_INFO_INITIALIZER_MEDIUM    { .minThreads = 1, .maxThreads = 2, .stackSize = IOT_THREAD_DEFAULT_STACK_SIZE, .priority = IOT_THREAD_DEFAULT_PRIORITY }\r
 /** @brief Initializer for a large #IotTaskPoolInfo_t. */\r
-#define IOT_TASKPOOL_INFO_INITIALIZER_LARGE     { .minThreads = 2, .maxThreads = 3, .stackSize = IOT_THREAD_DEFAULT_STACK_SIZE, .priority = IOT_THREAD_DEFAULT_PRIORITY } \r
+#define IOT_TASKPOOL_INFO_INITIALIZER_LARGE     { .minThreads = 2, .maxThreads = 3, .stackSize = IOT_THREAD_DEFAULT_STACK_SIZE, .priority = IOT_THREAD_DEFAULT_PRIORITY }\r
 /** @brief Initializer for a very large #IotTaskPoolInfo_t. */\r
-#define IOT_TASKPOOL_INFO_INITIALIZER_XLARGE    { .minThreads = 2, .maxThreads = 4, .stackSize = IOT_THREAD_DEFAULT_STACK_SIZE, .priority = IOT_THREAD_DEFAULT_PRIORITY } \r
+#define IOT_TASKPOOL_INFO_INITIALIZER_XLARGE    { .minThreads = 2, .maxThreads = 4, .stackSize = IOT_THREAD_DEFAULT_STACK_SIZE, .priority = IOT_THREAD_DEFAULT_PRIORITY }\r
 /** @brief Initializer for a typical #IotTaskPoolInfo_t. */\r
 #define IOT_TASKPOOL_INFO_INITIALIZER           IOT_TASKPOOL_INFO_INITIALIZER_MEDIUM\r
 /** @brief Initializer for a #IotTaskPool_t. */\r
-#define IOT_TASKPOOL_INITIALIZER                NULL           \r
+#define IOT_TASKPOOL_INITIALIZER                NULL\r
 /** @brief Initializer for a #IotTaskPoolJobStorage_t. */\r
-#define IOT_TASKPOOL_JOB_STORAGE_INITIALIZER    { { NULL, NULL }, NULL, NULL, 0, IOT_TASKPOOL_STATUS_UNDEFINED }              \r
+#define IOT_TASKPOOL_JOB_STORAGE_INITIALIZER    { { NULL, NULL }, NULL, NULL, 0, IOT_TASKPOOL_STATUS_UNDEFINED }\r
 /** @brief Initializer for a #IotTaskPoolJob_t. */\r
-#define IOT_TASKPOOL_JOB_INITIALIZER            NULL                                                                                                                    \r
+#define IOT_TASKPOOL_JOB_INITIALIZER            NULL\r
 /* @[define_taskpool_initializers] */\r
 \r
 /**\r
index 2144ba5d803357baf868eec076ce09b18a356690..6f90c19afec6b74c9702bef18df72830d6878dd1 100644 (file)
@@ -42,7 +42,7 @@
 #include <string.h>\r
 \r
 #if !defined( configSUPPORT_STATIC_ALLOCATION ) || ( configSUPPORT_STATIC_ALLOCATION != 1 )\r
-       #error configSUPPORT_STATIC_ALLOCATION must be set to 1 in FreeRTOSConfig.h to build this file.\r
+    #error configSUPPORT_STATIC_ALLOCATION must be set to 1 in FreeRTOSConfig.h to build this file.\r
 #endif\r
 \r
 /* Task pool internal include. */\r
@@ -653,8 +653,16 @@ static IotTaskPoolError_t _createTaskPool( const IotTaskPoolInfo_t * const pInfo
 {\r
     TASKPOOL_FUNCTION_ENTRY( IOT_TASKPOOL_SUCCESS );\r
 \r
+    /* Static TCB structures and arrays to be used by statically allocated\r
+    worker tasks. */\r
+    static StaticTask_t workerTaskTCBs[ IOT_TASKPOOL_NUMBER_OF_WORKERS ];\r
+    static StackType_t workerTaskStacks[ IOT_TASKPOOL_NUMBER_OF_WORKERS ][ IOT_TASKPOOL_WORKER_STACK_SIZE_BYTES / sizeof( portSTACK_TYPE ) ];\r
+\r
+       /* Static structure to hold te software timer. */\r
+       static StaticTimer_t staticTimer;\r
+\r
     uint32_t threadsCreated = 0; /* Although initialised before use removing the initialiser here results in compiler warnings. */\r
-    char cTaskName[ 10 ];\r
+    char taskName[ 10 ];\r
 \r
     /* Check input values for consistency. */\r
     TASKPOOL_ON_NULL_ARG_GOTO_CLEANUP( pTaskPool );\r
@@ -666,14 +674,12 @@ static IotTaskPoolError_t _createTaskPool( const IotTaskPoolInfo_t * const pInfo
     _initTaskPoolControlStructures( pTaskPool );\r
 \r
     /* Create the timer for a new connection. */\r
-    pTaskPool->timer = xTimerCreate( NULL, portMAX_DELAY, pdFALSE, ( void * ) pTaskPool, _timerCallback );\r
-\r
-    if( pTaskPool->timer == NULL )\r
-    {\r
-        IotLogError( "Failed to create timer for task pool." );\r
-\r
-        TASKPOOL_SET_AND_GOTO_CLEANUP( IOT_TASKPOOL_NO_MEMORY );\r
-    }\r
+    pTaskPool->timer = xTimerCreateStatic( NULL, /* Text name for the timer, only used for debugging. */\r
+                                                  portMAX_DELAY, /* Timer period in ticks. */\r
+                                                  pdFALSE, /* pdFALSE means its a one-shot timer. */\r
+                                                 ( void * ) pTaskPool, /* Parameter passed into callback. */\r
+                                                 _timerCallback, /* Callback that executes when the timer expires. */\r
+                                                 &staticTimer ); /* Static storage for the timer's data structure. */\r
 \r
     /* The task pool will initialize the minimum number of threads requested by the user upon start.\r
     Note this tailored version of the task pool does not autoscale, but fixes the number of tasks\r
@@ -681,46 +687,25 @@ static IotTaskPoolError_t _createTaskPool( const IotTaskPoolInfo_t * const pInfo
     /* Create the minimum number of threads specified by the user, and if one fails shutdown and return error. */\r
     for( threadsCreated = 0; threadsCreated < pInfo->minThreads; )\r
     {\r
-        TaskHandle_t task = NULL;\r
-\r
         /* Generate a unique name for the task. */\r
-        snprintf( cTaskName, sizeof( cTaskName ), "pool%d", ( int ) threadsCreated );\r
-\r
-        BaseType_t res = xTaskCreate( _taskPoolWorker,\r
-                                      cTaskName,\r
-                                      pInfo->stackSize / sizeof( portSTACK_TYPE ), /* xTaskCreate() expects the stack size to be specified in words. */\r
-                                      pTaskPool,\r
-                                      pInfo->priority,\r
-                                      &task );\r
+        snprintf( taskName, sizeof( taskName ), "pool%d", ( int ) threadsCreated );\r
 \r
-        /* Create one thread. */\r
-        if( res == pdFALSE ) //_RB_ would not be needed if tasks are created statically.\r
-        {\r
-            IotLogError( "Could not create worker thread! Exiting..." );\r
+        xTaskCreateStatic( _taskPoolWorker, /* Function that implements the task. */\r
+                           taskName,       /* Text name for the task, used for debugging only. */\r
+                                      IOT_TASKPOOL_WORKER_STACK_SIZE_BYTES / sizeof( portSTACK_TYPE ), /* xTaskCreate() expects the stack size to be specified in words. */\r
+                           pTaskPool,       /* Parameter passed into the task. */\r
+                           pInfo->priority, /* Priority at which the task starts running. */\r
+                           &( workerTaskStacks[ threadsCreated ][ 0 ] ), /* Pointer to static storage for the task's stack. */\r
+                                                  &( workerTaskTCBs[ threadsCreated ] ) ); /* Pointer to static storage for te task's TCB. */\r
 \r
-            /* If creating one thread fails, set error condition and exit the loop. */\r
-            TASKPOOL_SET_AND_GOTO_CLEANUP( IOT_TASKPOOL_NO_MEMORY );\r
-        }\r
-\r
-        /* Upon successful thread creation, increase the number of active threads. */\r
+               /* Upon successful thread creation, increase the number of active threads. */\r
         pTaskPool->activeThreads++;\r
-        IotTaskPool_Assert( task != NULL );\r
-\r
         ++threadsCreated;\r
     }\r
+       pTaskPool->running = true;\r
 \r
     TASKPOOL_FUNCTION_CLEANUP();\r
 \r
-    /* In case of failure, wait on the created threads to exit. */\r
-    if( TASKPOOL_FAILED( status ) )\r
-    {\r
-        /* Set the exit condition for the newly created threads. */\r
-#pragma message( "Threads need to be created statically here to ensure creation cannot fail as there is no shutdown mechanism." )\r
-        _destroyTaskPool( pTaskPool );\r
-    }\r
-\r
-    pTaskPool->running = true;\r
-\r
     TASKPOOL_FUNCTION_CLEANUP_END();\r
 }\r
 \r