]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/include/FreeRTOS.h
Roll up the minor changes checked into svn since V10.0.0 into new V10.0.1 ready for...
[freertos] / FreeRTOS / Source / include / FreeRTOS.h
index de1a41ff94b2f9a2819afcbd9cdd8047dc7bd7be..f974c73e779f37a71e8685900f528b886d6f3795 100644 (file)
 /*\r
-    FreeRTOS V8.0.0:rc1 - Copyright (C) 2014 Real Time Engineers Ltd.\r
-    All rights reserved\r
-\r
-    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
-\r
-    ***************************************************************************\r
-     *                                                                       *\r
-     *    FreeRTOS provides completely free yet professionally developed,    *\r
-     *    robust, strictly quality controlled, supported, and cross          *\r
-     *    platform software that has become a de facto standard.             *\r
-     *                                                                       *\r
-     *    Help yourself get started quickly and support the FreeRTOS         *\r
-     *    project by purchasing a FreeRTOS tutorial book, reference          *\r
-     *    manual, or both from: http://www.FreeRTOS.org/Documentation        *\r
-     *                                                                       *\r
-     *    Thank you!                                                         *\r
-     *                                                                       *\r
-    ***************************************************************************\r
-\r
-    This file is part of the FreeRTOS distribution.\r
-\r
-    FreeRTOS is free software; you can redistribute it and/or modify it under\r
-    the terms of the GNU General Public License (version 2) as published by the\r
-    Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
-\r
-    >>! NOTE: The modification to the GPL is included to allow you to distribute\r
-    >>! a combined work that includes FreeRTOS without being obliged to provide\r
-    >>! the source code for proprietary components outside of the FreeRTOS\r
-    >>! kernel.\r
-\r
-    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
-    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
-    FOR A PARTICULAR PURPOSE.  Full license text is available from the following\r
-    link: http://www.freertos.org/a00114.html\r
-\r
-    1 tab == 4 spaces!\r
-\r
-    ***************************************************************************\r
-     *                                                                       *\r
-     *    Having a problem?  Start by reading the FAQ "My application does   *\r
-     *    not run, what could be wrong?"                                     *\r
-     *                                                                       *\r
-     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
-     *                                                                       *\r
-    ***************************************************************************\r
-\r
-    http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
-    license and Real Time Engineers Ltd. contact details.\r
-\r
-    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
-    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
-    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
-\r
-    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
-    Integrity Systems to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
-    licenses offer ticketed support, indemnification and middleware.\r
-\r
-    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
-    engineered and independently SIL3 certified version for use in safety and\r
-    mission critical applications that require provable dependability.\r
-\r
-    1 tab == 4 spaces!\r
-*/\r
+ * FreeRTOS Kernel V10.0.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
 #ifndef INC_FREERTOS_H\r
 #define INC_FREERTOS_H\r
 \r
-\r
 /*\r
  * Include the generic headers required for the FreeRTOS port being used.\r
  */\r
 #include <stddef.h>\r
-#include <stdint.h>\r
 \r
-/* Check stdint.h was included. */\r
-#ifndef UINT32_MAX\r
-       /* Check if the FreeRTOS stdint subset has been included. */\r
-       #ifndef FREERTOS_STDINT\r
-               #error Read the instructions in FreeRTOS/source/stdint.readme if stdint.h is not provided with your compiler.\r
-       #endif /* FREERTOS_STDINT */\r
-#endif /* UINT32_MAX */\r
+/*\r
+ * If stdint.h cannot be located then:\r
+ *   + If using GCC ensure the -nostdint options is *not* being used.\r
+ *   + Ensure the project's include path includes the directory in which your\r
+ *     compiler stores stdint.h.\r
+ *   + Set any compiler options necessary for it to support C99, as technically\r
+ *     stdint.h is only mandatory with C99 (FreeRTOS does not require C99 in any\r
+ *     other way).\r
+ *   + The FreeRTOS download includes a simple stdint.h definition that can be\r
+ *     used in cases where none is provided by the compiler.  The files only\r
+ *     contains the typedefs required to build FreeRTOS.  Read the instructions\r
+ *     in FreeRTOS/source/stdint.readme for more information.\r
+ */\r
+#include <stdint.h> /* READ COMMENT ABOVE. */\r
 \r
-/* Basic FreeRTOS definitions. */\r
-#include "projdefs.h"\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
 \r
 /* Application specific configuration options. */\r
 #include "FreeRTOSConfig.h"\r
 \r
-/* configUSE_PORT_OPTIMISED_TASK_SELECTION must be defined before portable.h\r
-is included as it is used by the port layer. */\r
-#ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION\r
-       #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0\r
-#endif\r
+/* Basic FreeRTOS definitions. */\r
+#include "projdefs.h"\r
 \r
 /* Definitions specific to the port being used. */\r
 #include "portable.h"\r
 \r
+/* Must be defaulted before configUSE_NEWLIB_REENTRANT is used below. */\r
+#ifndef configUSE_NEWLIB_REENTRANT\r
+       #define configUSE_NEWLIB_REENTRANT 0\r
+#endif\r
+\r
+/* Required if struct _reent is used. */\r
+#if ( configUSE_NEWLIB_REENTRANT == 1 )\r
+       #include <reent.h>\r
+#endif\r
 /*\r
  * Check all the required application specific macros have been defined.\r
  * These macros are application specific and (as downloaded) are defined\r
@@ -110,6 +84,10 @@ is included as it is used by the port layer. */
        #error Missing definition:  configMAX_PRIORITIES must be defined in FreeRTOSConfig.h.  See the Configuration section of the FreeRTOS API documentation for details.\r
 #endif\r
 \r
