\r
#if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
\r
- EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t *pxStaticEventGroup )\r
+ EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t *pxEventGroupBuffer )\r
{\r
EventGroup_t *pxEventBits;\r
\r
/* A StaticEventGroup_t object must be provided. */\r
- configASSERT( pxStaticEventGroup );\r
+ configASSERT( pxEventGroupBuffer );\r
\r
/* The user has provided a statically allocated event group - use it. */\r
- pxEventBits = ( EventGroup_t * ) pxStaticEventGroup; /*lint !e740 EventGroup_t and StaticEventGroup_t are guaranteed to have the same size and alignment requirement - checked by configASSERT(). */\r
+ pxEventBits = ( EventGroup_t * ) pxEventGroupBuffer; /*lint !e740 EventGroup_t and StaticEventGroup_t are guaranteed to have the same size and alignment requirement - checked by configASSERT(). */\r
\r
if( pxEventBits != NULL )\r
{\r
uint32_t ulDummy18;\r
uint8_t ucDummy19;\r
#endif\r
- #if ( configSUPPORT_STATIC_ALLOCATION == 1 )\r
+ #if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )\r
uint8_t uxDummy20;\r
#endif\r
\r
UBaseType_t uxDummy4[ 3 ];\r
uint8_t ucDummy5[ 2 ];\r
\r
- #if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
+ #if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )\r
uint8_t ucDummy6;\r
#endif\r
\r
UBaseType_t uxDummy3;\r
#endif\r
\r
- #if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
- uint8_t ucStaticallyAllocated;\r
+ #if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )\r
+ uint8_t ucDummy4;\r
#endif\r
\r
} StaticEventGroup_t;\r
UBaseType_t uxDummy6;\r
#endif\r
\r
- #if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
- uint8_t ucStaticallyAllocated;\r
+ #if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )\r
+ uint8_t ucDummy7;\r
#endif\r
\r
} StaticTimer_t;\r
EventGroupHandle_t xEventGroupCreate( void );\r
</pre>\r
*\r
- * Create a new event group. This function cannot be called from an interrupt.\r
+ * Create a new event group.\r
+ *\r
+ * Internally, within the FreeRTOS implementation, event groups use a [small]\r
+ * block of memory, in which the event group's structure is stored. If an event\r
+ * groups is created using xEventGropuCreate() then the required memory is\r
+ * automatically dynamically allocated inside the xEventGroupCreate() function.\r
+ * (see http://www.freertos.org/a00111.html). If an event group is created\r
+ * using xEventGropuCreateStatic() then the application writer must instead\r
+ * provide the memory that will get used by the event group.\r
+ * xEventGroupCreateStatic() therefore allows an event group to be created\r
+ * without using any dynamic memory allocation.\r
*\r
* Although event groups are not related to ticks, for internal implementation\r
* reasons the number of bits available for use in an event group is dependent\r
EventGroupHandle_t xEventGroupCreate( void ) PRIVILEGED_FUNCTION;\r
#endif\r
\r
+/**\r
+ * event_groups.h\r
+ *<pre>\r
+ EventGroupHandle_t xEventGroupCreateStatic( EventGroupHandle_t * pxEventGroupBuffer );\r
+ </pre>\r
+ *\r
+ * Create a new event group.\r
+ *\r
+ * Internally, within the FreeRTOS implementation, event groups use a [small]\r
+ * block of memory, in which the event group's structure is stored. If an event\r
+ * groups is created using xEventGropuCreate() then the required memory is\r
+ * automatically dynamically allocated inside the xEventGroupCreate() function.\r
+ * (see http://www.freertos.org/a00111.html). If an event group is created\r
+ * using xEventGropuCreateStatic() then the application writer must instead\r
+ * provide the memory that will get used by the event group.\r
+ * xEventGroupCreateStatic() therefore allows an event group to be created\r
+ * without using any dynamic memory allocation.\r
+ *\r
+ * Although event groups are not related to ticks, for internal implementation\r
+ * reasons the number of bits available for use in an event group is dependent\r
+ * on the configUSE_16_BIT_TICKS setting in FreeRTOSConfig.h. If\r
+ * configUSE_16_BIT_TICKS is 1 then each event group contains 8 usable bits (bit\r
+ * 0 to bit 7). If configUSE_16_BIT_TICKS is set to 0 then each event group has\r
+ * 24 usable bits (bit 0 to bit 23). The EventBits_t type is used to store\r
+ * event bits within an event group.\r
+ *\r
+ * @param pxEventGroupBuffer pxEventGroupBuffer must point to a variable of type\r
+ * StaticEventGroup_t, which will be then be used to hold the event group's data\r
+ * structures, removing the need for the memory to be allocated dynamically.\r
+ *\r
+ * @return If the event group was created then a handle to the event group is\r
+ * returned. If pxEventGroupBuffer was NULL then NULL is returned.\r
+ *\r
+ * Example usage:\r
+ <pre>\r
+ // StaticEventGroup_t is a publicly accessible structure that has the same\r
+ // size and alignment requirements as the real event group structure. It is\r
+ // provided as a mechanism for applications to know the size of the event\r
+ // group (which is dependent on the architecture and configuration file\r
+ // settings) without breaking the strict data hiding policy by exposing the\r
+ // real event group internals. This StaticEventGroup_t variable is passed\r
+ // into the xSemaphoreCreateEventGroupStatic() function and is used to store\r
+ // the event group's data structures\r
+ StaticEventGroup_t xEventGroupBuffer;\r
+\r
+ // Create the event group without dynamically allocating any memory.\r
+ xEventGroup = xEventGroupCreateStatic( &xEventGroupBuffer );\r
+ </pre>\r
+ */\r
#if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
- EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t *pxStaticEventGroup ) PRIVILEGED_FUNCTION;\r
+ EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t *pxEventGroupBuffer ) PRIVILEGED_FUNCTION;\r
#endif\r
\r
/**\r
* Creates a new queue instance, and returns a handle by which the new queue\r
* can be referenced.\r
*\r
- * Internally, within the FreeRTOS implementation, queue's use two blocks of\r
+ * Internally, within the FreeRTOS implementation, queues use two blocks of\r
* memory. The first block is used to hold the queue's data structures. The\r
* second block is used to hold items placed into the queue. If a queue is\r
* created using xQueueCreate() then both blocks of memory are automatically\r
* dynamically allocated inside the xQueueCreate() function. (see\r
* http://www.freertos.org/a00111.html). If a queue is created using\r
- * xQueueCreateStatic() then the application writer can instead optionally\r
- * provide the memory that will get used by the queue. xQueueCreateStatic()\r
- * therefore allows a queue to be created without using any dynamic memory\r
- * allocation.\r
+ * xQueueCreateStatic() then the application writer must provide the memory that\r
+ * will get used by the queue. xQueueCreateStatic() therefore allows a queue to\r
+ * be created without using any dynamic memory allocation.\r
+ *\r
+ * http://www.FreeRTOS.org/Embedded-RTOS-Queues.html\r
*\r
* @param uxQueueLength The maximum number of items that the queue can contain.\r
*\r
* Creates a new queue instance, and returns a handle by which the new queue\r
* can be referenced.\r
*\r
- * Internally, within the FreeRTOS implementation, queue's use two blocks of\r
+ * Internally, within the FreeRTOS implementation, queues use two blocks of\r
* memory. The first block is used to hold the queue's data structures. The\r
* second block is used to hold items placed into the queue. If a queue is\r
* created using xQueueCreate() then both blocks of memory are automatically\r
* dynamically allocated inside the xQueueCreate() function. (see\r
* http://www.freertos.org/a00111.html). If a queue is created using\r
- * xQueueCreateStatic() then the application writer can instead optionally\r
- * provide the memory that will get used by the queue. xQueueCreateStatic()\r
- * therefore allows a queue to be created without using any dynamic memory\r
- * allocation.\r
+ * xQueueCreateStatic() then the application writer must provide the memory that\r
+ * will get used by the queue. xQueueCreateStatic() therefore allows a queue to\r
+ * be created without using any dynamic memory allocation.\r
+ *\r
+ * http://www.FreeRTOS.org/Embedded-RTOS-Queues.html\r
*\r
* @param uxQueueLength The maximum number of items that the queue can contain.\r
*\r
* that will be copied for each posted item. Each item on the queue must be\r
* the same size.\r
*\r
- * @param pucQueueStorageBuffer If pucQueueStorageBuffer is NULL then the memory\r
- * used to hold items stored in the queue will be allocated dynamically, just as\r
- * when a queue is created using xQueueCreate(). If pxQueueStorageBuffer is not\r
- * NULL then it must point to a uint8_t array that is at least large enough to\r
- * hold the maximum number of items that can be in the queue at any one time -\r
- * which is ( uxQueueLength * uxItemsSize ) bytes.\r
- *\r
- * @param pxQueueBuffer If pxQueueBuffer is NULL then the memory required to\r
- * hold the queue's data structures will be allocated dynamically, just as when\r
- * a queue is created using xQueueCreate(). If pxQueueBuffer is not NULL then\r
- * it must point to a variable of type StaticQueue_t, which will then be used to\r
- * hold the queue's data structure, removing the need for the memory to be\r
- * allocated dynamically.\r
- *\r
- * @return If neither pucQueueStorageBuffer or pxQueueBuffer are NULL, then the\r
- * function will not attempt any dynamic memory allocation, and a handle to the\r
- * created queue will always be returned. If pucQueueStorageBuffer or\r
- * pxQueueBuffer is NULL then the function will attempt to dynamically allocate\r
- * one of both buffers. In this case, if the allocation succeeds then a handle\r
- * to the created queue will be returned, and if one of the the allocation fails\r
- * NULL will be returned.\r
+ * @param pucQueueStorageBuffer If uxItemSize is not zero then\r
+ * pucQueueStorageBuffer must point to a uint8_t array that is at least large\r
+ * enough to hold the maximum number of items that can be in the queue at any\r
+ * one time - which is ( uxQueueLength * uxItemsSize ) bytes. If uxItemSize is\r
+ * zero then pucQueueStorageBuffer can be NULL.\r
+ *\r
+ * @param pxQueueBuffer Must point to a variable of type StaticQueue_t, which\r
+ * will be used to hold the queue's data structure.\r
+ *\r
+ * @return If the queue is created then a handle to the created queue is\r
+ * returned. If pxQueueBuffer is NULL then NULL is returned.\r
*\r
* Example usage:\r
<pre>\r
&xQueueBuffer ); // The buffer that will hold the queue structure.\r
\r
// The queue is guaranteed to be created successfully as no dynamic memory\r
- // allocation was used. Therefore xQueue1 is now a handle to a valid queue.\r
+ // allocation is used. Therefore xQueue1 is now a handle to a valid queue.\r
\r
// ... Rest of task code.\r
}\r
* automatically dynamically allocated inside the xSemaphoreCreateBinary()\r
* function. (see http://www.freertos.org/a00111.html). If a binary semaphore\r
* is created using xSemaphoreCreateBinaryStatic() then the application writer\r
- * can instead optionally provide the memory that will get used by the binary\r
- * semaphore. xSemaphoreCreateBinaryStatic() therefore allows a binary\r
- * semaphore to be created without using any dynamic memory allocation.\r
+ * must provide the memory. xSemaphoreCreateBinaryStatic() therefore allows a\r
+ * binary semaphore to be created without using any dynamic memory allocation.\r
*\r
* The old vSemaphoreCreateBinary() macro is now deprecated in favour of this\r
* xSemaphoreCreateBinary() function. Note that binary semaphores created using\r
* automatically dynamically allocated inside the xSemaphoreCreateBinary()\r
* function. (see http://www.freertos.org/a00111.html). If a binary semaphore\r
* is created using xSemaphoreCreateBinaryStatic() then the application writer\r
- * can instead optionally provide the memory that will get used by the binary\r
- * semaphore. xSemaphoreCreateBinaryStatic() therefore allows a binary\r
- * semaphore to be created without using any dynamic memory allocation.\r
+ * must provide the memory. xSemaphoreCreateBinaryStatic() therefore allows a\r
+ * binary semaphore to be created without using any dynamic memory allocation.\r
*\r
* This type of semaphore can be used for pure synchronisation between tasks or\r
* between an interrupt and a task. The semaphore need not be given back once\r
* semaphore does not use a priority inheritance mechanism. For an alternative\r
* that does use priority inheritance see xSemaphoreCreateMutex().\r
*\r
- * @param pxSemaphoreBuffer If pxSemaphoreBuffer is NULL then the memory\r
- * required to hold the semaphore's data structures will be allocated\r
- * dynamically, just as when a semaphore is created using\r
- * xSemaphoreCreateBinary(). If pxSemaphoreBuffer is not NULL then it must\r
- * point to a variable of type StaticSemaphore_t, which will then be used to\r
- * hold the semaphore's data structure, removing the need for the memory to be\r
- * allocated dynamically.\r
- *\r
- * @return If pxSemaphoreBuffer is not NULL then the function will not attempt\r
- * any dynamic memory allocation, and a handle to the created semaphore will\r
- * always be returned. If pxSemaphoreBuffer is NULL then the function will\r
- * attempt to dynamically allocate the memory required to hold the semaphore's\r
- * data structures. In this case, if the allocation succeeds then a handle to\r
- * the created semaphore will be returned, and if the allocation fails NULL will\r
- * be returned.\r
+ * @param pxSemaphoreBuffer Must point to a variable of type StaticSemaphore_t,\r
+ * which will then be used to hold the semaphore's data structure, removing the\r
+ * need for the memory to be allocated dynamically.\r
+ *\r
+ * @return If the semaphore is created then a handle to the created semaphore is\r
+ * returned. If pxSemaphoreBuffer is NULL then NULL is returned.\r
*\r
* Example usage:\r
<pre>\r
* using xSemaphoreCreateMutex() then the required memory is automatically\r
* dynamically allocated inside the xSemaphoreCreateMutex() function. (see\r
* http://www.freertos.org/a00111.html). If a mutex is created using\r
- * xSemaphoreCreateMutexStatic() then the application writer can instead\r
- * optionally provide the memory that will get used by the mutex.\r
- * xSemaphoreCreateMutexStatic() therefore allows a mutex to be created without\r
- * using any dynamic memory allocation.\r
+ * xSemaphoreCreateMutexStatic() then the application writer must provided the\r
+ * memory. xSemaphoreCreateMutexStatic() therefore allows a mutex to be created\r
+ * without using any dynamic memory allocation.\r
*\r
* Mutexes created using this function can be accessed using the xSemaphoreTake()\r
* and xSemaphoreGive() macros. The xSemaphoreTakeRecursive() and\r
* using xSemaphoreCreateMutex() then the required memory is automatically\r
* dynamically allocated inside the xSemaphoreCreateMutex() function. (see\r
* http://www.freertos.org/a00111.html). If a mutex is created using\r
- * xSemaphoreCreateMutexStatic() then the application writer can instead\r
- * optionally provide the memory that will get used by the mutex.\r
- * xSemaphoreCreateMutexStatic() therefore allows a mutex to be created without\r
- * using any dynamic memory allocation.\r
+ * xSemaphoreCreateMutexStatic() then the application writer must provided the\r
+ * memory. xSemaphoreCreateMutexStatic() therefore allows a mutex to be created\r
+ * without using any dynamic memory allocation.\r
*\r
* Mutexes created using this function can be accessed using the xSemaphoreTake()\r
* and xSemaphoreGive() macros. The xSemaphoreTakeRecursive() and\r
* semaphore and another always 'takes' the semaphore) and from within interrupt\r
* service routines.\r
*\r
- * @param pxMutexBuffer If pxMutexBuffer is NULL then the memory required to\r
- * hold the mutex's data structures will be allocated dynamically, just as when\r
- * a mutex is created using xSemaphoreCreateMutex(). If pxMutexBuffer is not\r
- * NULL then it must point to a variable of type StaticSemaphore_t, which will\r
- * then be used to hold the mutex's data structure, removing the need for\r
+ * @param pxMutexBuffer Must point to a variable of type StaticSemaphore_t,\r
+ * which will be used to hold the mutex's data structure, removing the need for\r
* the memory to be allocated dynamically.\r
*\r
* @return If the mutex was successfully created then a handle to the created\r
- * mutex is returned. If pxMutexBuffer was NULL, and there was not enough\r
- * heap to allocate the mutex data structures, then NULL is returned.\r
+ * mutex is returned. If pxMutexBuffer was NULL then NULL is returned.\r
*\r
* Example usage:\r
<pre>\r
* automatically dynamically allocated inside the\r
* xSemaphoreCreateRecursiveMutex() function. (see\r
* http://www.freertos.org/a00111.html). If a recursive mutex is created using\r
- * xSemaphoreCreateRecursiveMutexStatic() then the application writer can\r
- * instead optionally provide the memory that will get used by the mutex.\r
+ * xSemaphoreCreateRecursiveMutexStatic() then the application writer must\r
+ * provide the memory that will get used by the mutex.\r
* xSemaphoreCreateRecursiveMutexStatic() therefore allows a recursive mutex to\r
* be created without using any dynamic memory allocation.\r
*\r
* automatically dynamically allocated inside the\r
* xSemaphoreCreateRecursiveMutex() function. (see\r
* http://www.freertos.org/a00111.html). If a recursive mutex is created using\r
- * xSemaphoreCreateRecursiveMutexStatic() then the application writer can\r
- * instead optionally provide the memory that will get used by the mutex.\r
+ * xSemaphoreCreateRecursiveMutexStatic() then the application writer must\r
+ * provide the memory that will get used by the mutex.\r
* xSemaphoreCreateRecursiveMutexStatic() therefore allows a recursive mutex to\r
* be created without using any dynamic memory allocation.\r
*\r
* semaphore and another always 'takes' the semaphore) and from within interrupt\r
* service routines.\r
*\r
- * @param pxMutexBuffer If pxMutexBuffer is NULL then the memory required to\r
- * hold the recursive mutex's data structures will be allocated dynamically,\r
- * just as when a recursive mutex is created using\r
- * xSemaphoreCreateRecursiveMutex(). If pxMutexBuffer is not NULL then it must\r
- * point to a variable of type StaticSemaphore_t, which will then be used to\r
- * hold the recursive mutex's data structure, removing the need for the memory\r
- * to be allocated dynamically.\r
+ * @param pxMutexBuffer Must point to a variable of type StaticSemaphore_t,\r
+ * which will then be used to hold the recursive mutex's data structure,\r
+ * removing the need for the memory to be allocated dynamically.\r
*\r
* @return If the recursive mutex was successfully created then a handle to the\r
- * created recursive mutex is returned. If pxMutexBuffer was NULL, and there\r
- * was not enough heap to allocate the mutex data structures, then NULL is\r
+ * created recursive mutex is returned. If pxMutexBuffer was NULL then NULL is\r
* returned.\r
*\r
* Example usage:\r
* Creates a new counting semaphore instance, and returns a handle by which the\r
* new counting semaphore can be referenced.\r
*\r
+ * In many usage scenarios it is faster and more memory efficient to use a\r
+ * direct to task notification in place of a counting semaphore!\r
+ * http://www.freertos.org/RTOS-task-notifications.html\r
+ *\r
* Internally, within the FreeRTOS implementation, counting semaphores use a\r
* block of memory, in which the counting semaphore structure is stored. If a\r
* counting semaphore is created using xSemaphoreCreateCounting() then the\r
* Creates a new counting semaphore instance, and returns a handle by which the\r
* new counting semaphore can be referenced.\r
*\r
+ * In many usage scenarios it is faster and more memory efficient to use a\r
+ * direct to task notification in place of a counting semaphore!\r
+ * http://www.freertos.org/RTOS-task-notifications.html\r
+ *\r
* Internally, within the FreeRTOS implementation, counting semaphores use a\r
* block of memory, in which the counting semaphore structure is stored. If a\r
* counting semaphore is created using xSemaphoreCreateCounting() then the\r
* required memory is automatically dynamically allocated inside the\r
* xSemaphoreCreateCounting() function. (see\r
* http://www.freertos.org/a00111.html). If a counting semaphore is created\r
- * using xSemaphoreCreateCountingStatic() then the application writer can\r
- * instead optionally provide the memory that will get used by the counting\r
- * semaphore. xSemaphoreCreateCountingStatic() therefore allows a counting\r
- * semaphore to be created without using any dynamic memory allocation.\r
+ * using xSemaphoreCreateCountingStatic() then the application writer must\r
+ * provide the memory. xSemaphoreCreateCountingStatic() therefore allows a\r
+ * counting semaphore to be created without using any dynamic memory allocation.\r
*\r
* Counting semaphores are typically used for two things:\r
*\r
* @param uxInitialCount The count value assigned to the semaphore when it is\r
* created.\r
*\r
- * @param pxSemaphoreBuffer If pxSemaphoreBuffer is NULL then the memory\r
- * required to hold the semaphore's data structures will be allocated\r
- * dynamically, just as when a counting semaphore is created using\r
- * xSemaphoreCreateCounting(). If pxSemaphoreBuffer is not NULL then it must\r
- * point to a variable of type StaticSemaphore_t, which will then be used to\r
- * hold the semaphore's data structure, removing the need for the memory\r
- * to be allocated dynamically.\r
+ * @param pxSemaphoreBuffer Must point to a variable of type StaticSemaphore_t,\r
+ * which will then be used to hold the semaphore's data structure, removing the\r
+ * need for the memory to be allocated dynamically.\r
*\r
* @return If the counting semaphore was successfully created then a handle to\r
- * the created counting semaphore is returned. If pxSemaphoreBuffer was NULL,\r
- * and there was not enough heap to allocate the counting semaphore data\r
- * structures, then NULL is returned.\r
+ * the created counting semaphore is returned. If pxSemaphoreBuffer was NULL\r
+ * then NULL is returned.\r
*\r
* Example usage:\r
<pre>\r
*\r
* Create a new task and add it to the list of tasks that are ready to run.\r
*\r
- * Internally, within the FreeRTOS implementation, tasks's use two blocks of\r
- * memory. The first block is used to hold the tasks's data structures. The\r
+ * Internally, within the FreeRTOS implementation, tasks use two blocks of\r
+ * memory. The first block is used to hold the task's data structures. The\r
* second block is used by the task as its stack. If a task is created using\r
* xTaskCreate() then both blocks of memory are automatically dynamically\r
* allocated inside the xTaskCreate() function. (see\r
* http://www.freertos.org/a00111.html). If a task is created using\r
- * xTaskCreateStatic() then the application writer can instead optionally\r
- * provide the memory that will get used by the task. xTaskCreateStatic()\r
- * therefore allows a task to be created without using any dynamic memory\r
- * allocation.\r
+ * xTaskCreateStatic() then the application writer must provide the required\r
+ * memory. xTaskCreateStatic() therefore allows a task to be created without\r
+ * using any dynamic memory allocation.\r
*\r
* See xTaskCreateStatic() for a version that does not use any dynamic memory\r
* allocation.\r
*\r
* Create a new task and add it to the list of tasks that are ready to run.\r
*\r
- * Internally, within the FreeRTOS implementation, tasks's use two blocks of\r
- * memory. The first block is used to hold the tasks's data structures. The\r
+ * Internally, within the FreeRTOS implementation, tasks use two blocks of\r
+ * memory. The first block is used to hold the task's data structures. The\r
* second block is used by the task as its stack. If a task is created using\r
* xTaskCreate() then both blocks of memory are automatically dynamically\r
* allocated inside the xTaskCreate() function. (see\r
* http://www.freertos.org/a00111.html). If a task is created using\r
- * xTaskCreateStatic() then the application writer can instead optionally\r
- * provide the memory that will get used by the task. xTaskCreateStatic()\r
- * therefore allows a task to be created without using any dynamic memory\r
- * allocation.\r
+ * xTaskCreateStatic() then the application writer must provide the required\r
+ * memory. xTaskCreateStatic() therefore allows a task to be created without\r
+ * using any dynamic memory allocation.\r
*\r
* @param pvTaskCode Pointer to the task entry function. Tasks\r
* must be implemented to never return (i.e. continuous loop).\r
* @param pvCreatedTask Used to pass back a handle by which the created task\r
* can be referenced. Pass as NULL if the handle is not required.\r
*\r
- * @param pxStackBuffer If pxStackBuffer is NULL then the stack used by the\r
- * task will be allocated dynamically, just as if the task was created using\r
- * xTaskCreate(). If pxStackBuffer is not NULL then it must point to a\r
- * StackType_t array that has at least usStackDepth indexes - the array will\r
- * then be used as the task's stack, removing the need for the stack to be\r
- * allocated dynamically.\r
- *\r
- * @param pxTaskBuffer If pxTaskBuffer is NULL then the memory used to hold the\r
- * task's data structures will be allocated dynamically, just as when a task is\r
- * created using xTaskCreate(). If pxTaskBuffer is not NULL then it must point\r
- * to a variable of type StaticTask_t, which will then be used to hold the\r
- * task's data structures, removing the need for the memory to be allocated\r
- * dynamically.\r
- *\r
- * @return If neither pxStackBuffer or pxTaskBuffer are NULL, then the function\r
- * will not attempt any dynamic memory allocation, and pdPASS will always be\r
- * returned. If pxStackBuffer or pxTaskBuffer is NULL then the function will\r
- * attempt to dynamically allocate one of both buffers. In this case, if the\r
- * allocation succeeds then pdPASS will be returned, and if the allocation fails\r
- * then an error code defined in projdefs.h is returned.\r
+ * @param pxStackBuffer Must point to a StackType_t array that has at least\r
+ * usStackDepth indexes - the array will then be used as the task's stack,\r
+ * removing the need for the stack to be allocated dynamically.\r
+ *\r
+ * @param pxTaskBuffer Must point to a variable of type StaticTask_t, which will\r
+ * then be used to hold the task's data structures, removing the need for the\r
+ * memory to be allocated dynamically.\r
+ *\r
+ * @return If neither pxStackBuffer or pxTaskBuffer are NULL, then the task will\r
+ * be created and pdPASS is returned. If either pxStackBuffer or pxTaskBuffer\r
+ * are NULL then the task will not be created and \r
+ * errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY is returned.\r
*\r
* Example usage:\r
<pre>\r
* Creates a new software timer instance, and returns a handle by which the\r
* created software timer can be referenced.\r
*\r
- * Internally, within the FreeRTOS implementation, software timer's use a block\r
+ * Internally, within the FreeRTOS implementation, software timers use a block\r
* of memory, in which the timer data structure is stored. If a software timer\r
* is created using xTimerCreate() then the required memory is automatically\r
* dynamically allocated inside the xTimerCreate() function. (see\r
* http://www.freertos.org/a00111.html). If a software timer is created using\r
- * xTimerCreateStatic() then the application writer can instead optionally\r
- * provide the memory that will get used by the software timer.\r
- * xTimerCreateStatic() therefore allows a software timer to be created without\r
- * using any dynamic memory allocation.\r
+ * xTimerCreateStatic() then the application writer must provide the memory that\r
+ * will get used by the software timer. xTimerCreateStatic() therefore allows a\r
+ * software timer to be created without using any dynamic memory allocation.\r
*\r
* Timers are created in the dormant state. The xTimerStart(), xTimerReset(),\r
* xTimerStartFromISR(), xTimerResetFromISR(), xTimerChangePeriod() and\r
* Creates a new software timer instance, and returns a handle by which the\r
* created software timer can be referenced.\r
*\r
- * Internally, within the FreeRTOS implementation, software timer's use a block\r
+ * Internally, within the FreeRTOS implementation, software timers use a block\r
* of memory, in which the timer data structure is stored. If a software timer\r
* is created using xTimerCreate() then the required memory is automatically\r
* dynamically allocated inside the xTimerCreate() function. (see\r
* http://www.freertos.org/a00111.html). If a software timer is created using\r
- * xTimerCreateStatic() then the application writer can instead optionally\r
- * provide the memory that will get used by the software timer.\r
- * xTimerCreateStatic() therefore allows a software to be created without using\r
- * any dynamic memory allocation.\r
+ * xTimerCreateStatic() then the application writer must provide the memory that\r
+ * will get used by the software timer. xTimerCreateStatic() therefore allows a\r
+ * software timer to be created without using any dynamic memory allocation.\r
*\r
* Timers are created in the dormant state. The xTimerStart(), xTimerReset(),\r
* xTimerStartFromISR(), xTimerResetFromISR(), xTimerChangePeriod() and\r
* Callback functions must have the prototype defined by TimerCallbackFunction_t,\r
* which is "void vCallbackFunction( TimerHandle_t xTimer );".\r
*\r
- * @param pxTimerBuffer If pxTimerBuffer is NULL then the memory required to\r
- * hold the software timer's data structure will be allocated dynamically, just\r
- * as when a software timer is created using xTimerCreate(). If pxTimerBuffer\r
- * is not NULL then it must point to a variable of type StaticTimer_t, which\r
+ * @param pxTimerBuffer Must point to a variable of type StaticTimer_t, which\r
* will be then be used to hold the software timer's data structures, removing\r
* the need for the memory to be allocated dynamically.\r
*\r
- * @return If pxTimerBuffer is not NULL then the function will not attempt\r
- * any dynamic memory allocation, and a handle to the created timer will always\r
- * be returned. If pxTimerBuffer is NULL then the function will attempt to\r
- * dynamically allocate the memory required to hold the timer's data structures.\r
- * In this case, if the allocation succeeds then a handle to the created timer\r
- * will be returned, and if the allocation fails NULL will be returned.\r
+ * @return If the timer is created then a handle to the created timer is\r
+ * returned. If pxTimerBuffer was NULL then NULL is returned.\r
*\r
* Example usage:\r
* @verbatim\r
xThreadState *pxThreadState = NULL;\r
int8_t *pcTopOfStack = ( int8_t * ) pxTopOfStack;\r
\r
+ #ifdef portSOAK_TEST\r
+ {\r
+ /* Ensure highest priority class is inherited. */\r
+ if( !SetPriorityClass( GetCurrentProcess(), REALTIME_PRIORITY_CLASS ) )\r
+ {\r
+ printf( "SetPriorityClass() failed\r\n" );\r
+ }\r
+ }\r
+ #endif\r
+\r
/* In this simulated case a stack is not initialised, but instead a thread\r
is created that will execute the task being created. The thread handles\r
the context switching itself. The xThreadState object is placed onto\r
#ifndef PORTMACRO_H\r
#define PORTMACRO_H\r
\r
+#include <Windows.h>\r
\r
/******************************************************************************\r
Defines\r