New MSVC task pool demo now building both the task pool and TCP libraries.

pull/4/head
Richard Barry 6 years ago
parent 3afd918ecd
commit e4e86a464e

@ -61,6 +61,7 @@
#define configUSE_ALTERNATIVE_API 0 #define configUSE_ALTERNATIVE_API 0
#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0 #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0
#define configENABLE_BACKWARD_COMPATIBILITY 1 #define configENABLE_BACKWARD_COMPATIBILITY 1
#define configSUPPORT_STATIC_ALLOCATION 1
/* Hook function related definitions. */ /* Hook function related definitions. */
#define configUSE_TICK_HOOK 0 #define configUSE_TICK_HOOK 0

@ -58,7 +58,7 @@
</Midl> </Midl>
<ClCompile> <ClCompile>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\Source\FreeRTOS-Plus-FAT\include;..\..\..\Source\FreeRTOS-Plus-FAT\portable\common;..\..\..\Source\FreeRTOS-Plus-TCP\protocols\include;..\..\..\Source\FreeRTOS-Plus-TCP\portable\BufferManagement;.\DemoTasks\include;..\..\..\Source\FreeRTOS-Plus-TCP\portable\Compiler\MSVC;.\WinPCap;..\..\..\..\FreeRTOS\Source\include;..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW;..\..\..\Source\FreeRTOS-Plus-CLI;.\TraceMacros\Example1;..\..\..\Source\FreeRTOS-Plus-TCP\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <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>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;WINVER=0x400;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;WINVER=0x400;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild> <MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@ -145,6 +145,7 @@
<ClCompile Include="..\..\..\..\FreeRTOS\Source\queue.c" /> <ClCompile Include="..\..\..\..\FreeRTOS\Source\queue.c" />
<ClCompile Include="..\..\..\..\FreeRTOS\Source\tasks.c" /> <ClCompile Include="..\..\..\..\FreeRTOS\Source\tasks.c" />
<ClCompile Include="..\..\..\..\FreeRTOS\Source\timers.c" /> <ClCompile Include="..\..\..\..\FreeRTOS\Source\timers.c" />
<ClCompile Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\c_sdk\standard\common\taskpool\iot_taskpool.c" />
<ClCompile Include="..\..\..\Source\FreeRTOS-Plus-TCP\FreeRTOS_ARP.c" /> <ClCompile Include="..\..\..\Source\FreeRTOS-Plus-TCP\FreeRTOS_ARP.c" />
<ClCompile Include="..\..\..\Source\FreeRTOS-Plus-TCP\FreeRTOS_DHCP.c" /> <ClCompile Include="..\..\..\Source\FreeRTOS-Plus-TCP\FreeRTOS_DHCP.c" />
<ClCompile Include="..\..\..\Source\FreeRTOS-Plus-TCP\FreeRTOS_DNS.c" /> <ClCompile Include="..\..\..\Source\FreeRTOS-Plus-TCP\FreeRTOS_DNS.c" />
@ -174,6 +175,14 @@
<ClInclude Include="..\..\..\..\FreeRTOS\Source\include\task.h" /> <ClInclude Include="..\..\..\..\FreeRTOS\Source\include\task.h" />
<ClInclude Include="..\..\..\..\FreeRTOS\Source\include\timers.h" /> <ClInclude Include="..\..\..\..\FreeRTOS\Source\include\timers.h" />
<ClInclude Include="..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\portmacro.h" /> <ClInclude Include="..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\portmacro.h" />
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\abstractions\platform\freertos\include\platform\iot_platform_types_afr.h" />
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\abstractions\platform\include\types\iot_platform_types.h" />
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\c_sdk\standard\common\include\iot_taskpool.h" />
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\c_sdk\standard\common\include\private\iot_error.h" />
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\c_sdk\standard\common\include\private\iot_logging.h" />
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\c_sdk\standard\common\include\private\iot_static_memory.h" />
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\c_sdk\standard\common\include\private\iot_taskpool_internal.h" />
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\c_sdk\standard\common\include\types\iot_taskpool_types.h" />
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-TCP\include\FreeRTOSIPConfigDefaults.h" /> <ClInclude Include="..\..\..\Source\FreeRTOS-Plus-TCP\include\FreeRTOSIPConfigDefaults.h" />
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_ARP.h" /> <ClInclude Include="..\..\..\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_ARP.h" />
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_DHCP.h" /> <ClInclude Include="..\..\..\Source\FreeRTOS-Plus-TCP\include\FreeRTOS_DHCP.h" />
@ -190,6 +199,8 @@
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-TCP\include\NetworkInterface.h" /> <ClInclude Include="..\..\..\Source\FreeRTOS-Plus-TCP\include\NetworkInterface.h" />
<ClInclude Include="FreeRTOSConfig.h" /> <ClInclude Include="FreeRTOSConfig.h" />
<ClInclude Include="FreeRTOSIPConfig.h" /> <ClInclude Include="FreeRTOSIPConfig.h" />
<ClInclude Include="iot_config.h" />
<ClInclude Include="iot_config_common.h" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">

