mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-21 22:11:57 -04:00
Update the documentation contained in the header files to be correct for V9.0.0 release candidate 2.
This commit is contained in:
parent
6568ba6eb0
commit
9dda62372c
|
@ -132,15 +132,15 @@ static BaseType_t prvTestWaitCondition( const EventBits_t uxCurrentEventBits, co
|
||||||
|
|
||||||
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
|
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||||
|
|
||||||
EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t *pxStaticEventGroup )
|
EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t *pxEventGroupBuffer )
|
||||||
{
|
{
|
||||||
EventGroup_t *pxEventBits;
|
EventGroup_t *pxEventBits;
|
||||||
|
|
||||||
/* A StaticEventGroup_t object must be provided. */
|
/* A StaticEventGroup_t object must be provided. */
|
||||||
configASSERT( pxStaticEventGroup );
|
configASSERT( pxEventGroupBuffer );
|
||||||
|
|
||||||
/* The user has provided a statically allocated event group - use it. */
|
/* The user has provided a statically allocated event group - use it. */
|
||||||
pxEventBits = ( EventGroup_t * ) pxStaticEventGroup; /*lint !e740 EventGroup_t and StaticEventGroup_t are guaranteed to have the same size and alignment requirement - checked by configASSERT(). */
|
pxEventBits = ( EventGroup_t * ) pxEventGroupBuffer; /*lint !e740 EventGroup_t and StaticEventGroup_t are guaranteed to have the same size and alignment requirement - checked by configASSERT(). */
|
||||||
|
|
||||||
if( pxEventBits != NULL )
|
if( pxEventBits != NULL )
|
||||||
{
|
{
|
||||||
|
|
|
@ -944,7 +944,7 @@ typedef struct xSTATIC_TCB
|
||||||
uint32_t ulDummy18;
|
uint32_t ulDummy18;
|
||||||
uint8_t ucDummy19;
|
uint8_t ucDummy19;
|
||||||
#endif
|
#endif
|
||||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
#if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
|
||||||
uint8_t uxDummy20;
|
uint8_t uxDummy20;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -978,7 +978,7 @@ typedef struct xSTATIC_QUEUE
|
||||||
UBaseType_t uxDummy4[ 3 ];
|
UBaseType_t uxDummy4[ 3 ];
|
||||||
uint8_t ucDummy5[ 2 ];
|
uint8_t ucDummy5[ 2 ];
|
||||||
|
|
||||||
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
|
#if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
|
||||||
uint8_t ucDummy6;
|
uint8_t ucDummy6;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1017,8 +1017,8 @@ typedef struct xSTATIC_EVENT_GROUP
|
||||||
UBaseType_t uxDummy3;
|
UBaseType_t uxDummy3;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
|
#if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
|
||||||
uint8_t ucStaticallyAllocated;
|
uint8_t ucDummy4;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} StaticEventGroup_t;
|
} StaticEventGroup_t;
|
||||||
|
@ -1048,8 +1048,8 @@ typedef struct xSTATIC_TIMER
|
||||||
UBaseType_t uxDummy6;
|
UBaseType_t uxDummy6;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
|
#if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
|
||||||
uint8_t ucStaticallyAllocated;
|
uint8_t ucDummy7;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} StaticTimer_t;
|
} StaticTimer_t;
|
||||||
|
|
|
@ -138,7 +138,17 @@ typedef TickType_t EventBits_t;
|
||||||
EventGroupHandle_t xEventGroupCreate( void );
|
EventGroupHandle_t xEventGroupCreate( void );
|
||||||
</pre>
|
</pre>
|
||||||
*
|
*
|
||||||
* Create a new event group. This function cannot be called from an interrupt.
|
* Create a new event group.
|
||||||
|
*
|
||||||
|
* Internally, within the FreeRTOS implementation, event groups use a [small]
|
||||||
|
* block of memory, in which the event group's structure is stored. If an event
|
||||||
|
* groups is created using xEventGropuCreate() then the required memory is
|
||||||
|
* automatically dynamically allocated inside the xEventGroupCreate() function.
|
||||||
|
* (see http://www.freertos.org/a00111.html). If an event group is created
|
||||||
|
* using xEventGropuCreateStatic() then the application writer must instead
|
||||||
|
* provide the memory that will get used by the event group.
|
||||||
|
* xEventGroupCreateStatic() therefore allows an event group to be created
|
||||||
|
* without using any dynamic memory allocation.
|
||||||
*
|
*
|
||||||
* Although event groups are not related to ticks, for internal implementation
|
* Although event groups are not related to ticks, for internal implementation
|
||||||
* reasons the number of bits available for use in an event group is dependent
|
* reasons the number of bits available for use in an event group is dependent
|
||||||
|
@ -178,8 +188,57 @@ typedef TickType_t EventBits_t;
|
||||||
EventGroupHandle_t xEventGroupCreate( void ) PRIVILEGED_FUNCTION;
|
EventGroupHandle_t xEventGroupCreate( void ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* event_groups.h
|
||||||
|
*<pre>
|
||||||
|
EventGroupHandle_t xEventGroupCreateStatic( EventGroupHandle_t * pxEventGroupBuffer );
|
||||||
|
</pre>
|
||||||
|
*
|
||||||
|
* Create a new event group.
|
||||||
|
*
|
||||||
|
* Internally, within the FreeRTOS implementation, event groups use a [small]
|
||||||
|
* block of memory, in which the event group's structure is stored. If an event
|
||||||
|
* groups is created using xEventGropuCreate() then the required memory is
|
||||||
|
* automatically dynamically allocated inside the xEventGroupCreate() function.
|
||||||
|
* (see http://www.freertos.org/a00111.html). If an event group is created
|
||||||
|
* using xEventGropuCreateStatic() then the application writer must instead
|
||||||
|
* provide the memory that will get used by the event group.
|
||||||
|
* xEventGroupCreateStatic() therefore allows an event group to be created
|
||||||
|
* without using any dynamic memory allocation.
|
||||||
|
*
|
||||||
|
* Although event groups are not related to ticks, for internal implementation
|
||||||
|
* reasons the number of bits available for use in an event group is dependent
|
||||||
|
* on the configUSE_16_BIT_TICKS setting in FreeRTOSConfig.h. If
|
||||||
|
* configUSE_16_BIT_TICKS is 1 then each event group contains 8 usable bits (bit
|
||||||
|
* 0 to bit 7). If configUSE_16_BIT_TICKS is set to 0 then each event group has
|
||||||
|
* 24 usable bits (bit 0 to bit 23). The EventBits_t type is used to store
|
||||||
|
* event bits within an event group.
|
||||||
|
*
|
||||||
|
* @param pxEventGroupBuffer pxEventGroupBuffer must point to a variable of type
|
||||||
|
* StaticEventGroup_t, which will be then be used to hold the event group's data
|
||||||
|
* structures, removing the need for the memory to be allocated dynamically.
|
||||||
|
*
|
||||||
|
* @return If the event group was created then a handle to the event group is
|
||||||
|
* returned. If pxEventGroupBuffer was NULL then NULL is returned.
|
||||||
|
*
|
||||||
|
* Example usage:
|
||||||
|
<pre>
|
||||||
|
// StaticEventGroup_t is a publicly accessible structure that has the same
|
||||||
|
// size and alignment requirements as the real event group structure. It is
|
||||||
|
// provided as a mechanism for applications to know the size of the event
|
||||||
|
// group (which is dependent on the architecture and configuration file
|
||||||
|
// settings) without breaking the strict data hiding policy by exposing the
|
||||||
|
// real event group internals. This StaticEventGroup_t variable is passed
|
||||||
|
// into the xSemaphoreCreateEventGroupStatic() function and is used to store
|
||||||
|
// the event group's data structures
|
||||||
|
StaticEventGroup_t xEventGroupBuffer;
|
||||||
|
|
||||||
|
// Create the event group without dynamically allocating any memory.
|
||||||
|
xEventGroup = xEventGroupCreateStatic( &xEventGroupBuffer );
|
||||||
|
</pre>
|
||||||
|
*/
|
||||||
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
|
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||||
EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t *pxStaticEventGroup ) PRIVILEGED_FUNCTION;
|
EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t *pxEventGroupBuffer ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -126,16 +126,17 @@ typedef void * QueueSetMemberHandle_t;
|
||||||
* Creates a new queue instance, and returns a handle by which the new queue
|
* Creates a new queue instance, and returns a handle by which the new queue
|
||||||
* can be referenced.
|
* can be referenced.
|
||||||
*
|
*
|
||||||
* Internally, within the FreeRTOS implementation, queue's use two blocks of
|
* Internally, within the FreeRTOS implementation, queues use two blocks of
|
||||||
* memory. The first block is used to hold the queue's data structures. The
|
* memory. The first block is used to hold the queue's data structures. The
|
||||||
* second block is used to hold items placed into the queue. If a queue is
|
* second block is used to hold items placed into the queue. If a queue is
|
||||||
* created using xQueueCreate() then both blocks of memory are automatically
|
* created using xQueueCreate() then both blocks of memory are automatically
|
||||||
* dynamically allocated inside the xQueueCreate() function. (see
|
* dynamically allocated inside the xQueueCreate() function. (see
|
||||||
* http://www.freertos.org/a00111.html). If a queue is created using
|
* http://www.freertos.org/a00111.html). If a queue is created using
|
||||||
* xQueueCreateStatic() then the application writer can instead optionally
|
* xQueueCreateStatic() then the application writer must provide the memory that
|
||||||
* provide the memory that will get used by the queue. xQueueCreateStatic()
|
* will get used by the queue. xQueueCreateStatic() therefore allows a queue to
|
||||||
* therefore allows a queue to be created without using any dynamic memory
|
* be created without using any dynamic memory allocation.
|
||||||
* allocation.
|
*
|
||||||
|
* http://www.FreeRTOS.org/Embedded-RTOS-Queues.html
|
||||||
*
|
*
|
||||||
* @param uxQueueLength The maximum number of items that the queue can contain.
|
* @param uxQueueLength The maximum number of items that the queue can contain.
|
||||||
*
|
*
|
||||||
|
@ -199,16 +200,17 @@ typedef void * QueueSetMemberHandle_t;
|
||||||
* Creates a new queue instance, and returns a handle by which the new queue
|
* Creates a new queue instance, and returns a handle by which the new queue
|
||||||
* can be referenced.
|
* can be referenced.
|
||||||
*
|
*
|
||||||
* Internally, within the FreeRTOS implementation, queue's use two blocks of
|
* Internally, within the FreeRTOS implementation, queues use two blocks of
|
||||||
* memory. The first block is used to hold the queue's data structures. The
|
* memory. The first block is used to hold the queue's data structures. The
|
||||||
* second block is used to hold items placed into the queue. If a queue is
|
* second block is used to hold items placed into the queue. If a queue is
|
||||||
* created using xQueueCreate() then both blocks of memory are automatically
|
* created using xQueueCreate() then both blocks of memory are automatically
|
||||||
* dynamically allocated inside the xQueueCreate() function. (see
|
* dynamically allocated inside the xQueueCreate() function. (see
|
||||||
* http://www.freertos.org/a00111.html). If a queue is created using
|
* http://www.freertos.org/a00111.html). If a queue is created using
|
||||||
* xQueueCreateStatic() then the application writer can instead optionally
|
* xQueueCreateStatic() then the application writer must provide the memory that
|
||||||
* provide the memory that will get used by the queue. xQueueCreateStatic()
|
* will get used by the queue. xQueueCreateStatic() therefore allows a queue to
|
||||||
* therefore allows a queue to be created without using any dynamic memory
|
* be created without using any dynamic memory allocation.
|
||||||
* allocation.
|
*
|
||||||
|
* http://www.FreeRTOS.org/Embedded-RTOS-Queues.html
|
||||||
*
|
*
|
||||||
* @param uxQueueLength The maximum number of items that the queue can contain.
|
* @param uxQueueLength The maximum number of items that the queue can contain.
|
||||||
*
|
*
|
||||||
|
@ -217,27 +219,17 @@ typedef void * QueueSetMemberHandle_t;
|
||||||
* that will be copied for each posted item. Each item on the queue must be
|
* that will be copied for each posted item. Each item on the queue must be
|
||||||
* the same size.
|
* the same size.
|
||||||
*
|
*
|
||||||
* @param pucQueueStorageBuffer If pucQueueStorageBuffer is NULL then the memory
|
* @param pucQueueStorageBuffer If uxItemSize is not zero then
|
||||||
* used to hold items stored in the queue will be allocated dynamically, just as
|
* pucQueueStorageBuffer must point to a uint8_t array that is at least large
|
||||||
* when a queue is created using xQueueCreate(). If pxQueueStorageBuffer is not
|
* enough to hold the maximum number of items that can be in the queue at any
|
||||||
* NULL then it must point to a uint8_t array that is at least large enough to
|
* one time - which is ( uxQueueLength * uxItemsSize ) bytes. If uxItemSize is
|
||||||
* hold the maximum number of items that can be in the queue at any one time -
|
* zero then pucQueueStorageBuffer can be NULL.
|
||||||
* which is ( uxQueueLength * uxItemsSize ) bytes.
|
|
||||||
*
|
*
|
||||||
* @param pxQueueBuffer If pxQueueBuffer is NULL then the memory required to
|
* @param pxQueueBuffer Must point to a variable of type StaticQueue_t, which
|
||||||
* hold the queue's data structures will be allocated dynamically, just as when
|
* will be used to hold the queue's data structure.
|
||||||
* a queue is created using xQueueCreate(). If pxQueueBuffer is not NULL then
|
|
||||||
* it must point to a variable of type StaticQueue_t, which will then be used to
|
|
||||||
* hold the queue's data structure, removing the need for the memory to be
|
|
||||||
* allocated dynamically.
|
|
||||||
*
|
*
|
||||||
* @return If neither pucQueueStorageBuffer or pxQueueBuffer are NULL, then the
|
* @return If the queue is created then a handle to the created queue is
|
||||||
* function will not attempt any dynamic memory allocation, and a handle to the
|
* returned. If pxQueueBuffer is NULL then NULL is returned.
|
||||||
* created queue will always be returned. If pucQueueStorageBuffer or
|
|
||||||
* pxQueueBuffer is NULL then the function will attempt to dynamically allocate
|
|
||||||
* one of both buffers. In this case, if the allocation succeeds then a handle
|
|
||||||
* to the created queue will be returned, and if one of the the allocation fails
|
|
||||||
* NULL will be returned.
|
|
||||||
*
|
*
|
||||||
* Example usage:
|
* Example usage:
|
||||||
<pre>
|
<pre>
|
||||||
|
@ -268,7 +260,7 @@ typedef void * QueueSetMemberHandle_t;
|
||||||
&xQueueBuffer ); // The buffer that will hold the queue structure.
|
&xQueueBuffer ); // The buffer that will hold the queue structure.
|
||||||
|
|
||||||
// The queue is guaranteed to be created successfully as no dynamic memory
|
// The queue is guaranteed to be created successfully as no dynamic memory
|
||||||
// allocation was used. Therefore xQueue1 is now a handle to a valid queue.
|
// allocation is used. Therefore xQueue1 is now a handle to a valid queue.
|
||||||
|
|
||||||
// ... Rest of task code.
|
// ... Rest of task code.
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,9 +160,8 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
* automatically dynamically allocated inside the xSemaphoreCreateBinary()
|
* automatically dynamically allocated inside the xSemaphoreCreateBinary()
|
||||||
* function. (see http://www.freertos.org/a00111.html). If a binary semaphore
|
* function. (see http://www.freertos.org/a00111.html). If a binary semaphore
|
||||||
* is created using xSemaphoreCreateBinaryStatic() then the application writer
|
* is created using xSemaphoreCreateBinaryStatic() then the application writer
|
||||||
* can instead optionally provide the memory that will get used by the binary
|
* must provide the memory. xSemaphoreCreateBinaryStatic() therefore allows a
|
||||||
* semaphore. xSemaphoreCreateBinaryStatic() therefore allows a binary
|
* binary semaphore to be created without using any dynamic memory allocation.
|
||||||
* semaphore to be created without using any dynamic memory allocation.
|
|
||||||
*
|
*
|
||||||
* The old vSemaphoreCreateBinary() macro is now deprecated in favour of this
|
* The old vSemaphoreCreateBinary() macro is now deprecated in favour of this
|
||||||
* xSemaphoreCreateBinary() function. Note that binary semaphores created using
|
* xSemaphoreCreateBinary() function. Note that binary semaphores created using
|
||||||
|
@ -222,9 +221,8 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
* automatically dynamically allocated inside the xSemaphoreCreateBinary()
|
* automatically dynamically allocated inside the xSemaphoreCreateBinary()
|
||||||
* function. (see http://www.freertos.org/a00111.html). If a binary semaphore
|
* function. (see http://www.freertos.org/a00111.html). If a binary semaphore
|
||||||
* is created using xSemaphoreCreateBinaryStatic() then the application writer
|
* is created using xSemaphoreCreateBinaryStatic() then the application writer
|
||||||
* can instead optionally provide the memory that will get used by the binary
|
* must provide the memory. xSemaphoreCreateBinaryStatic() therefore allows a
|
||||||
* semaphore. xSemaphoreCreateBinaryStatic() therefore allows a binary
|
* binary semaphore to be created without using any dynamic memory allocation.
|
||||||
* semaphore to be created without using any dynamic memory allocation.
|
|
||||||
*
|
*
|
||||||
* This type of semaphore can be used for pure synchronisation between tasks or
|
* This type of semaphore can be used for pure synchronisation between tasks or
|
||||||
* between an interrupt and a task. The semaphore need not be given back once
|
* between an interrupt and a task. The semaphore need not be given back once
|
||||||
|
@ -233,21 +231,12 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
* semaphore does not use a priority inheritance mechanism. For an alternative
|
* semaphore does not use a priority inheritance mechanism. For an alternative
|
||||||
* that does use priority inheritance see xSemaphoreCreateMutex().
|
* that does use priority inheritance see xSemaphoreCreateMutex().
|
||||||
*
|
*
|
||||||
* @param pxSemaphoreBuffer If pxSemaphoreBuffer is NULL then the memory
|
* @param pxSemaphoreBuffer Must point to a variable of type StaticSemaphore_t,
|
||||||
* required to hold the semaphore's data structures will be allocated
|
* which will then be used to hold the semaphore's data structure, removing the
|
||||||
* dynamically, just as when a semaphore is created using
|
* need for the memory to be allocated dynamically.
|
||||||
* xSemaphoreCreateBinary(). If pxSemaphoreBuffer is not NULL then it must
|
|
||||||
* point to a variable of type StaticSemaphore_t, which will then be used to
|
|
||||||
* hold the semaphore's data structure, removing the need for the memory to be
|
|
||||||
* allocated dynamically.
|
|
||||||
*
|
*
|
||||||
* @return If pxSemaphoreBuffer is not NULL then the function will not attempt
|
* @return If the semaphore is created then a handle to the created semaphore is
|
||||||
* any dynamic memory allocation, and a handle to the created semaphore will
|
* returned. If pxSemaphoreBuffer is NULL then NULL is returned.
|
||||||
* always be returned. If pxSemaphoreBuffer is NULL then the function will
|
|
||||||
* attempt to dynamically allocate the memory required to hold the semaphore's
|
|
||||||
* data structures. In this case, if the allocation succeeds then a handle to
|
|
||||||
* the created semaphore will be returned, and if the allocation fails NULL will
|
|
||||||
* be returned.
|
|
||||||
*
|
*
|
||||||
* Example usage:
|
* Example usage:
|
||||||
<pre>
|
<pre>
|
||||||
|
@ -718,10 +707,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
* using xSemaphoreCreateMutex() then the required memory is automatically
|
* using xSemaphoreCreateMutex() then the required memory is automatically
|
||||||
* dynamically allocated inside the xSemaphoreCreateMutex() function. (see
|
* dynamically allocated inside the xSemaphoreCreateMutex() function. (see
|
||||||
* http://www.freertos.org/a00111.html). If a mutex is created using
|
* http://www.freertos.org/a00111.html). If a mutex is created using
|
||||||
* xSemaphoreCreateMutexStatic() then the application writer can instead
|
* xSemaphoreCreateMutexStatic() then the application writer must provided the
|
||||||
* optionally provide the memory that will get used by the mutex.
|
* memory. xSemaphoreCreateMutexStatic() therefore allows a mutex to be created
|
||||||
* xSemaphoreCreateMutexStatic() therefore allows a mutex to be created without
|
* without using any dynamic memory allocation.
|
||||||
* using any dynamic memory allocation.
|
|
||||||
*
|
*
|
||||||
* Mutexes created using this function can be accessed using the xSemaphoreTake()
|
* Mutexes created using this function can be accessed using the xSemaphoreTake()
|
||||||
* and xSemaphoreGive() macros. The xSemaphoreTakeRecursive() and
|
* and xSemaphoreGive() macros. The xSemaphoreTakeRecursive() and
|
||||||
|
@ -778,10 +766,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
* using xSemaphoreCreateMutex() then the required memory is automatically
|
* using xSemaphoreCreateMutex() then the required memory is automatically
|
||||||
* dynamically allocated inside the xSemaphoreCreateMutex() function. (see
|
* dynamically allocated inside the xSemaphoreCreateMutex() function. (see
|
||||||
* http://www.freertos.org/a00111.html). If a mutex is created using
|
* http://www.freertos.org/a00111.html). If a mutex is created using
|
||||||
* xSemaphoreCreateMutexStatic() then the application writer can instead
|
* xSemaphoreCreateMutexStatic() then the application writer must provided the
|
||||||
* optionally provide the memory that will get used by the mutex.
|
* memory. xSemaphoreCreateMutexStatic() therefore allows a mutex to be created
|
||||||
* xSemaphoreCreateMutexStatic() therefore allows a mutex to be created without
|
* without using any dynamic memory allocation.
|
||||||
* using any dynamic memory allocation.
|
|
||||||
*
|
*
|
||||||
* Mutexes created using this function can be accessed using the xSemaphoreTake()
|
* Mutexes created using this function can be accessed using the xSemaphoreTake()
|
||||||
* and xSemaphoreGive() macros. The xSemaphoreTakeRecursive() and
|
* and xSemaphoreGive() macros. The xSemaphoreTakeRecursive() and
|
||||||
|
@ -798,16 +785,12 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
* semaphore and another always 'takes' the semaphore) and from within interrupt
|
* semaphore and another always 'takes' the semaphore) and from within interrupt
|
||||||
* service routines.
|
* service routines.
|
||||||
*
|
*
|
||||||
* @param pxMutexBuffer If pxMutexBuffer is NULL then the memory required to
|
* @param pxMutexBuffer Must point to a variable of type StaticSemaphore_t,
|
||||||
* hold the mutex's data structures will be allocated dynamically, just as when
|
* which will be used to hold the mutex's data structure, removing the need for
|
||||||
* a mutex is created using xSemaphoreCreateMutex(). If pxMutexBuffer is not
|
|
||||||
* NULL then it must point to a variable of type StaticSemaphore_t, which will
|
|
||||||
* then be used to hold the mutex's data structure, removing the need for
|
|
||||||
* the memory to be allocated dynamically.
|
* the memory to be allocated dynamically.
|
||||||
*
|
*
|
||||||
* @return If the mutex was successfully created then a handle to the created
|
* @return If the mutex was successfully created then a handle to the created
|
||||||
* mutex is returned. If pxMutexBuffer was NULL, and there was not enough
|
* mutex is returned. If pxMutexBuffer was NULL then NULL is returned.
|
||||||
* heap to allocate the mutex data structures, then NULL is returned.
|
|
||||||
*
|
*
|
||||||
* Example usage:
|
* Example usage:
|
||||||
<pre>
|
<pre>
|
||||||
|
@ -846,8 +829,8 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
* automatically dynamically allocated inside the
|
* automatically dynamically allocated inside the
|
||||||
* xSemaphoreCreateRecursiveMutex() function. (see
|
* xSemaphoreCreateRecursiveMutex() function. (see
|
||||||
* http://www.freertos.org/a00111.html). If a recursive mutex is created using
|
* http://www.freertos.org/a00111.html). If a recursive mutex is created using
|
||||||
* xSemaphoreCreateRecursiveMutexStatic() then the application writer can
|
* xSemaphoreCreateRecursiveMutexStatic() then the application writer must
|
||||||
* instead optionally provide the memory that will get used by the mutex.
|
* provide the memory that will get used by the mutex.
|
||||||
* xSemaphoreCreateRecursiveMutexStatic() therefore allows a recursive mutex to
|
* xSemaphoreCreateRecursiveMutexStatic() therefore allows a recursive mutex to
|
||||||
* be created without using any dynamic memory allocation.
|
* be created without using any dynamic memory allocation.
|
||||||
*
|
*
|
||||||
|
@ -913,8 +896,8 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
* automatically dynamically allocated inside the
|
* automatically dynamically allocated inside the
|
||||||
* xSemaphoreCreateRecursiveMutex() function. (see
|
* xSemaphoreCreateRecursiveMutex() function. (see
|
||||||
* http://www.freertos.org/a00111.html). If a recursive mutex is created using
|
* http://www.freertos.org/a00111.html). If a recursive mutex is created using
|
||||||
* xSemaphoreCreateRecursiveMutexStatic() then the application writer can
|
* xSemaphoreCreateRecursiveMutexStatic() then the application writer must
|
||||||
* instead optionally provide the memory that will get used by the mutex.
|
* provide the memory that will get used by the mutex.
|
||||||
* xSemaphoreCreateRecursiveMutexStatic() therefore allows a recursive mutex to
|
* xSemaphoreCreateRecursiveMutexStatic() therefore allows a recursive mutex to
|
||||||
* be created without using any dynamic memory allocation.
|
* be created without using any dynamic memory allocation.
|
||||||
*
|
*
|
||||||
|
@ -940,17 +923,12 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
* semaphore and another always 'takes' the semaphore) and from within interrupt
|
* semaphore and another always 'takes' the semaphore) and from within interrupt
|
||||||
* service routines.
|
* service routines.
|
||||||
*
|
*
|
||||||
* @param pxMutexBuffer If pxMutexBuffer is NULL then the memory required to
|
* @param pxMutexBuffer Must point to a variable of type StaticSemaphore_t,
|
||||||
* hold the recursive mutex's data structures will be allocated dynamically,
|
* which will then be used to hold the recursive mutex's data structure,
|
||||||
* just as when a recursive mutex is created using
|
* removing the need for the memory to be allocated dynamically.
|
||||||
* xSemaphoreCreateRecursiveMutex(). If pxMutexBuffer is not NULL then it must
|
|
||||||
* point to a variable of type StaticSemaphore_t, which will then be used to
|
|
||||||
* hold the recursive mutex's data structure, removing the need for the memory
|
|
||||||
* to be allocated dynamically.
|
|
||||||
*
|
*
|
||||||
* @return If the recursive mutex was successfully created then a handle to the
|
* @return If the recursive mutex was successfully created then a handle to the
|
||||||
* created recursive mutex is returned. If pxMutexBuffer was NULL, and there
|
* created recursive mutex is returned. If pxMutexBuffer was NULL then NULL is
|
||||||
* was not enough heap to allocate the mutex data structures, then NULL is
|
|
||||||
* returned.
|
* returned.
|
||||||
*
|
*
|
||||||
* Example usage:
|
* Example usage:
|
||||||
|
@ -985,6 +963,10 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
* Creates a new counting semaphore instance, and returns a handle by which the
|
* Creates a new counting semaphore instance, and returns a handle by which the
|
||||||
* new counting semaphore can be referenced.
|
* new counting semaphore can be referenced.
|
||||||
*
|
*
|
||||||
|
* In many usage scenarios it is faster and more memory efficient to use a
|
||||||
|
* direct to task notification in place of a counting semaphore!
|
||||||
|
* http://www.freertos.org/RTOS-task-notifications.html
|
||||||
|
*
|
||||||
* Internally, within the FreeRTOS implementation, counting semaphores use a
|
* Internally, within the FreeRTOS implementation, counting semaphores use a
|
||||||
* block of memory, in which the counting semaphore structure is stored. If a
|
* block of memory, in which the counting semaphore structure is stored. If a
|
||||||
* counting semaphore is created using xSemaphoreCreateCounting() then the
|
* counting semaphore is created using xSemaphoreCreateCounting() then the
|
||||||
|
@ -1061,16 +1043,19 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
* Creates a new counting semaphore instance, and returns a handle by which the
|
* Creates a new counting semaphore instance, and returns a handle by which the
|
||||||
* new counting semaphore can be referenced.
|
* new counting semaphore can be referenced.
|
||||||
*
|
*
|
||||||
|
* In many usage scenarios it is faster and more memory efficient to use a
|
||||||
|
* direct to task notification in place of a counting semaphore!
|
||||||
|
* http://www.freertos.org/RTOS-task-notifications.html
|
||||||
|
*
|
||||||
* Internally, within the FreeRTOS implementation, counting semaphores use a
|
* Internally, within the FreeRTOS implementation, counting semaphores use a
|
||||||
* block of memory, in which the counting semaphore structure is stored. If a
|
* block of memory, in which the counting semaphore structure is stored. If a
|
||||||
* counting semaphore is created using xSemaphoreCreateCounting() then the
|
* counting semaphore is created using xSemaphoreCreateCounting() then the
|
||||||
* required memory is automatically dynamically allocated inside the
|
* required memory is automatically dynamically allocated inside the
|
||||||
* xSemaphoreCreateCounting() function. (see
|
* xSemaphoreCreateCounting() function. (see
|
||||||
* http://www.freertos.org/a00111.html). If a counting semaphore is created
|
* http://www.freertos.org/a00111.html). If a counting semaphore is created
|
||||||
* using xSemaphoreCreateCountingStatic() then the application writer can
|
* using xSemaphoreCreateCountingStatic() then the application writer must
|
||||||
* instead optionally provide the memory that will get used by the counting
|
* provide the memory. xSemaphoreCreateCountingStatic() therefore allows a
|
||||||
* semaphore. xSemaphoreCreateCountingStatic() therefore allows a counting
|
* counting semaphore to be created without using any dynamic memory allocation.
|
||||||
* semaphore to be created without using any dynamic memory allocation.
|
|
||||||
*
|
*
|
||||||
* Counting semaphores are typically used for two things:
|
* Counting semaphores are typically used for two things:
|
||||||
*
|
*
|
||||||
|
@ -1100,18 +1085,13 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
* @param uxInitialCount The count value assigned to the semaphore when it is
|
* @param uxInitialCount The count value assigned to the semaphore when it is
|
||||||
* created.
|
* created.
|
||||||
*
|
*
|
||||||
* @param pxSemaphoreBuffer If pxSemaphoreBuffer is NULL then the memory
|
* @param pxSemaphoreBuffer Must point to a variable of type StaticSemaphore_t,
|
||||||
* required to hold the semaphore's data structures will be allocated
|
* which will then be used to hold the semaphore's data structure, removing the
|
||||||
* dynamically, just as when a counting semaphore is created using
|
* need for the memory to be allocated dynamically.
|
||||||
* xSemaphoreCreateCounting(). If pxSemaphoreBuffer is not NULL then it must
|
|
||||||
* point to a variable of type StaticSemaphore_t, which will then be used to
|
|
||||||
* hold the semaphore's data structure, removing the need for the memory
|
|
||||||
* to be allocated dynamically.
|
|
||||||
*
|
*
|
||||||
* @return If the counting semaphore was successfully created then a handle to
|
* @return If the counting semaphore was successfully created then a handle to
|
||||||
* the created counting semaphore is returned. If pxSemaphoreBuffer was NULL,
|
* the created counting semaphore is returned. If pxSemaphoreBuffer was NULL
|
||||||
* and there was not enough heap to allocate the counting semaphore data
|
* then NULL is returned.
|
||||||
* structures, then NULL is returned.
|
|
||||||
*
|
*
|
||||||
* Example usage:
|
* Example usage:
|
||||||
<pre>
|
<pre>
|
||||||
|
|
|
@ -277,16 +277,15 @@ is used in assert() statements. */
|
||||||
*
|
*
|
||||||
* Create a new task and add it to the list of tasks that are ready to run.
|
* Create a new task and add it to the list of tasks that are ready to run.
|
||||||
*
|
*
|
||||||
* Internally, within the FreeRTOS implementation, tasks's use two blocks of
|
* Internally, within the FreeRTOS implementation, tasks use two blocks of
|
||||||
* memory. The first block is used to hold the tasks's data structures. The
|
* memory. The first block is used to hold the task's data structures. The
|
||||||
* second block is used by the task as its stack. If a task is created using
|
* second block is used by the task as its stack. If a task is created using
|
||||||
* xTaskCreate() then both blocks of memory are automatically dynamically
|
* xTaskCreate() then both blocks of memory are automatically dynamically
|
||||||
* allocated inside the xTaskCreate() function. (see
|
* allocated inside the xTaskCreate() function. (see
|
||||||
* http://www.freertos.org/a00111.html). If a task is created using
|
* http://www.freertos.org/a00111.html). If a task is created using
|
||||||
* xTaskCreateStatic() then the application writer can instead optionally
|
* xTaskCreateStatic() then the application writer must provide the required
|
||||||
* provide the memory that will get used by the task. xTaskCreateStatic()
|
* memory. xTaskCreateStatic() therefore allows a task to be created without
|
||||||
* therefore allows a task to be created without using any dynamic memory
|
* using any dynamic memory allocation.
|
||||||
* allocation.
|
|
||||||
*
|
*
|
||||||
* See xTaskCreateStatic() for a version that does not use any dynamic memory
|
* See xTaskCreateStatic() for a version that does not use any dynamic memory
|
||||||
* allocation.
|
* allocation.
|
||||||
|
@ -377,16 +376,15 @@ is used in assert() statements. */
|
||||||
*
|
*
|
||||||
* Create a new task and add it to the list of tasks that are ready to run.
|
* Create a new task and add it to the list of tasks that are ready to run.
|
||||||
*
|
*
|
||||||
* Internally, within the FreeRTOS implementation, tasks's use two blocks of
|
* Internally, within the FreeRTOS implementation, tasks use two blocks of
|
||||||
* memory. The first block is used to hold the tasks's data structures. The
|
* memory. The first block is used to hold the task's data structures. The
|
||||||
* second block is used by the task as its stack. If a task is created using
|
* second block is used by the task as its stack. If a task is created using
|
||||||
* xTaskCreate() then both blocks of memory are automatically dynamically
|
* xTaskCreate() then both blocks of memory are automatically dynamically
|
||||||
* allocated inside the xTaskCreate() function. (see
|
* allocated inside the xTaskCreate() function. (see
|
||||||
* http://www.freertos.org/a00111.html). If a task is created using
|
* http://www.freertos.org/a00111.html). If a task is created using
|
||||||
* xTaskCreateStatic() then the application writer can instead optionally
|
* xTaskCreateStatic() then the application writer must provide the required
|
||||||
* provide the memory that will get used by the task. xTaskCreateStatic()
|
* memory. xTaskCreateStatic() therefore allows a task to be created without
|
||||||
* therefore allows a task to be created without using any dynamic memory
|
* using any dynamic memory allocation.
|
||||||
* allocation.
|
|
||||||
*
|
*
|
||||||
* @param pvTaskCode Pointer to the task entry function. Tasks
|
* @param pvTaskCode Pointer to the task entry function. Tasks
|
||||||
* must be implemented to never return (i.e. continuous loop).
|
* must be implemented to never return (i.e. continuous loop).
|
||||||
|
@ -408,26 +406,18 @@ is used in assert() statements. */
|
||||||
* @param pvCreatedTask Used to pass back a handle by which the created task
|
* @param pvCreatedTask Used to pass back a handle by which the created task
|
||||||
* can be referenced. Pass as NULL if the handle is not required.
|
* can be referenced. Pass as NULL if the handle is not required.
|
||||||
*
|
*
|
||||||
* @param pxStackBuffer If pxStackBuffer is NULL then the stack used by the
|
* @param pxStackBuffer Must point to a StackType_t array that has at least
|
||||||
* task will be allocated dynamically, just as if the task was created using
|
* usStackDepth indexes - the array will then be used as the task's stack,
|
||||||
* xTaskCreate(). If pxStackBuffer is not NULL then it must point to a
|
* removing the need for the stack to be allocated dynamically.
|
||||||
* StackType_t array that has at least usStackDepth indexes - the array will
|
|
||||||
* then be used as the task's stack, removing the need for the stack to be
|
|
||||||
* allocated dynamically.
|
|
||||||
*
|
*
|
||||||
* @param pxTaskBuffer If pxTaskBuffer is NULL then the memory used to hold the
|
* @param pxTaskBuffer Must point to a variable of type StaticTask_t, which will
|
||||||
* task's data structures will be allocated dynamically, just as when a task is
|
* then be used to hold the task's data structures, removing the need for the
|
||||||
* created using xTaskCreate(). If pxTaskBuffer is not NULL then it must point
|
* memory to be allocated dynamically.
|
||||||
* to a variable of type StaticTask_t, which will then be used to hold the
|
|
||||||
* task's data structures, removing the need for the memory to be allocated
|
|
||||||
* dynamically.
|
|
||||||
*
|
*
|
||||||
* @return If neither pxStackBuffer or pxTaskBuffer are NULL, then the function
|
* @return If neither pxStackBuffer or pxTaskBuffer are NULL, then the task will
|
||||||
* will not attempt any dynamic memory allocation, and pdPASS will always be
|
* be created and pdPASS is returned. If either pxStackBuffer or pxTaskBuffer
|
||||||
* returned. If pxStackBuffer or pxTaskBuffer is NULL then the function will
|
* are NULL then the task will not be created and
|
||||||
* attempt to dynamically allocate one of both buffers. In this case, if the
|
* errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY is returned.
|
||||||
* allocation succeeds then pdPASS will be returned, and if the allocation fails
|
|
||||||
* then an error code defined in projdefs.h is returned.
|
|
||||||
*
|
*
|
||||||
* Example usage:
|
* Example usage:
|
||||||
<pre>
|
<pre>
|
||||||
|
|
|
@ -138,15 +138,14 @@ typedef void (*PendedFunction_t)( void *, uint32_t );
|
||||||
* Creates a new software timer instance, and returns a handle by which the
|
* Creates a new software timer instance, and returns a handle by which the
|
||||||
* created software timer can be referenced.
|
* created software timer can be referenced.
|
||||||
*
|
*
|
||||||
* Internally, within the FreeRTOS implementation, software timer's use a block
|
* Internally, within the FreeRTOS implementation, software timers use a block
|
||||||
* of memory, in which the timer data structure is stored. If a software timer
|
* of memory, in which the timer data structure is stored. If a software timer
|
||||||
* is created using xTimerCreate() then the required memory is automatically
|
* is created using xTimerCreate() then the required memory is automatically
|
||||||
* dynamically allocated inside the xTimerCreate() function. (see
|
* dynamically allocated inside the xTimerCreate() function. (see
|
||||||
* http://www.freertos.org/a00111.html). If a software timer is created using
|
* http://www.freertos.org/a00111.html). If a software timer is created using
|
||||||
* xTimerCreateStatic() then the application writer can instead optionally
|
* xTimerCreateStatic() then the application writer must provide the memory that
|
||||||
* provide the memory that will get used by the software timer.
|
* will get used by the software timer. xTimerCreateStatic() therefore allows a
|
||||||
* xTimerCreateStatic() therefore allows a software timer to be created without
|
* software timer to be created without using any dynamic memory allocation.
|
||||||
* using any dynamic memory allocation.
|
|
||||||
*
|
*
|
||||||
* Timers are created in the dormant state. The xTimerStart(), xTimerReset(),
|
* Timers are created in the dormant state. The xTimerStart(), xTimerReset(),
|
||||||
* xTimerStartFromISR(), xTimerResetFromISR(), xTimerChangePeriod() and
|
* xTimerStartFromISR(), xTimerResetFromISR(), xTimerChangePeriod() and
|
||||||
|
@ -281,15 +280,14 @@ typedef void (*PendedFunction_t)( void *, uint32_t );
|
||||||
* Creates a new software timer instance, and returns a handle by which the
|
* Creates a new software timer instance, and returns a handle by which the
|
||||||
* created software timer can be referenced.
|
* created software timer can be referenced.
|
||||||
*
|
*
|
||||||
* Internally, within the FreeRTOS implementation, software timer's use a block
|
* Internally, within the FreeRTOS implementation, software timers use a block
|
||||||
* of memory, in which the timer data structure is stored. If a software timer
|
* of memory, in which the timer data structure is stored. If a software timer
|
||||||
* is created using xTimerCreate() then the required memory is automatically
|
* is created using xTimerCreate() then the required memory is automatically
|
||||||
* dynamically allocated inside the xTimerCreate() function. (see
|
* dynamically allocated inside the xTimerCreate() function. (see
|
||||||
* http://www.freertos.org/a00111.html). If a software timer is created using
|
* http://www.freertos.org/a00111.html). If a software timer is created using
|
||||||
* xTimerCreateStatic() then the application writer can instead optionally
|
* xTimerCreateStatic() then the application writer must provide the memory that
|
||||||
* provide the memory that will get used by the software timer.
|
* will get used by the software timer. xTimerCreateStatic() therefore allows a
|
||||||
* xTimerCreateStatic() therefore allows a software to be created without using
|
* software timer to be created without using any dynamic memory allocation.
|
||||||
* any dynamic memory allocation.
|
|
||||||
*
|
*
|
||||||
* Timers are created in the dormant state. The xTimerStart(), xTimerReset(),
|
* Timers are created in the dormant state. The xTimerStart(), xTimerReset(),
|
||||||
* xTimerStartFromISR(), xTimerResetFromISR(), xTimerChangePeriod() and
|
* xTimerStartFromISR(), xTimerResetFromISR(), xTimerChangePeriod() and
|
||||||
|
@ -322,19 +320,12 @@ typedef void (*PendedFunction_t)( void *, uint32_t );
|
||||||
* Callback functions must have the prototype defined by TimerCallbackFunction_t,
|
* Callback functions must have the prototype defined by TimerCallbackFunction_t,
|
||||||
* which is "void vCallbackFunction( TimerHandle_t xTimer );".
|
* which is "void vCallbackFunction( TimerHandle_t xTimer );".
|
||||||
*
|
*
|
||||||
* @param pxTimerBuffer If pxTimerBuffer is NULL then the memory required to
|
* @param pxTimerBuffer Must point to a variable of type StaticTimer_t, which
|
||||||
* hold the software timer's data structure will be allocated dynamically, just
|
|
||||||
* as when a software timer is created using xTimerCreate(). If pxTimerBuffer
|
|
||||||
* is not NULL then it must point to a variable of type StaticTimer_t, which
|
|
||||||
* will be then be used to hold the software timer's data structures, removing
|
* will be then be used to hold the software timer's data structures, removing
|
||||||
* the need for the memory to be allocated dynamically.
|
* the need for the memory to be allocated dynamically.
|
||||||
*
|
*
|
||||||
* @return If pxTimerBuffer is not NULL then the function will not attempt
|
* @return If the timer is created then a handle to the created timer is
|
||||||
* any dynamic memory allocation, and a handle to the created timer will always
|
* returned. If pxTimerBuffer was NULL then NULL is returned.
|
||||||
* be returned. If pxTimerBuffer is NULL then the function will attempt to
|
|
||||||
* dynamically allocate the memory required to hold the timer's data structures.
|
|
||||||
* In this case, if the allocation succeeds then a handle to the created timer
|
|
||||||
* will be returned, and if the allocation fails NULL will be returned.
|
|
||||||
*
|
*
|
||||||
* Example usage:
|
* Example usage:
|
||||||
* @verbatim
|
* @verbatim
|
||||||
|
|
|
@ -261,6 +261,16 @@ StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t px
|
||||||
xThreadState *pxThreadState = NULL;
|
xThreadState *pxThreadState = NULL;
|
||||||
int8_t *pcTopOfStack = ( int8_t * ) pxTopOfStack;
|
int8_t *pcTopOfStack = ( int8_t * ) pxTopOfStack;
|
||||||
|
|
||||||
|
#ifdef portSOAK_TEST
|
||||||
|
{
|
||||||
|
/* Ensure highest priority class is inherited. */
|
||||||
|
if( !SetPriorityClass( GetCurrentProcess(), REALTIME_PRIORITY_CLASS ) )
|
||||||
|
{
|
||||||
|
printf( "SetPriorityClass() failed\r\n" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* In this simulated case a stack is not initialised, but instead a thread
|
/* In this simulated case a stack is not initialised, but instead a thread
|
||||||
is created that will execute the task being created. The thread handles
|
is created that will execute the task being created. The thread handles
|
||||||
the context switching itself. The xThreadState object is placed onto
|
the context switching itself. The xThreadState object is placed onto
|
||||||
|
|
|
@ -70,6 +70,7 @@
|
||||||
#ifndef PORTMACRO_H
|
#ifndef PORTMACRO_H
|
||||||
#define PORTMACRO_H
|
#define PORTMACRO_H
|
||||||
|
|
||||||
|
#include <Windows.h>
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
Defines
|
Defines
|
||||||
|
|
Loading…
Reference in a new issue