--- /dev/null
+/*\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
+\r
+ /***\r
+ * See https://www.FreeRTOS.org/task-pool/ for configuration and usage instructions.\r
+ ***/\r
+\r
+\r
+/* Standard includes. */\r
+#include <stdio.h>\r
+#include <time.h>\r
+\r
+/* Visual studio intrinsics used so the __debugbreak() function is available\r
+should an assert get hit. */\r
+#include <intrin.h>\r
+\r
+/* FreeRTOS includes. */\r
+#include <FreeRTOS.h>\r
+#include "task.h"\r
+\r
+/* TCP/IP stack includes. */\r
+#include "FreeRTOS_IP.h"\r
+\r
+/*\r
+ * Prototypes for the demos that can be started from this project.\r
+ */\r
+extern void vStartSimpleTaskPoolDemo( void );\r
+\r
+/* This example is the first in a sequence that adds IoT functionality into\r
+an existing TCP/IP project. In this first project the TCP/IP stack is not\r
+actually used, but it is still built, which requires this array to be\r
+present. */\r
+const uint8_t ucMACAddress[ 6 ] = { configMAC_ADDR0, configMAC_ADDR1, configMAC_ADDR2, configMAC_ADDR3, configMAC_ADDR4, configMAC_ADDR5 };\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+int main( void )\r
+{\r
+ /***\r
+ * See https://www.FreeRTOS.org/task-pool/ for configuration and usage instructions.\r
+ ***/\r
+\r
+ /* Create the example that demonstrates task pool functionality. Examples\r
+ that demonstrate networking connectivity will be added in future projects\r
+ and get started after the network has connected (from within the\r
+ vApplicationIPNetworkEventHook() function).*/\r
+ vStartSimpleTaskPoolDemo();\r
+\r
+ /* Start the scheduler - if all is well from this point on only FreeRTOS\r
+ tasks will execute. */\r
+ vTaskStartScheduler();\r
+\r
+ /* If all is well, the scheduler will now be running, and the following\r
+ line will never be reached. If the following line does execute, then\r
+ there was insufficient FreeRTOS heap memory available for the idle and/or\r
+ timer tasks to be created. See the memory management section on the\r
+ FreeRTOS web site for more details (this is standard text that is not\r
+ really applicable to the Win32 simulator port). */\r
+ for( ;; )\r
+ {\r
+ __debugbreak();\r
+ }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vAssertCalled( const char *pcFile, uint32_t ulLine )\r
+{\r
+volatile uint32_t ulBlockVariable = 0UL;\r
+volatile char *pcFileName = ( volatile char * ) pcFile;\r
+volatile uint32_t ulLineNumber = ulLine;\r
+\r
+ ( void ) pcFileName;\r
+ ( void ) ulLineNumber;\r
+\r
+ printf( "vAssertCalled( %s, %u\n", pcFile, ulLine );\r
+\r
+ /* Setting ulBlockVariable to a non-zero value in the debugger will allow\r
+ this function to be exited. */\r
+ taskDISABLE_INTERRUPTS();\r
+ {\r
+ while( ulBlockVariable == 0UL )\r
+ {\r
+ __debugbreak();\r
+ }\r
+ }\r
+ taskENABLE_INTERRUPTS();\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+/* Called by FreeRTOS+TCP when the network connects or disconnects. Disconnect\r
+events are only received if implemented in the MAC driver. */\r
+void vApplicationIPNetworkEventHook( eIPCallbackEvent_t eNetworkEvent )\r
+{\r
+ /* This example is the first in a sequence that adds IoT functionality into\r
+ an existing TCP/IP project. In this first project the TCP/IP stack is not\r
+ actually used, but it is still built, which requires this function to be\r
+ present. For now this function does not need to do anything, so just ensure\r
+ the unused parameters don't cause compiler warnings and that calls to this\r
+ function are trapped by the debugger. */\r
+ __debugbreak();\r
+ ( void ) eNetworkEvent;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,\r
+ uint16_t usSourcePort,\r
+ uint32_t ulDestinationAddress,\r
+ uint16_t usDestinationPort )\r
+{\r
+ /* This example is the first in a sequence that adds IoT functionality into\r
+ an existing TCP/IP project. In this first project the TCP/IP stack is not\r
+ actually used, but it is still built, which requires this function to be\r
+ present. For now this function does not need to do anything, so just ensure\r
+ the unused parameters don't cause compiler warnings and that calls to this\r
+ function are trapped by the debugger. */\r
+ ( void ) ulSourceAddress;\r
+ ( void ) usSourcePort;\r
+ ( void ) ulDestinationAddress;\r
+ ( void ) usDestinationPort;\r
+ __debugbreak();\r
+ return 0;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+UBaseType_t uxRand( void )\r
+{\r
+ /* This example is the first in a sequence that adds IoT functionality into\r
+ an existing TCP/IP project. In this first project the TCP/IP stack is not\r
+ actually used, but it is still built, which requires this function to be\r
+ present. For now this function does not need to do anything, so just ensure\r
+ the calls to the function are trapped by the debugger. */\r
+ __debugbreak();\r
+ return 0;\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
+\r