@ -33,6 +33,54 @@
<Filter Include="DemoTasks"> <Filter Include="DemoTasks">
<UniqueIdentifier>{b71e974a-9f28-4815-972b-d930ba8a34d0}</UniqueIdentifier> <UniqueIdentifier>{b71e974a-9f28-4815-972b-d930ba8a34d0}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries">
<UniqueIdentifier>{60717407-397f-4ea5-8492-3314acdd25f0}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard">
<UniqueIdentifier>{8a90222f-d723-4b4e-8e6e-c57afaf7fa92}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\common">
<UniqueIdentifier>{7c995f05-2a10-4771-ad77-18a755876e46}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\common\task_pool">
<UniqueIdentifier>{e07288b6-a8e7-416a-947d-7f0260673dcc}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\common\include">
<UniqueIdentifier>{9a636cc3-ebc6-48c5-8c18-c72494686e81}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\common\include\private">
<UniqueIdentifier>{fe53a296-12ec-4819-bf2b-fd9dca2c6e96}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\standard\common\include\types">
<UniqueIdentifier>{29376c48-bc8b-4624-ad59-16807874c9f2}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\abstractions">
<UniqueIdentifier>{91ef4008-de51-4b41-ba5e-bf24d8cda378}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\abstractions\platform">
<UniqueIdentifier>{ade43c6c-04c5-4897-abdb-91af2df04e5d}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\abstractions\platform\freertos">
<UniqueIdentifier>{08a4e35c-19ca-4b1e-af24-bac368c2bf7b}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\abstractions\platform\include">
<UniqueIdentifier>{1fc5fc25-c18b-45a2-bad3-0c07795db1e9}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\abstractions\platform\include\platform">
<UniqueIdentifier>{f3a69e5b-1462-4e19-8651-274e86c252b0}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\abstractions\platform\include\types">
<UniqueIdentifier>{9a849d9e-91e5-4035-ab4c-70a986c6aed1}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\abstractions\platform\freertos\include">
<UniqueIdentifier>{1e324500-91b4-4c76-b699-59ba75691760}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\abstractions\platform\freertos\include\platform">
<UniqueIdentifier>{bdcbc1ec-99b8-4c72-9075-49035c115488}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS+\FreeRTOS IoT Libraries\abstractions\platform\freertos\include\platform\types">
<UniqueIdentifier>{35ce7745-52a2-4220-be31-50dfaa35c0ab}</UniqueIdentifier>
</Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\port.c"> <ClCompile Include="..\..\..\..\FreeRTOS\Source\portable\MSVC-MingW\port.c">
@ -94,6 +142,9 @@
<Filter>FreeRTOS+\FreeRTOS+TCP</Filter> <Filter>FreeRTOS+\FreeRTOS+TCP</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="demo_logging.c" /> <ClCompile Include="demo_logging.c" />
<ClCompile Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\c_sdk\standard\common\taskpool\iot_taskpool.c">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\common\task_pool</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-TCP\include\NetworkInterface.h"> <ClInclude Include="..\..\..\Source\FreeRTOS-Plus-TCP\include\NetworkInterface.h">
@ -167,5 +218,31 @@
<ClInclude Include="..\..\..\..\FreeRTOS\Source\include\projdefs.h"> <ClInclude Include="..\..\..\..\FreeRTOS\Source\include\projdefs.h">
<Filter>FreeRTOS\Source\include</Filter> <Filter>FreeRTOS\Source\include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\c_sdk\standard\common\include\iot_taskpool.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\common\include</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\c_sdk\standard\common\include\types\iot_taskpool_types.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\common\include\types</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\c_sdk\standard\common\include\private\iot_error.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\common\include\private</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\c_sdk\standard\common\include\private\iot_logging.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\common\include\private</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\c_sdk\standard\common\include\private\iot_static_memory.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\common\include\private</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\c_sdk\standard\common\include\private\iot_taskpool_internal.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\standard\common\include\private</Filter>
</ClInclude>
<ClInclude Include="iot_config.h" />
<ClInclude Include="iot_config_common.h" />
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\abstractions\platform\freertos\include\platform\iot_platform_types_afr.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\abstractions\platform\freertos\include\platform</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Source\FreeRTOS-Plus-IoT-SDK\abstractions\platform\include\types\iot_platform_types.h">
<Filter>FreeRTOS+\FreeRTOS IoT Libraries\abstractions\platform\include\types</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -0,0 +1,59 @@
/*
* Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* This file contains configuration settings for the demos. */
#ifndef IOT_CONFIG_H_
#define IOT_CONFIG_H_
/* How long the MQTT library will wait for PINGRESPs or PUBACKs. */
#define IOT_MQTT_RESPONSE_WAIT_MS ( 10000 )
/* MQTT demo configuration. */
#define IOT_DEMO_MQTT_PUBLISH_BURST_COUNT ( 10 )
#define IOT_DEMO_MQTT_PUBLISH_BURST_SIZE ( 2 )
/* Shadow demo configuration. The demo publishes periodic Shadow updates and responds
* to changing Shadows. */
#define AWS_IOT_DEMO_SHADOW_UPDATE_COUNT ( 20 ) /* Number of updates to publish. */
#define AWS_IOT_DEMO_SHADOW_UPDATE_PERIOD_MS ( 3000 ) /* Period of Shadow updates. */
/* Library logging configuration. IOT_LOG_LEVEL_GLOBAL provides a global log
* level for all libraries; the library-specific settings override the global
* setting. If both the library-specific and global settings are undefined,
* no logs will be printed. */
#define IOT_LOG_LEVEL_GLOBAL IOT_LOG_INFO
#define IOT_LOG_LEVEL_DEMO IOT_LOG_INFO
#define IOT_LOG_LEVEL_PLATFORM IOT_LOG_NONE
#define IOT_LOG_LEVEL_NETWORK IOT_LOG_INFO
#define IOT_LOG_LEVEL_TASKPOOL IOT_LOG_NONE
#define IOT_LOG_LEVEL_MQTT IOT_LOG_INFO
#define AWS_IOT_LOG_LEVEL_SHADOW IOT_LOG_INFO
#define AWS_IOT_LOG_LEVEL_DEFENDER IOT_LOG_INFO
/* Platform thread stack size and priority. */
#define IOT_THREAD_DEFAULT_STACK_SIZE 2048
#define IOT_THREAD_DEFAULT_PRIORITY 5
/* Include the common configuration file for FreeRTOS. */
#include "iot_config_common.h"
#endif /* ifndef IOT_CONFIG_H_ */