+#if configMAX_PRIORITIES < 1\r
+       #error configMAX_PRIORITIES must be defined to be greater than or equal to 1.\r
+#endif\r
+\r
 #ifndef configUSE_PREEMPTION\r
        #error Missing definition:  configUSE_PREEMPTION must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
 #endif\r
@@ -122,54 +100,44 @@ is included as it is used by the port layer. */
        #error Missing definition:  configUSE_TICK_HOOK must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
 #endif\r
 \r
+#ifndef configUSE_16_BIT_TICKS\r
+       #error Missing definition:  configUSE_16_BIT_TICKS must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
+#endif\r
+\r
 #ifndef configUSE_CO_ROUTINES\r
-       #error  Missing definition:  configUSE_CO_ROUTINES must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
+       #define configUSE_CO_ROUTINES 0\r
 #endif\r
 \r
 #ifndef INCLUDE_vTaskPrioritySet\r
-       #error Missing definition:  INCLUDE_vTaskPrioritySet must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
+       #define INCLUDE_vTaskPrioritySet 0\r
 #endif\r
 \r
 #ifndef INCLUDE_uxTaskPriorityGet\r
-       #error Missing definition:  INCLUDE_uxTaskPriorityGet must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
+       #define INCLUDE_uxTaskPriorityGet 0\r
 #endif\r
 \r
 #ifndef INCLUDE_vTaskDelete\r
-       #error Missing definition:  INCLUDE_vTaskDelete must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
+       #define INCLUDE_vTaskDelete 0\r
 #endif\r
 \r
 #ifndef INCLUDE_vTaskSuspend\r
-       #error Missing definition:  INCLUDE_vTaskSuspend must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
+       #define INCLUDE_vTaskSuspend 0\r
 #endif\r
 \r
 #ifndef INCLUDE_vTaskDelayUntil\r
-       #error Missing definition:  INCLUDE_vTaskDelayUntil must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
+       #define INCLUDE_vTaskDelayUntil 0\r
 #endif\r
 \r
 #ifndef INCLUDE_vTaskDelay\r
-       #error Missing definition:  INCLUDE_vTaskDelay must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
-#endif\r
-\r
-#ifndef configUSE_16_BIT_TICKS\r
-       #error Missing definition:  configUSE_16_BIT_TICKS must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
-#endif\r
-\r
-#if configUSE_CO_ROUTINES != 0\r
-       #ifndef configMAX_CO_ROUTINE_PRIORITIES\r
-               #error configMAX_CO_ROUTINE_PRIORITIES must be greater than or equal to 1.\r
-       #endif\r
-#endif\r
-\r
-#ifndef configMAX_PRIORITIES\r
-       #error configMAX_PRIORITIES must be defined to be greater than or equal to 1.\r
+       #define INCLUDE_vTaskDelay 0\r
 #endif\r
 \r
 #ifndef INCLUDE_xTaskGetIdleTaskHandle\r
        #define INCLUDE_xTaskGetIdleTaskHandle 0\r
 #endif\r
 \r
-#ifndef INCLUDE_xTimerGetTimerDaemonTaskHandle\r
-       #define INCLUDE_xTimerGetTimerDaemonTaskHandle 0\r
+#ifndef INCLUDE_xTaskAbortDelay\r
+       #define INCLUDE_xTaskAbortDelay 0\r
 #endif\r
 \r
 #ifndef INCLUDE_xQueueGetMutexHolder\r
@@ -180,12 +148,8 @@ is included as it is used by the port layer. */
        #define INCLUDE_xSemaphoreGetMutexHolder INCLUDE_xQueueGetMutexHolder\r
 #endif\r
 \r
-#ifndef INCLUDE_pcTaskGetTaskName\r
-       #define INCLUDE_pcTaskGetTaskName 0\r
-#endif\r
-\r
-#ifndef configUSE_APPLICATION_TASK_TAG\r
-       #define configUSE_APPLICATION_TASK_TAG 0\r
+#ifndef INCLUDE_xTaskGetHandle\r
+       #define INCLUDE_xTaskGetHandle 0\r
 #endif\r
 \r
 #ifndef INCLUDE_uxTaskGetStackHighWaterMark\r
@@ -196,6 +160,40 @@ is included as it is used by the port layer. */
        #define INCLUDE_eTaskGetState 0\r
 #endif\r
 \r
+#ifndef INCLUDE_xTaskResumeFromISR\r
+       #define INCLUDE_xTaskResumeFromISR 1\r
+#endif\r
+\r
+#ifndef INCLUDE_xTimerPendFunctionCall\r
+       #define INCLUDE_xTimerPendFunctionCall 0\r
+#endif\r
+\r
+#ifndef INCLUDE_xTaskGetSchedulerState\r
+       #define INCLUDE_xTaskGetSchedulerState 0\r
+#endif\r
+\r
+#ifndef INCLUDE_xTaskGetCurrentTaskHandle\r
+       #define INCLUDE_xTaskGetCurrentTaskHandle 0\r
+#endif\r
+\r
+#if configUSE_CO_ROUTINES != 0\r
+       #ifndef configMAX_CO_ROUTINE_PRIORITIES\r
+               #error configMAX_CO_ROUTINE_PRIORITIES must be greater than or equal to 1.\r
+       #endif\r
+#endif\r
+\r
+#ifndef configUSE_DAEMON_TASK_STARTUP_HOOK\r
+       #define configUSE_DAEMON_TASK_STARTUP_HOOK 0\r
+#endif\r
+\r
+#ifndef configUSE_APPLICATION_TASK_TAG\r
+       #define configUSE_APPLICATION_TASK_TAG 0\r
+#endif\r
+\r
+#ifndef configNUM_THREAD_LOCAL_STORAGE_POINTERS\r
+       #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0\r
+#endif\r
+\r
 #ifndef configUSE_RECURSIVE_MUTEXES\r
        #define configUSE_RECURSIVE_MUTEXES 0\r
 #endif\r
@@ -232,18 +230,6 @@ is included as it is used by the port layer. */
        #error configMAX_TASK_NAME_LEN must be set to a minimum of 1 in FreeRTOSConfig.h\r
 #endif\r
 \r
-#ifndef INCLUDE_xTaskResumeFromISR\r
-       #define INCLUDE_xTaskResumeFromISR 1\r
-#endif\r
-\r
-#ifndef INCLUDE_xEventGroupSetBitFromISR\r
-       #define INCLUDE_xEventGroupSetBitFromISR 0\r
-#endif\r
-\r
-#ifndef INCLUDE_xTimerPendFunctionCallFromISR\r
-       #define INCLUDE_xTimerPendFunctionCallFromISR 0\r
-#endif\r
-\r
 #ifndef configASSERT\r
        #define configASSERT( x )\r
        #define configASSERT_DEFINED 0\r
@@ -268,15 +254,6 @@ is included as it is used by the port layer. */
 \r
 #endif /* configUSE_TIMERS */\r
 \r
-#ifndef INCLUDE_xTaskGetSchedulerState\r
-       #define INCLUDE_xTaskGetSchedulerState 0\r
-#endif\r
-\r
-#ifndef INCLUDE_xTaskGetCurrentTaskHandle\r
-       #define INCLUDE_xTaskGetCurrentTaskHandle 0\r
-#endif\r
-\r
-\r
 #ifndef portSET_INTERRUPT_MASK_FROM_ISR\r
        #define portSET_INTERRUPT_MASK_FROM_ISR() 0\r
 #endif\r
@@ -304,6 +281,7 @@ is included as it is used by the port layer. */
 #if ( configQUEUE_REGISTRY_SIZE < 1 )\r
        #define vQueueAddToRegistry( xQueue, pcName )\r
        #define vQueueUnregisterQueue( xQueue )\r
+       #define pcQueueGetName( xQueue )\r
 #endif\r
 \r
 #ifndef portPOINTER_SIZE_TYPE\r
@@ -376,6 +354,14 @@ is included as it is used by the port layer. */
        #define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue )\r
 #endif\r
 \r
+#ifndef traceBLOCKING_ON_QUEUE_PEEK\r
+       /* Task is about to block because it cannot read from a\r
+       queue/mutex/semaphore.  pxQueue is a pointer to the queue/mutex/semaphore\r
+       upon which the read was attempted.  pxCurrentTCB points to the TCB of the\r
+       task that attempted the read. */\r
+       #define traceBLOCKING_ON_QUEUE_PEEK( pxQueue )\r
+#endif\r
+\r
 #ifndef traceBLOCKING_ON_QUEUE_SEND\r
        /* Task is about to block because it cannot write to a\r
        queue/mutex/semaphore.  pxQueue is a pointer to the queue/mutex/semaphore\r
@@ -388,12 +374,24 @@ is included as it is used by the port layer. */
        #define configCHECK_FOR_STACK_OVERFLOW 0\r
 #endif\r
 \r
+#ifndef configRECORD_STACK_HIGH_ADDRESS\r
+       #define configRECORD_STACK_HIGH_ADDRESS 0\r
+#endif\r
+\r
+#ifndef configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H\r
+       #define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H 0\r
+#endif\r
+\r
 /* The following event macros are embedded in the kernel API calls. */\r
 \r
 #ifndef traceMOVED_TASK_TO_READY_STATE\r
        #define traceMOVED_TASK_TO_READY_STATE( pxTCB )\r
 #endif\r
 \r
+#ifndef tracePOST_MOVED_TASK_TO_READY_STATE\r
+       #define tracePOST_MOVED_TASK_TO_READY_STATE( pxTCB )\r
+#endif\r
+\r
 #ifndef traceQUEUE_CREATE\r
        #define traceQUEUE_CREATE( pxNewQueue )\r
 #endif\r
@@ -450,6 +448,10 @@ is included as it is used by the port layer. */
        #define traceQUEUE_PEEK( pxQueue )\r
 #endif\r
 \r
+#ifndef traceQUEUE_PEEK_FAILED\r
+       #define traceQUEUE_PEEK_FAILED( pxQueue )\r
+#endif\r
+\r
 #ifndef traceQUEUE_PEEK_FROM_ISR\r
        #define traceQUEUE_PEEK_FROM_ISR( pxQueue )\r
 #endif\r