@ -0,0 +1,203 @@
/*
* Amazon FreeRTOS V201906.00 Major
* Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* http://aws.amazon.com/freertos
* http://www.FreeRTOS.org
*/
/* This file contains default configuration settings for the demos on FreeRTOS. */
#ifndef IOT_CONFIG_COMMON_H_
#define IOT_CONFIG_COMMON_H_
/* FreeRTOS include. */
#include "FreeRTOS.h"
/* Use platform types on FreeRTOS. */
#include "platform/iot_platform_types_afr.h"
/* Used to get the cloud broker endpoint for FreeRTOS. */
//_RB_#include "aws_clientcredential.h"
/* SDK version. */
#define IOT_SDK_VERSION "4.0.0"
/* This config file is for the demos; disable any test code. */
#define IOT_BUILD_TESTS ( 0 )
/* Logging puts function. */
#define IotLogging_Puts( str ) configPRINTF( ( "%s\r\n", str ) )
/* Enable asserts in libraries by default. */
#ifndef IOT_METRICS_ENABLE_ASSERTS
#define IOT_METRICS_ENABLE_ASSERTS ( 1 )
#endif
#ifndef IOT_CONTAINERS_ENABLE_ASSERTS
#define IOT_CONTAINERS_ENABLE_ASSERTS ( 1 )
#endif
#ifndef IOT_TASKPOOL_ENABLE_ASSERTS
#define IOT_TASKPOOL_ENABLE_ASSERTS ( 1 )
#endif
#ifndef IOT_MQTT_ENABLE_ASSERTS
#define IOT_MQTT_ENABLE_ASSERTS ( 1 )
#endif
#ifndef AWS_IOT_SHADOW_ENABLE_ASSERTS
#define AWS_IOT_SHADOW_ENABLE_ASSERTS ( 1 )
#endif
#ifndef AWS_IOT_DEFENDER_ENABLE_ASSERTS
#define AWS_IOT_DEFENDER_ENABLE_ASSERTS ( 1 )
#endif
#ifndef IOT_BLE_ENABLE_ASSERTS
#define IOT_BLE_ENABLE_ASSERTS ( 1 )
#endif
/* Assert functions. */
#define IotMetrics_Assert( expression ) configASSERT( expression )
#define IotContainers_Assert( expression ) configASSERT( expression )
#define IotTaskPool_Assert( expression ) configASSERT( expression )
#define IotMqtt_Assert( expression ) configASSERT( expression )
#define AwsIotShadow_Assert( expression ) configASSERT( expression )
#define AwsIotDefender_Assert( expression ) configASSERT( expression )
#define IotBle_Assert( expression ) configASSERT( expression )
/* Control the usage of dynamic memory allocation. */
#ifndef IOT_STATIC_MEMORY_ONLY
#define IOT_STATIC_MEMORY_ONLY ( 0 )
#endif
/* Memory allocation configuration. Note that these functions will not be affected
* by IOT_STATIC_MEMORY_ONLY. */
#define IotNetwork_Malloc pvPortMalloc
#define IotNetwork_Free vPortFree
#define IotThreads_Malloc pvPortMalloc
#define IotThreads_Free vPortFree
#define IotLogging_Malloc pvPortMalloc
#define IotLogging_Free vPortFree
#define IotBle_Malloc pvPortMalloc
#define IotBle_Free vPortFree
/* #define IotLogging_StaticBufferSize */
/* Memory allocation function configuration for the MQTT and Defender library.
* These libraries will be affected by IOT_STATIC_MEMORY_ONLY. */
#if IOT_STATIC_MEMORY_ONLY == 0
#define IotMetrics_MallocTcpConnection pvPortMalloc
#define IotMetrics_FreeTcpConnection vPortFree
#define IotMetrics_MallocIpAddress pvPortMalloc
#define IotMetrics_FreeIpAddress vPortFree
#define IotTaskPool_MallocTaskPool pvPortMalloc
#define IotTaskPool_FreeTaskPool vPortFree
#define IotTaskPool_MallocJob pvPortMalloc
#define IotTaskPool_FreeJob vPortFree
#define IotTaskPool_MallocTimerEvent pvPortMalloc
#define IotTaskPool_FreeTimerEvent vPortFree
#define IotMqtt_MallocConnection pvPortMalloc
#define IotMqtt_FreeConnection vPortFree
#define IotMqtt_MallocMessage pvPortMalloc
#define IotMqtt_FreeMessage vPortFree
#define IotMqtt_MallocOperation pvPortMalloc
#define IotMqtt_FreeOperation vPortFree
#define IotMqtt_MallocSubscription pvPortMalloc
#define IotMqtt_FreeSubscription vPortFree
#define IotSerializer_MallocCborEncoder pvPortMalloc
#define IotSerializer_FreeCborEncoder vPortFree
#define IotSerializer_MallocCborParser pvPortMalloc
#define IotSerializer_FreeCborParser vPortFree
#define IotSerializer_MallocCborValue pvPortMalloc
#define IotSerializer_FreeCborValue vPortFree
#define IotSerializer_MallocDecoderObject pvPortMalloc
#define IotSerializer_FreeDecoderObject vPortFree
#define AwsIotShadow_MallocOperation pvPortMalloc
#define AwsIotShadow_FreeOperation vPortFree
#define AwsIotShadow_MallocString pvPortMalloc
#define AwsIotShadow_FreeString vPortFree
#define AwsIotShadow_MallocSubscription pvPortMalloc
#define AwsIotShadow_FreeSubscription vPortFree
#define AwsIotDefender_MallocReport pvPortMalloc
#define AwsIotDefender_FreeReport vPortFree
#define AwsIotDefender_MallocTopic pvPortMalloc
#define AwsIotDefender_FreeTopic vPortFree
#endif /* if IOT_STATIC_MEMORY_ONLY == 0 */
/* Default platform thread stack size and priority. */
#ifndef IOT_THREAD_DEFAULT_STACK_SIZE
#define IOT_THREAD_DEFAULT_STACK_SIZE 2048
#endif
#ifndef IOT_THREAD_DEFAULT_PRIORITY
#define IOT_THREAD_DEFAULT_PRIORITY tskIDLE_PRIORITY
#endif
/* Platform network configuration. */
#ifndef IOT_NETWORK_RECEIVE_TASK_PRIORITY
#define IOT_NETWORK_RECEIVE_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
#endif
#ifndef IOT_NETWORK_RECEIVE_TASK_STACK_SIZE
#define IOT_NETWORK_RECEIVE_TASK_STACK_SIZE IOT_THREAD_DEFAULT_STACK_SIZE
#endif
/* Platform and SDK name for AWS IoT MQTT metrics. Only used when
* AWS_IOT_MQTT_ENABLE_METRICS is 1. */
#define IOT_SDK_NAME "AmazonFreeRTOS"
#ifdef configPLATFORM_NAME
#define IOT_PLATFORM_NAME configPLATFORM_NAME
#else
#define IOT_PLATFORM_NAME "Unknown"
#endif
/* Cloud endpoint to which the device connects to. */
#define IOT_CLOUD_ENDPOINT clientcredentialMQTT_BROKER_ENDPOINT
/**
* @brief Unique identifier used to recognize a device by the cloud.
* This could be SHA-256 of the device certificate.
*/
extern const char *getDeviceIdentifier( void );
#define IOT_DEVICE_IDENTIFIER getDeviceIdentifier()
/**
* @brief Metrics emitted by the device.
*/
extern const char *getDeviceMetrics( void );
#define AWS_IOT_METRICS_USERNAME getDeviceMetrics()
/**
* @brief Length of the metrics emitted by device.
*/
extern uint16_t getDeviceMetricsLength( void );
#define AWS_IOT_METRICS_USERNAME_LENGTH getDeviceMetricsLength()
/* Define the data type of metrics connection id as same as Socket_t in aws_secure_socket.h */
#define IotMetricsConnectionId_t void *
/* Configuration for defender demo: set format to CBOR. */
#define AWS_IOT_DEFENDER_FORMAT AWS_IOT_DEFENDER_FORMAT_CBOR
/* Configuration for defender demo: use long tag for readable output. Please use short tag for the real application. */
#define AWS_IOT_DEFENDER_USE_LONG_TAG ( 1 )
/* Demo runner configuration. */
//_RB_#include "aws_demo_config.h"
#endif /* ifndef IOT_CONFIG_COMMON_H_ */