@@ -495,7 +497,7 @@ is included as it is used by the port layer. */
 #endif\r
 \r
 #ifndef traceTASK_DELAY_UNTIL\r
-       #define traceTASK_DELAY_UNTIL()\r
+       #define traceTASK_DELAY_UNTIL( x )\r
 #endif\r
 \r
 #ifndef traceTASK_DELAY\r
@@ -558,20 +560,20 @@ is included as it is used by the port layer. */
        #define traceEVENT_GROUP_CREATE_FAILED()\r
 #endif\r
 \r
-#ifndef traceEVENT_GROUP_SYNC_START\r
-       #define traceEVENT_GROUP_SYNC_START( xEventGroup, uxBitsToSet )\r
+#ifndef traceEVENT_GROUP_SYNC_BLOCK\r
+       #define traceEVENT_GROUP_SYNC_BLOCK( xEventGroup, uxBitsToSet, uxBitsToWaitFor )\r
 #endif\r
 \r
 #ifndef traceEVENT_GROUP_SYNC_END\r
-       #define traceEVENT_GROUP_SYNC_END( xEventGroup, uxReturn )\r
+       #define traceEVENT_GROUP_SYNC_END( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTimeoutOccurred ) ( void ) xTimeoutOccurred\r
 #endif\r
 \r
-#ifndef traceEVENT_GROUP_WAIT_BITS_START\r
-       #define traceEVENT_GROUP_WAIT_BITS_START( xEventGroup, uxBitsToWaitFor )\r
+#ifndef traceEVENT_GROUP_WAIT_BITS_BLOCK\r
+       #define traceEVENT_GROUP_WAIT_BITS_BLOCK( xEventGroup, uxBitsToWaitFor )\r
 #endif\r
 \r
 #ifndef traceEVENT_GROUP_WAIT_BITS_END\r
-       #define traceEVENT_GROUP_WAIT_BITS_END( xEventGroup, uxReturn )\r
+       #define traceEVENT_GROUP_WAIT_BITS_END( xEventGroup, uxBitsToWaitFor, xTimeoutOccurred ) ( void ) xTimeoutOccurred\r
 #endif\r
 \r
 #ifndef traceEVENT_GROUP_CLEAR_BITS\r
@@ -586,10 +588,106 @@ is included as it is used by the port layer. */
        #define traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet )\r
 #endif\r
 \r
+#ifndef traceEVENT_GROUP_SET_BITS_FROM_ISR\r
+       #define traceEVENT_GROUP_SET_BITS_FROM_ISR( xEventGroup, uxBitsToSet )\r
+#endif\r
+\r
 #ifndef traceEVENT_GROUP_DELETE\r
        #define traceEVENT_GROUP_DELETE( xEventGroup )\r
 #endif\r
 \r
+#ifndef tracePEND_FUNC_CALL\r
+       #define tracePEND_FUNC_CALL(xFunctionToPend, pvParameter1, ulParameter2, ret)\r
+#endif\r
+\r
+#ifndef tracePEND_FUNC_CALL_FROM_ISR\r
+       #define tracePEND_FUNC_CALL_FROM_ISR(xFunctionToPend, pvParameter1, ulParameter2, ret)\r
+#endif\r
+\r
+#ifndef traceQUEUE_REGISTRY_ADD\r
+       #define traceQUEUE_REGISTRY_ADD(xQueue, pcQueueName)\r
+#endif\r
+\r
+#ifndef traceTASK_NOTIFY_TAKE_BLOCK\r
+       #define traceTASK_NOTIFY_TAKE_BLOCK()\r
+#endif\r
+\r
+#ifndef traceTASK_NOTIFY_TAKE\r
+       #define traceTASK_NOTIFY_TAKE()\r
+#endif\r
+\r
+#ifndef traceTASK_NOTIFY_WAIT_BLOCK\r
+       #define traceTASK_NOTIFY_WAIT_BLOCK()\r
+#endif\r
+\r
+#ifndef traceTASK_NOTIFY_WAIT\r
+       #define traceTASK_NOTIFY_WAIT()\r
+#endif\r
+\r
+#ifndef traceTASK_NOTIFY\r
+       #define traceTASK_NOTIFY()\r
+#endif\r
+\r
+#ifndef traceTASK_NOTIFY_FROM_ISR\r
+       #define traceTASK_NOTIFY_FROM_ISR()\r
+#endif\r
+\r
+#ifndef traceTASK_NOTIFY_GIVE_FROM_ISR\r
+       #define traceTASK_NOTIFY_GIVE_FROM_ISR()\r
+#endif\r
+\r
+#ifndef traceSTREAM_BUFFER_CREATE_FAILED\r
+       #define traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer )\r
+#endif\r
+\r
+#ifndef traceSTREAM_BUFFER_CREATE_STATIC_FAILED\r
+       #define traceSTREAM_BUFFER_CREATE_STATIC_FAILED( xReturn, xIsMessageBuffer )\r
+#endif\r
+\r
+#ifndef traceSTREAM_BUFFER_CREATE\r
+       #define traceSTREAM_BUFFER_CREATE( pxStreamBuffer, xIsMessageBuffer )\r
+#endif\r
+\r
+#ifndef traceSTREAM_BUFFER_DELETE\r
+       #define traceSTREAM_BUFFER_DELETE( xStreamBuffer )\r
+#endif\r
+\r
+#ifndef traceSTREAM_BUFFER_RESET\r
+       #define traceSTREAM_BUFFER_RESET( xStreamBuffer )\r
+#endif\r
+\r
+#ifndef traceBLOCKING_ON_STREAM_BUFFER_SEND\r
+       #define traceBLOCKING_ON_STREAM_BUFFER_SEND( xStreamBuffer )\r
+#endif\r
+\r
+#ifndef traceSTREAM_BUFFER_SEND\r
+       #define traceSTREAM_BUFFER_SEND( xStreamBuffer, xBytesSent )\r
+#endif\r
+\r
+#ifndef traceSTREAM_BUFFER_SEND_FAILED\r
+       #define traceSTREAM_BUFFER_SEND_FAILED( xStreamBuffer )\r
+#endif\r
+\r
+#ifndef traceSTREAM_BUFFER_SEND_FROM_ISR\r
+       #define traceSTREAM_BUFFER_SEND_FROM_ISR( xStreamBuffer, xBytesSent )\r
+#endif\r
+\r
+#ifndef traceBLOCKING_ON_STREAM_BUFFER_RECEIVE\r
+       #define traceBLOCKING_ON_STREAM_BUFFER_RECEIVE( xStreamBuffer )\r
+#endif\r
+\r
+#ifndef traceSTREAM_BUFFER_RECEIVE\r
+       #define traceSTREAM_BUFFER_RECEIVE( xStreamBuffer, xReceivedLength )\r
+#endif\r
+\r
+#ifndef traceSTREAM_BUFFER_RECEIVE_FAILED\r
+       #define traceSTREAM_BUFFER_RECEIVE_FAILED( xStreamBuffer )\r
+#endif\r
+\r
+#ifndef traceSTREAM_BUFFER_RECEIVE_FROM_ISR\r
+       #define traceSTREAM_BUFFER_RECEIVE_FROM_ISR( xStreamBuffer, xReceivedLength )\r
+#endif\r
+\r
 #ifndef configGENERATE_RUN_TIME_STATS\r
        #define configGENERATE_RUN_TIME_STATS 0\r
 #endif\r
@@ -624,14 +722,6 @@ is included as it is used by the port layer. */
        #define portYIELD_WITHIN_API portYIELD\r
 #endif\r
 \r
-#ifndef pvPortMallocAligned\r
-       #define pvPortMallocAligned( x, puxStackBuffer ) ( ( ( puxStackBuffer ) == NULL ) ? ( pvPortMalloc( ( x ) ) ) : ( puxStackBuffer ) )\r
-#endif\r
-\r
-#ifndef vPortFreeAligned\r
-       #define vPortFreeAligned( pvBlockToFree ) vPortFree( pvBlockToFree )\r
-#endif\r
-\r
 #ifndef portSUPPRESS_TICKS_AND_SLEEP\r
        #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime )\r
 #endif\r
@@ -648,6 +738,10 @@ is included as it is used by the port layer. */
        #define configUSE_TICKLESS_IDLE 0\r
 #endif\r
 \r
+#ifndef configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING\r
+       #define configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( x )\r
+#endif\r
+\r
 #ifndef configPRE_SLEEP_PROCESSING\r
        #define configPRE_SLEEP_PROCESSING( x )\r
 #endif\r
@@ -664,6 +758,10 @@ is included as it is used by the port layer. */
        #define portTASK_USES_FLOATING_POINT()\r
 #endif\r
 \r
+#ifndef portTASK_CALLS_SECURE_FUNCTIONS\r
+       #define portTASK_CALLS_SECURE_FUNCTIONS()\r
+#endif\r
+\r
 #ifndef configUSE_TIME_SLICING\r
        #define configUSE_TIME_SLICING 1\r
 #endif\r
@@ -672,10 +770,6 @@ is included as it is used by the port layer. */
        #define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 0\r
 #endif\r
 \r
-#ifndef configUSE_NEWLIB_REENTRANT\r
-       #define configUSE_NEWLIB_REENTRANT 0\r
-#endif\r
-\r
 #ifndef configUSE_STATS_FORMATTING_FUNCTIONS\r
        #define configUSE_STATS_FORMATTING_FUNCTIONS 0\r
 #endif\r
@@ -692,12 +786,114 @@ is included as it is used by the port layer. */
        #define mtCOVERAGE_TEST_MARKER()\r
 #endif\r
 \r