@ -339,6 +339,7 @@ uint32_t ulLoggingIPAddress;
} }
#endif #endif
/*-----------------------------------------------------------*/
/* /*
* Callback that provides the inputs necessary to generate a randomized TCP * Callback that provides the inputs necessary to generate a randomized TCP
@ -358,4 +359,55 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
return uxRand(); return uxRand();
} }
/*-----------------------------------------------------------*/
/* configUSE_STATIC_ALLOCATION is set to 1, so the application must provide an
implementation of vApplicationGetIdleTaskMemory() to provide the memory that is
used by the Idle task. */
void vApplicationGetIdleTaskMemory( StaticTask_t** ppxIdleTaskTCBBuffer, StackType_t** ppxIdleTaskStackBuffer, uint32_t* pulIdleTaskStackSize )
{
/* If the buffers to be provided to the Idle task are declared inside this
function then they must be declared static - otherwise they will be allocated on
the stack and so not exists after this function exits. */
static StaticTask_t xIdleTaskTCB;
static StackType_t uxIdleTaskStack[configMINIMAL_STACK_SIZE];
/* Pass out a pointer to the StaticTask_t structure in which the Idle task's
state will be stored. */
*ppxIdleTaskTCBBuffer = &xIdleTaskTCB;
/* Pass out the array that will be used as the Idle task's stack. */
*ppxIdleTaskStackBuffer = uxIdleTaskStack;
/* Pass out the size of the array pointed to by *ppxIdleTaskStackBuffer.
Note that, as the array is necessarily of type StackType_t,
configMINIMAL_STACK_SIZE is specified in words, not bytes. */
*pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;
}
/*-----------------------------------------------------------*/
/* configUSE_STATIC_ALLOCATION and configUSE_TIMERS are both set to 1, so the
application must provide an implementation of vApplicationGetTimerTaskMemory()
to provide the memory that is used by the Timer service task. */
void vApplicationGetTimerTaskMemory( StaticTask_t** ppxTimerTaskTCBBuffer, StackType_t** ppxTimerTaskStackBuffer, uint32_t* pulTimerTaskStackSize )
{
/* If the buffers to be provided to the Timer task are declared inside this
function then they must be declared static - otherwise they will be allocated on
the stack and so not exists after this function exits. */
static StaticTask_t xTimerTaskTCB;
static StackType_t uxTimerTaskStack[configTIMER_TASK_STACK_DEPTH];
/* Pass out a pointer to the StaticTask_t structure in which the Timer
task's state will be stored. */
*ppxTimerTaskTCBBuffer = &xTimerTaskTCB;
/* Pass out the array that will be used as the Timer task's stack. */
*ppxTimerTaskStackBuffer = uxTimerTaskStack;
/* Pass out the size of the array pointed to by *ppxTimerTaskStackBuffer.
Note that, as the array is necessarily of type StackType_t,
configMINIMAL_STACK_SIZE is specified in words, not bytes. */
*pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;
}