+#ifndef mtCOVERAGE_TEST_DELAY\r
+       #define mtCOVERAGE_TEST_DELAY()\r
+#endif\r
+\r
+#ifndef portASSERT_IF_IN_ISR\r
+       #define portASSERT_IF_IN_ISR()\r
+#endif\r
+\r
+#ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION\r
+       #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0\r
+#endif\r
+\r
+#ifndef configAPPLICATION_ALLOCATED_HEAP\r
+       #define configAPPLICATION_ALLOCATED_HEAP 0\r
+#endif\r
+\r
+#ifndef configUSE_TASK_NOTIFICATIONS\r
+       #define configUSE_TASK_NOTIFICATIONS 1\r
+#endif\r
+\r
+#ifndef portTICK_TYPE_IS_ATOMIC\r
+       #define portTICK_TYPE_IS_ATOMIC 0\r
+#endif\r
+\r
+#ifndef configSUPPORT_STATIC_ALLOCATION\r
+       /* Defaults to 0 for backward compatibility. */\r
+       #define configSUPPORT_STATIC_ALLOCATION 0\r
+#endif\r
+\r
+#ifndef configSUPPORT_DYNAMIC_ALLOCATION\r
+       /* Defaults to 1 for backward compatibility. */\r
+       #define configSUPPORT_DYNAMIC_ALLOCATION 1\r
+#endif\r
+\r
+#ifndef configSTACK_DEPTH_TYPE\r
+       /* Defaults to uint16_t for backward compatibility, but can be overridden\r
+       in FreeRTOSConfig.h if uint16_t is too restrictive. */\r
+       #define configSTACK_DEPTH_TYPE uint16_t\r
+#endif\r
+\r
+/* Sanity check the configuration. */\r
+#if( configUSE_TICKLESS_IDLE != 0 )\r
+       #if( INCLUDE_vTaskSuspend != 1 )\r
+               #error INCLUDE_vTaskSuspend must be set to 1 if configUSE_TICKLESS_IDLE is not set to 0\r
+       #endif /* INCLUDE_vTaskSuspend */\r
+#endif /* configUSE_TICKLESS_IDLE */\r
+\r
+#if( ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) )\r
+       #error configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION cannot both be 0, but can both be 1.\r
+#endif\r
+\r
+#if( ( configUSE_RECURSIVE_MUTEXES == 1 ) && ( configUSE_MUTEXES != 1 ) )\r
+       #error configUSE_MUTEXES must be set to 1 to use recursive mutexes\r
+#endif\r
+\r
+#ifndef configINITIAL_TICK_COUNT\r
+       #define configINITIAL_TICK_COUNT 0\r
+#endif\r
+\r
+#if( portTICK_TYPE_IS_ATOMIC == 0 )\r
+       /* Either variables of tick type cannot be read atomically, or\r
+       portTICK_TYPE_IS_ATOMIC was not set - map the critical sections used when\r
+       the tick count is returned to the standard critical section macros. */\r
+       #define portTICK_TYPE_ENTER_CRITICAL() portENTER_CRITICAL()\r
+       #define portTICK_TYPE_EXIT_CRITICAL() portEXIT_CRITICAL()\r
+       #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()\r
+       #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( ( x ) )\r
+#else\r
+       /* The tick type can be read atomically, so critical sections used when the\r
+       tick count is returned can be defined away. */\r
+       #define portTICK_TYPE_ENTER_CRITICAL()\r
+       #define portTICK_TYPE_EXIT_CRITICAL()\r
+       #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() 0\r
+       #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) ( void ) x\r
+#endif\r
+\r
 /* Definitions to allow backward compatibility with FreeRTOS versions prior to\r
 V8 if desired. */\r
 #ifndef configENABLE_BACKWARD_COMPATIBILITY\r
        #define configENABLE_BACKWARD_COMPATIBILITY 1\r
 #endif\r
 \r
+#ifndef configPRINTF\r
+       /* configPRINTF() was not defined, so define it away to nothing.  To use\r
+       configPRINTF() then define it as follows (where MyPrintFunction() is\r
+       provided by the application writer):\r
+\r
+       void MyPrintFunction(const char *pcFormat, ... );\r
+       #define configPRINTF( X )   MyPrintFunction X\r
+\r
+       Then call like a standard printf() function, but placing brackets around\r
+       all parameters so they are passed as a single parameter.  For example:\r
+       configPRINTF( ("Value = %d", MyVariable) ); */\r
+       #define configPRINTF( X )\r
+#endif\r
+\r
+#ifndef configMAX\r
+       /* The application writer has not provided their own MAX macro, so define\r
+       the following generic implementation. */\r
+       #define configMAX( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) )\r
+#endif\r
+\r
+#ifndef configMIN\r
+       /* The application writer has not provided their own MAX macro, so define\r
+       the following generic implementation. */\r
+       #define configMIN( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )\r
+#endif\r
+\r
 #if configENABLE_BACKWARD_COMPATIBILITY == 1\r
        #define eTaskStateGet eTaskGetState\r
        #define portTickType TickType_t\r
@@ -714,6 +910,10 @@ V8 if desired. */
        #define xCoRoutineHandle CoRoutineHandle_t\r
        #define pdTASK_HOOK_CODE TaskHookFunction_t\r
        #define portTICK_RATE_MS portTICK_PERIOD_MS\r
+       #define pcTaskGetTaskName pcTaskGetName\r
+       #define pcTimerGetTimerName pcTimerGetName\r
+       #define pcQueueGetQueueName pcQueueGetName\r
+       #define vTaskGetTaskInfo vTaskGetInfo\r
 \r
        /* Backward compatibility within the scheduler code only - these definitions\r
        are not really required but are included for completeness. */\r
@@ -723,5 +923,246 @@ V8 if desired. */
        #define xList List_t\r
 #endif /* configENABLE_BACKWARD_COMPATIBILITY */\r
 \r
+#if( configUSE_ALTERNATIVE_API != 0 )\r
+       #error The alternative API was deprecated some time ago, and was removed in FreeRTOS V9.0 0\r
+#endif\r
+\r
+/* Set configUSE_TASK_FPU_SUPPORT to 0 to omit floating point support even\r
+if floating point hardware is otherwise supported by the FreeRTOS port in use.\r
+This constant is not supported by all FreeRTOS ports that include floating\r
+point support. */\r
+#ifndef configUSE_TASK_FPU_SUPPORT\r
+       #define configUSE_TASK_FPU_SUPPORT 1\r
+#endif\r
+\r
+/*\r
+ * In line with software engineering best practice, FreeRTOS implements a strict\r
+ * data hiding policy, so the real structures used by FreeRTOS to maintain the\r
+ * state of tasks, queues, semaphores, etc. are not accessible to the application\r
+ * code.  However, if the application writer wants to statically allocate such\r
+ * an object then the size of the object needs to be know.  Dummy structures\r
+ * that are guaranteed to have the same size and alignment requirements of the\r
+ * real objects are used for this purpose.  The dummy list and list item\r
+ * structures below are used for inclusion in such a dummy structure.\r
+ */\r
+struct xSTATIC_LIST_ITEM\r
+{\r
+       TickType_t xDummy1;\r
+       void *pvDummy2[ 4 ];\r
+};\r
+typedef struct xSTATIC_LIST_ITEM StaticListItem_t;\r
+\r
+/* See the comments above the struct xSTATIC_LIST_ITEM definition. */\r
+struct xSTATIC_MINI_LIST_ITEM\r
+{\r
+       TickType_t xDummy1;\r
+       void *pvDummy2[ 2 ];\r
+};\r
+typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t;\r
+\r
+/* See the comments above the struct xSTATIC_LIST_ITEM definition. */\r
+typedef struct xSTATIC_LIST\r
+{\r
+       UBaseType_t uxDummy1;\r
+       void *pvDummy2;\r
+       StaticMiniListItem_t xDummy3;\r
+} StaticList_t;\r
+\r
+/*\r
+ * In line with software engineering best practice, especially when supplying a\r
+ * library that is likely to change in future versions, FreeRTOS implements a\r
+ * strict data hiding policy.  This means the Task structure used internally by\r
+ * FreeRTOS is not accessible to application code.  However, if the application\r
+ * writer wants to statically allocate the memory required to create a task then\r
+ * the size of the task object needs to be know.  The StaticTask_t structure\r
+ * below is provided for this purpose.  Its sizes and alignment requirements are\r
+ * guaranteed to match those of the genuine structure, no matter which\r
+ * architecture is being used, and no matter how the values in FreeRTOSConfig.h\r
+ * are set.  Its contents are somewhat obfuscated in the hope users will\r
+ * recognise that it would be unwise to make direct use of the structure members.\r
+ */\r
+typedef struct xSTATIC_TCB\r
+{\r
+       void                            *pxDummy1;\r
+       #if ( portUSING_MPU_WRAPPERS == 1 )\r
+               xMPU_SETTINGS   xDummy2;\r
+       #endif\r
+       StaticListItem_t        xDummy3[ 2 ];\r
+       UBaseType_t                     uxDummy5;\r
+       void                            *pxDummy6;\r
+       uint8_t                         ucDummy7[ configMAX_TASK_NAME_LEN ];\r
+       #if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )\r
+               void                    *pxDummy8;\r
+       #endif\r
+       #if ( portCRITICAL_NESTING_IN_TCB == 1 )\r
+               UBaseType_t             uxDummy9;\r
+       #endif\r
+       #if ( configUSE_TRACE_FACILITY == 1 )\r
+               UBaseType_t             uxDummy10[ 2 ];\r
+       #endif\r
+       #if ( configUSE_MUTEXES == 1 )\r
+               UBaseType_t             uxDummy12[ 2 ];\r
+       #endif\r
+       #if ( configUSE_APPLICATION_TASK_TAG == 1 )\r
+               void                    *pxDummy14;\r
+       #endif\r
+       #if( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )\r
+               void                    *pvDummy15[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];\r
+       #endif\r
+       #if ( configGENERATE_RUN_TIME_STATS == 1 )\r
+               uint32_t                ulDummy16;\r
+       #endif\r
+       #if ( configUSE_NEWLIB_REENTRANT == 1 )\r
+               struct  _reent  xDummy17;\r
+       #endif\r
+       #if ( configUSE_TASK_NOTIFICATIONS == 1 )\r
+               uint32_t                ulDummy18;\r
+               uint8_t                 ucDummy19;\r
+       #endif\r
+       #if( ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) || ( portUSING_MPU_WRAPPERS == 1 ) )\r
+               uint8_t                 uxDummy20;\r
+       #endif\r
+\r
+       #if( INCLUDE_xTaskAbortDelay == 1 )\r
+               uint8_t ucDummy21;\r
+       #endif\r
+\r
+} StaticTask_t;\r
+\r
+/*\r
+ * In line with software engineering best practice, especially when supplying a\r
+ * library that is likely to change in future versions, FreeRTOS implements a\r
+ * strict data hiding policy.  This means the Queue structure used internally by\r
+ * FreeRTOS is not accessible to application code.  However, if the application\r
+ * writer wants to statically allocate the memory required to create a queue\r
+ * then the size of the queue object needs to be know.  The StaticQueue_t\r
+ * structure below is provided for this purpose.  Its sizes and alignment\r
+ * requirements are guaranteed to match those of the genuine structure, no\r
+ * matter which architecture is being used, and no matter how the values in\r
+ * FreeRTOSConfig.h are set.  Its contents are somewhat obfuscated in the hope\r
+ * users will recognise that it would be unwise to make direct use of the\r
+ * structure members.\r
+ */\r
+typedef struct xSTATIC_QUEUE\r
+{\r
+       void *pvDummy1[ 3 ];\r
+\r
+       union\r
+       {\r
+               void *pvDummy2;\r
+               UBaseType_t uxDummy2;\r
+       } u;\r
+\r
+       StaticList_t xDummy3[ 2 ];\r
+       UBaseType_t uxDummy4[ 3 ];\r
+       uint8_t ucDummy5[ 2 ];\r
+\r
+       #if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )\r
+               uint8_t ucDummy6;\r
+       #endif\r
+\r
+       #if ( configUSE_QUEUE_SETS == 1 )\r
+               void *pvDummy7;\r
+       #endif\r
+\r
+       #if ( configUSE_TRACE_FACILITY == 1 )\r
+               UBaseType_t uxDummy8;\r
+               uint8_t ucDummy9;\r
+       #endif\r
+\r
+} StaticQueue_t;\r
+typedef StaticQueue_t StaticSemaphore_t;\r
+\r
+/*\r
+ * In line with software engineering best practice, especially when supplying a\r
+ * library that is likely to change in future versions, FreeRTOS implements a\r
+ * strict data hiding policy.  This means the event group structure used\r
+ * internally by FreeRTOS is not accessible to application code.  However, if\r
+ * the application writer wants to statically allocate the memory required to\r
+ * create an event group then the size of the event group object needs to be\r
+ * know.  The StaticEventGroup_t structure below is provided for this purpose.\r
+ * Its sizes and alignment requirements are guaranteed to match those of the\r
+ * genuine structure, no matter which architecture is being used, and no matter\r
+ * how the values in FreeRTOSConfig.h are set.  Its contents are somewhat\r
+ * obfuscated in the hope users will recognise that it would be unwise to make\r
+ * direct use of the structure members.\r
+ */\r
+typedef struct xSTATIC_EVENT_GROUP\r
+{\r
+       TickType_t xDummy1;\r
+       StaticList_t xDummy2;\r
+\r
+       #if( configUSE_TRACE_FACILITY == 1 )\r
+               UBaseType_t uxDummy3;\r
+       #endif\r
+\r
+       #if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )\r
+                       uint8_t ucDummy4;\r
+       #endif\r
+\r
+} StaticEventGroup_t;\r
+\r
+/*\r
+ * In line with software engineering best practice, especially when supplying a\r
+ * library that is likely to change in future versions, FreeRTOS implements a\r
+ * strict data hiding policy.  This means the software timer structure used\r
+ * internally by FreeRTOS is not accessible to application code.  However, if\r
+ * the application writer wants to statically allocate the memory required to\r
+ * create a software timer then the size of the queue object needs to be know.\r
+ * The StaticTimer_t structure below is provided for this purpose.  Its sizes\r
+ * and alignment requirements are guaranteed to match those of the genuine\r
+ * structure, no matter which architecture is being used, and no matter how the\r
+ * values in FreeRTOSConfig.h are set.  Its contents are somewhat obfuscated in\r
+ * the hope users will recognise that it would be unwise to make direct use of\r
+ * the structure members.\r
+ */\r
+typedef struct xSTATIC_TIMER\r
+{\r
+       void                            *pvDummy1;\r
+       StaticListItem_t        xDummy2;\r
+       TickType_t                      xDummy3;\r
+       UBaseType_t                     uxDummy4;\r
+       void                            *pvDummy5[ 2 ];\r
+       #if( configUSE_TRACE_FACILITY == 1 )\r
+               UBaseType_t             uxDummy6;\r
+       #endif\r
+\r
+       #if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )\r
+               uint8_t                 ucDummy7;\r
+       #endif\r
+\r
+} StaticTimer_t;\r
+\r
+/*\r
+* In line with software engineering best practice, especially when supplying a\r
+* library that is likely to change in future versions, FreeRTOS implements a\r
+* strict data hiding policy.  This means the stream buffer structure used\r
+* internally by FreeRTOS is not accessible to application code.  However, if\r
+* the application writer wants to statically allocate the memory required to\r
+* create a stream buffer then the size of the stream buffer object needs to be\r
+* know.  The StaticStreamBuffer_t structure below is provided for this purpose.\r
+* Its size and alignment requirements are guaranteed to match those of the\r
+* genuine structure, no matter which architecture is being used, and no matter\r
+* how the values in FreeRTOSConfig.h are set.  Its contents are somewhat\r
+* obfuscated in the hope users will recognise that it would be unwise to make\r
+* direct use of the structure members.\r
+*/\r
+typedef struct xSTATIC_STREAM_BUFFER\r
+{\r
+       size_t uxDummy1[ 4 ];\r
+       void * pvDummy2[ 3 ];\r
+       uint8_t ucDummy3;\r
+       #if ( configUSE_TRACE_FACILITY == 1 )\r
+               UBaseType_t uxDummy4;\r
+       #endif\r
+} StaticStreamBuffer_t;\r
+\r
+/* Message buffers are built on stream buffers. */\r
+typedef StaticStreamBuffer_t StaticMessageBuffer_t;\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
 #endif /* INC_FREERTOS_H */\r
 \r