@ -27,7 +27,11 @@
* @brief Implements the task pool functions in iot_taskpool.h * @brief Implements the task pool functions in iot_taskpool.h
*/ */
/* The config header is always included first. */ /* Kernel includes. */
#include "FreeRTOS.h"
#include "semphr.h"
/* IoT libraries includes. */
#include "iot_config.h" #include "iot_config.h"
/* Standard includes. */ /* Standard includes. */
@ -37,9 +41,13 @@
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#if !defined( configSUPPORT_STATIC_ALLOCATION ) || ( configSUPPORT_STATIC_ALLOCATION != 1 )
#error configSUPPORT_STATIC_ALLOCATION must be set to 1 in FreeRTOSConfig.h to build this file.
#endif
/* Platform layer includes. */ /* Platform layer includes. */
#include "platform/iot_threads.h" //_RB_#include "platform/iot_threads.h"
#include "platform/iot_clock.h" //_RB_#include "platform/iot_clock.h"
/* Task pool internal include. */ /* Task pool internal include. */
#include "private/iot_taskpool_internal.h" #include "private/iot_taskpool_internal.h"
@ -551,7 +559,7 @@ IotTaskPoolError_t IotTaskPool_DestroyRecyclableJob( IotTaskPool_t taskPoolHandl
pool - no other values are allowed. Use the full implementation of this pool - no other values are allowed. Use the full implementation of this
library if you want multiple task pools (there is more than one task in library if you want multiple task pools (there is more than one task in
each pool. */ each pool. */
#warning could use a TASKPOOL macro to check value and return error. //_RB_could use a TASKPOOL macro to check value and return error.
configASSERT( ( taskPoolHandle == NULL ) || ( taskPoolHandle == &_IotSystemTaskPool ) ); configASSERT( ( taskPoolHandle == NULL ) || ( taskPoolHandle == &_IotSystemTaskPool ) );
/* Avoid compiler warnings about unused parameters if configASSERT() is not /* Avoid compiler warnings about unused parameters if configASSERT() is not
@ -891,7 +899,7 @@ static IotTaskPoolError_t _createTaskPool( const IotTaskPoolInfo_t * const pInfo
TASKPOOL_FUNCTION_ENTRY( IOT_TASKPOOL_SUCCESS ); TASKPOOL_FUNCTION_ENTRY( IOT_TASKPOOL_SUCCESS );
uint32_t count; uint32_t count;
uint32_t threadsCreated; uint32_t threadsCreated = 0; /* Although initialised before use removing the initialiser here results in compiler warnings. */
char cTaskName[ 10 ]; char cTaskName[ 10 ];
/* Check input values for consistency. */ /* Check input values for consistency. */

Loading…
Cancel
Save