Update FreeRTOS to latest release

This commit is contained in:
Ben V. Brown
2025-02-23 22:59:19 +11:00
parent 2794547817
commit 3e453f1363
34 changed files with 28824 additions and 20408 deletions

View File

@@ -1,6 +1,8 @@
/*
* FreeRTOS Kernel V10.4.1
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* FreeRTOS Kernel V11.1.0
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@@ -77,12 +79,12 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
/**
* queue. h
* <pre>
* @code{c}
* QueueHandle_t xQueueCreate(
* UBaseType_t uxQueueLength,
* UBaseType_t uxItemSize
* );
* </pre>
* @endcode
*
* Creates a new queue instance, and returns a handle by which the new queue
* can be referenced.
@@ -111,7 +113,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* returned.
*
* Example usage:
* <pre>
* @code{c}
* struct AMessage
* {
* char ucMessageID;
@@ -139,7 +141,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
*
* // ... Rest of task code.
* }
* </pre>
* @endcode
* \defgroup xQueueCreate xQueueCreate
* \ingroup QueueManagement
*/
@@ -149,14 +151,14 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
/**
* queue. h
* <pre>
* @code{c}
* QueueHandle_t xQueueCreateStatic(
* UBaseType_t uxQueueLength,
* UBaseType_t uxItemSize,
* uint8_t *pucQueueStorageBuffer,
* uint8_t *pucQueueStorage,
* StaticQueue_t *pxQueueBuffer
* );
* </pre>
* @endcode
*
* Creates a new queue instance, and returns a handle by which the new queue
* can be referenced.
@@ -180,11 +182,11 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* that will be copied for each posted item. Each item on the queue must be
* the same size.
*
* @param pucQueueStorageBuffer If uxItemSize is not zero then
* pucQueueStorageBuffer must point to a uint8_t array that is at least large
* @param pucQueueStorage If uxItemSize is not zero then
* pucQueueStorage must point to a uint8_t array that is at least large
* enough to hold the maximum number of items that can be in the queue at any
* one time - which is ( uxQueueLength * uxItemsSize ) bytes. If uxItemSize is
* zero then pucQueueStorageBuffer can be NULL.
* zero then pucQueueStorage can be NULL.
*
* @param pxQueueBuffer Must point to a variable of type StaticQueue_t, which
* will be used to hold the queue's data structure.
@@ -193,7 +195,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* returned. If pxQueueBuffer is NULL then NULL is returned.
*
* Example usage:
* <pre>
* @code{c}
* struct AMessage
* {
* char ucMessageID;
@@ -212,7 +214,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
*
* void vATask( void *pvParameters )
* {
* QueueHandle_t xQueue1;
* QueueHandle_t xQueue1;
*
* // Create a queue capable of containing 10 uint32_t values.
* xQueue1 = xQueueCreate( QUEUE_LENGTH, // The number of items the queue can hold.
@@ -225,7 +227,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
*
* // ... Rest of task code.
* }
* </pre>
* @endcode
* \defgroup xQueueCreateStatic xQueueCreateStatic
* \ingroup QueueManagement
*/
@@ -235,13 +237,42 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
/**
* queue. h
* <pre>
* BaseType_t xQueueSendToToFront(
* @code{c}
* BaseType_t xQueueGetStaticBuffers( QueueHandle_t xQueue,
* uint8_t ** ppucQueueStorage,
* StaticQueue_t ** ppxStaticQueue );
* @endcode
*
* Retrieve pointers to a statically created queue's data structure buffer
* and storage area buffer. These are the same buffers that are supplied
* at the time of creation.
*
* @param xQueue The queue for which to retrieve the buffers.
*
* @param ppucQueueStorage Used to return a pointer to the queue's storage
* area buffer.
*
* @param ppxStaticQueue Used to return a pointer to the queue's data
* structure buffer.
*
* @return pdTRUE if buffers were retrieved, pdFALSE otherwise.
*
* \defgroup xQueueGetStaticBuffers xQueueGetStaticBuffers
* \ingroup QueueManagement
*/
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
#define xQueueGetStaticBuffers( xQueue, ppucQueueStorage, ppxStaticQueue ) xQueueGenericGetStaticBuffers( ( xQueue ), ( ppucQueueStorage ), ( ppxStaticQueue ) )
#endif /* configSUPPORT_STATIC_ALLOCATION */
/**
* queue. h
* @code{c}
* BaseType_t xQueueSendToFront(
* QueueHandle_t xQueue,
* const void *pvItemToQueue,
* TickType_t xTicksToWait
* );
* </pre>
* @endcode
*
* Post an item to the front of a queue. The item is queued by copy, not by
* reference. This function must not be called from an interrupt service
@@ -264,14 +295,14 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
*
* Example usage:
* <pre>
* @code{c}
* struct AMessage
* {
* char ucMessageID;
* char ucData[ 20 ];
* } xMessage;
*
* uint32_t ulVar = 10UL;
* uint32_t ulVar = 10U;
*
* void vATask( void *pvParameters )
* {
@@ -307,7 +338,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
*
* // ... Rest of task code.
* }
* </pre>
* @endcode
* \defgroup xQueueSend xQueueSend
* \ingroup QueueManagement
*/
@@ -316,13 +347,13 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
/**
* queue. h
* <pre>
* @code{c}
* BaseType_t xQueueSendToBack(
* QueueHandle_t xQueue,
* const void *pvItemToQueue,
* TickType_t xTicksToWait
* );
* </pre>
* @endcode
*
* This is a macro that calls xQueueGenericSend().
*
@@ -347,14 +378,14 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
*
* Example usage:
* <pre>
* @code{c}
* struct AMessage
* {
* char ucMessageID;
* char ucData[ 20 ];
* } xMessage;
*
* uint32_t ulVar = 10UL;
* uint32_t ulVar = 10U;
*
* void vATask( void *pvParameters )
* {
@@ -390,7 +421,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
*
* // ... Rest of task code.
* }
* </pre>
* @endcode
* \defgroup xQueueSend xQueueSend
* \ingroup QueueManagement
*/
@@ -399,13 +430,13 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
/**
* queue. h
* <pre>
* @code{c}
* BaseType_t xQueueSend(
* QueueHandle_t xQueue,
* const void * pvItemToQueue,
* TickType_t xTicksToWait
* );
* </pre>
* @endcode
*
* This is a macro that calls xQueueGenericSend(). It is included for
* backward compatibility with versions of FreeRTOS.org that did not
@@ -432,14 +463,14 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
*
* Example usage:
* <pre>
* @code{c}
* struct AMessage
* {
* char ucMessageID;
* char ucData[ 20 ];
* } xMessage;
*
* uint32_t ulVar = 10UL;
* uint32_t ulVar = 10U;
*
* void vATask( void *pvParameters )
* {
@@ -475,7 +506,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
*
* // ... Rest of task code.
* }
* </pre>
* @endcode
* \defgroup xQueueSend xQueueSend
* \ingroup QueueManagement
*/
@@ -484,12 +515,12 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
/**
* queue. h
* <pre>
* @code{c}
* BaseType_t xQueueOverwrite(
* QueueHandle_t xQueue,
* const void * pvItemToQueue
* );
* </pre>
* @endcode
*
* Only for use with queues that have a length of one - so the queue is either
* empty or full.
@@ -513,7 +544,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* to the queue even when the queue is already full.
*
* Example usage:
* <pre>
* @code{c}
*
* void vFunction( void *pvParameters )
* {
@@ -559,7 +590,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
*
* // ...
* }
* </pre>
* @endcode
* \defgroup xQueueOverwrite xQueueOverwrite
* \ingroup QueueManagement
*/
@@ -569,14 +600,14 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
/**
* queue. h
* <pre>
* @code{c}
* BaseType_t xQueueGenericSend(
* QueueHandle_t xQueue,
* const void * pvItemToQueue,
* TickType_t xTicksToWait
* BaseType_t xCopyPosition
* );
* </pre>
* @endcode
*
* It is preferred that the macros xQueueSend(), xQueueSendToFront() and
* xQueueSendToBack() are used in place of calling this function directly.
@@ -605,14 +636,14 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
* @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
*
* Example usage:
* <pre>
* @code{c}
* struct AMessage
* {
* char ucMessageID;
* char ucData[ 20 ];
* } xMessage;
*
* uint32_t ulVar = 10UL;
* uint32_t ulVar = 10U;
*
* void vATask( void *pvParameters )
* {
@@ -648,7 +679,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
*
* // ... Rest of task code.
* }
* </pre>
* @endcode
* \defgroup xQueueSend xQueueSend
* \ingroup QueueManagement
*/
@@ -659,13 +690,13 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
/**
* queue. h
* <pre>
* @code{c}
* BaseType_t xQueuePeek(
* QueueHandle_t xQueue,
* void * const pvBuffer,
* TickType_t xTicksToWait
* );
* </pre>
* @endcode
*
* Receive an item from a queue without removing the item from the queue.
* The item is received by copy so a buffer of adequate size must be
@@ -696,7 +727,7 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
* otherwise pdFALSE.
*
* Example usage:
* <pre>
* @code{c}
* struct AMessage
* {
* char ucMessageID;
@@ -746,7 +777,7 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
*
* // ... Rest of task code.
* }
* </pre>
* @endcode
* \defgroup xQueuePeek xQueuePeek
* \ingroup QueueManagement
*/
@@ -756,12 +787,12 @@ BaseType_t xQueuePeek( QueueHandle_t xQueue,
/**
* queue. h
* <pre>
* @code{c}
* BaseType_t xQueuePeekFromISR(
* QueueHandle_t xQueue,
* void *pvBuffer,
* );
* </pre>
* @endcode
*
* A version of xQueuePeek() that can be called from an interrupt service
* routine (ISR).
@@ -791,13 +822,13 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue,
/**
* queue. h
* <pre>
* @code{c}
* BaseType_t xQueueReceive(
* QueueHandle_t xQueue,
* void *pvBuffer,
* TickType_t xTicksToWait
* );
* </pre>
* @endcode
*
* Receive an item from a queue. The item is received by copy so a buffer of
* adequate size must be provided. The number of bytes copied into the buffer
@@ -825,7 +856,7 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue,
* otherwise pdFALSE.
*
* Example usage:
* <pre>
* @code{c}
* struct AMessage
* {
* char ucMessageID;
@@ -875,7 +906,7 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue,
*
* // ... Rest of task code.
* }
* </pre>
* @endcode
* \defgroup xQueueReceive xQueueReceive
* \ingroup QueueManagement
*/
@@ -885,9 +916,9 @@ BaseType_t xQueueReceive( QueueHandle_t xQueue,
/**
* queue. h
* <pre>
* @code{c}
* UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue );
* </pre>
* @endcode
*
* Return the number of messages stored in a queue.
*
@@ -902,9 +933,9 @@ UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue ) PRIVILEGED_FUNC
/**
* queue. h
* <pre>
* @code{c}
* UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue );
* </pre>
* @endcode
*
* Return the number of free spaces available in a queue. This is equal to the
* number of items that can be sent to the queue before the queue becomes full
@@ -921,9 +952,9 @@ UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue ) PRIVILEGED_FUNC
/**
* queue. h
* <pre>
* @code{c}
* void vQueueDelete( QueueHandle_t xQueue );
* </pre>
* @endcode
*
* Delete a queue - freeing all the memory allocated for storing of items
* placed on the queue.
@@ -937,13 +968,13 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
/**
* queue. h
* <pre>
* @code{c}
* BaseType_t xQueueSendToFrontFromISR(
* QueueHandle_t xQueue,
* const void *pvItemToQueue,
* BaseType_t *pxHigherPriorityTaskWoken
* );
* </pre>
* @endcode
*
* This is a macro that calls xQueueGenericSendFromISR().
*
@@ -964,7 +995,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
* @param pxHigherPriorityTaskWoken xQueueSendToFrontFromISR() will set
* *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
* to unblock, and the unblocked task has a priority higher than the currently
* running task. If xQueueSendToFromFromISR() sets this value to pdTRUE then
* running task. If xQueueSendToFrontFromISR() sets this value to pdTRUE then
* a context switch should be requested before the interrupt is exited.
*
* @return pdTRUE if the data was successfully sent to the queue, otherwise
@@ -972,11 +1003,11 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
*
* Example usage for buffered IO (where the ISR can obtain more than one value
* per call):
* <pre>
* @code{c}
* void vBufferISR( void )
* {
* char cIn;
* BaseType_t xHigherPrioritTaskWoken;
* BaseType_t xHigherPriorityTaskWoken;
*
* // We have not woken a task at the start of the ISR.
* xHigherPriorityTaskWoken = pdFALSE;
@@ -998,7 +1029,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
* taskYIELD ();
* }
* }
* </pre>
* @endcode
*
* \defgroup xQueueSendFromISR xQueueSendFromISR
* \ingroup QueueManagement
@@ -1009,13 +1040,13 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
/**
* queue. h
* <pre>
* @code{c}
* BaseType_t xQueueSendToBackFromISR(
* QueueHandle_t xQueue,
* const void *pvItemToQueue,
* BaseType_t *pxHigherPriorityTaskWoken
* );
* </pre>
* @endcode
*
* This is a macro that calls xQueueGenericSendFromISR().
*
@@ -1044,7 +1075,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
*
* Example usage for buffered IO (where the ISR can obtain more than one value
* per call):
* <pre>
* @code{c}
* void vBufferISR( void )
* {
* char cIn;
@@ -1070,7 +1101,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
* taskYIELD ();
* }
* }
* </pre>
* @endcode
*
* \defgroup xQueueSendFromISR xQueueSendFromISR
* \ingroup QueueManagement
@@ -1080,13 +1111,13 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
/**
* queue. h
* <pre>
* @code{c}
* BaseType_t xQueueOverwriteFromISR(
* QueueHandle_t xQueue,
* const void * pvItemToQueue,
* BaseType_t *pxHigherPriorityTaskWoken
* );
* </pre>
* @endcode
*
* A version of xQueueOverwrite() that can be used in an interrupt service
* routine (ISR).
@@ -1117,7 +1148,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
* the queue is already full.
*
* Example usage:
* <pre>
* @code{c}
*
* QueueHandle_t xQueue;
*
@@ -1154,12 +1185,15 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
* {
* // Writing to the queue caused a task to unblock and the unblocked task
* // has a priority higher than or equal to the priority of the currently
* // executing task (the task this interrupt interrupted). Perform a context
* // executing task (the task this interrupt interrupted). Perform a context
* // switch so this interrupt returns directly to the unblocked task.
* portYIELD_FROM_ISR(); // or portEND_SWITCHING_ISR() depending on the port.
* // The macro used is port specific and will be either
* // portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() - refer to the documentation
* // page for the port being used.
* portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
* }
* }
* </pre>
* @endcode
* \defgroup xQueueOverwriteFromISR xQueueOverwriteFromISR
* \ingroup QueueManagement
*/
@@ -1168,13 +1202,13 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
/**
* queue. h
* <pre>
* @code{c}
* BaseType_t xQueueSendFromISR(
* QueueHandle_t xQueue,
* const void *pvItemToQueue,
* BaseType_t *pxHigherPriorityTaskWoken
* );
* </pre>
* @endcode
*
* This is a macro that calls xQueueGenericSendFromISR(). It is included
* for backward compatibility with versions of FreeRTOS.org that did not
@@ -1206,7 +1240,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
*
* Example usage for buffered IO (where the ISR can obtain more than one value
* per call):
* <pre>
* @code{c}
* void vBufferISR( void )
* {
* char cIn;
@@ -1229,11 +1263,14 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
* // Now the buffer is empty we can switch context if necessary.
* if( xHigherPriorityTaskWoken )
* {
* // Actual macro used here is port specific.
* portYIELD_FROM_ISR ();
* // As xHigherPriorityTaskWoken is now set to pdTRUE then a context
* // switch should be requested. The macro used is port specific and
* // will be either portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() -
* // refer to the documentation page for the port being used.
* portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
* }
* }
* </pre>
* @endcode
*
* \defgroup xQueueSendFromISR xQueueSendFromISR
* \ingroup QueueManagement
@@ -1243,14 +1280,14 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
/**
* queue. h
* <pre>
* @code{c}
* BaseType_t xQueueGenericSendFromISR(
* QueueHandle_t xQueue,
* const void *pvItemToQueue,
* BaseType_t *pxHigherPriorityTaskWoken,
* BaseType_t xCopyPosition
* );
* </pre>
* @endcode
*
* It is preferred that the macros xQueueSendFromISR(),
* xQueueSendToFrontFromISR() and xQueueSendToBackFromISR() be used in place
@@ -1286,7 +1323,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
*
* Example usage for buffered IO (where the ISR can obtain more than one value
* per call):
* <pre>
* @code{c}
* void vBufferISR( void )
* {
* char cIn;
@@ -1306,14 +1343,17 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
*
* } while( portINPUT_BYTE( BUFFER_COUNT ) );
*
* // Now the buffer is empty we can switch context if necessary. Note that the
* // name of the yield function required is port specific.
* // Now the buffer is empty we can switch context if necessary.
* if( xHigherPriorityTaskWokenByPost )
* {
* portYIELD_FROM_ISR();
* // As xHigherPriorityTaskWokenByPost is now set to pdTRUE then a context
* // switch should be requested. The macro used is port specific and
* // will be either portYIELD_FROM_ISR() or portEND_SWITCHING_ISR() -
* // refer to the documentation page for the port being used.
* portYIELD_FROM_ISR( xHigherPriorityTaskWokenByPost );
* }
* }
* </pre>
* @endcode
*
* \defgroup xQueueSendFromISR xQueueSendFromISR
* \ingroup QueueManagement
@@ -1327,13 +1367,13 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
/**
* queue. h
* <pre>
* @code{c}
* BaseType_t xQueueReceiveFromISR(
* QueueHandle_t xQueue,
* void *pvBuffer,
* BaseType_t *pxTaskWoken
* );
* </pre>
* @endcode
*
* Receive an item from a queue. It is safe to use this function from within an
* interrupt service routine.
@@ -1344,16 +1384,16 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
* @param pvBuffer Pointer to the buffer into which the received item will
* be copied.
*
* @param pxTaskWoken A task may be blocked waiting for space to become
* available on the queue. If xQueueReceiveFromISR causes such a task to
* unblock *pxTaskWoken will get set to pdTRUE, otherwise *pxTaskWoken will
* @param pxHigherPriorityTaskWoken A task may be blocked waiting for space to
* become available on the queue. If xQueueReceiveFromISR causes such a task
* to unblock *pxTaskWoken will get set to pdTRUE, otherwise *pxTaskWoken will
* remain unchanged.
*
* @return pdTRUE if an item was successfully received from the queue,
* otherwise pdFALSE.
*
* Example usage:
* <pre>
* @code{c}
*
* QueueHandle_t xQueue;
*
@@ -1398,17 +1438,17 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
* vOutputCharacter( cRxedChar );
*
* // If removing the character from the queue woke the task that was
* // posting onto the queue cTaskWokenByReceive will have been set to
* // posting onto the queue xTaskWokenByReceive will have been set to
* // pdTRUE. No matter how many times this loop iterates only one
* // task will be woken.
* }
*
* if( cTaskWokenByPost != ( char ) pdFALSE;
* if( xTaskWokenByReceive != ( char ) pdFALSE;
* {
* taskYIELD ();
* }
* }
* </pre>
* @endcode
* \defgroup xQueueReceiveFromISR xQueueReceiveFromISR
* \ingroup QueueManagement
*/
@@ -1418,12 +1458,14 @@ BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue,
/*
* Utilities to query queues that are safe to use from an ISR. These utilities
* should be used only from witin an ISR, or within a critical section.
* should be used only from within an ISR, or within a critical section.
*/
BaseType_t xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
UBaseType_t uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
#if ( configUSE_CO_ROUTINES == 1 )
/*
* The functions defined above are for passing data to and from tasks. The
* functions below are the equivalents for passing data to and from
@@ -1433,18 +1475,20 @@ UBaseType_t uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue ) PRIVILEG
* should not be called directly from application code. Instead use the macro
* wrappers defined within croutine.h.
*/
BaseType_t xQueueCRSendFromISR( QueueHandle_t xQueue,
const void * pvItemToQueue,
BaseType_t xCoRoutinePreviouslyWoken );
BaseType_t xQueueCRReceiveFromISR( QueueHandle_t xQueue,
void * pvBuffer,
BaseType_t * pxTaskWoken );
BaseType_t xQueueCRSend( QueueHandle_t xQueue,
const void * pvItemToQueue,
TickType_t xTicksToWait );
BaseType_t xQueueCRReceive( QueueHandle_t xQueue,
void * pvBuffer,
TickType_t xTicksToWait );
BaseType_t xQueueCRSendFromISR( QueueHandle_t xQueue,
const void * pvItemToQueue,
BaseType_t xCoRoutinePreviouslyWoken );
BaseType_t xQueueCRReceiveFromISR( QueueHandle_t xQueue,
void * pvBuffer,
BaseType_t * pxTaskWoken );
BaseType_t xQueueCRSend( QueueHandle_t xQueue,
const void * pvItemToQueue,
TickType_t xTicksToWait );
BaseType_t xQueueCRReceive( QueueHandle_t xQueue,
void * pvBuffer,
TickType_t xTicksToWait );
#endif /* if ( configUSE_CO_ROUTINES == 1 ) */
/*
* For internal use only. Use xSemaphoreCreateMutex(),
@@ -1452,21 +1496,34 @@ BaseType_t xQueueCRReceive( QueueHandle_t xQueue,
* these functions directly.
*/
QueueHandle_t xQueueCreateMutex( const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
QueueHandle_t xQueueCreateMutexStatic( const uint8_t ucQueueType,
StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
QueueHandle_t xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount,
const UBaseType_t uxInitialCount ) PRIVILEGED_FUNCTION;
QueueHandle_t xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount,
const UBaseType_t uxInitialCount,
StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
QueueHandle_t xQueueCreateMutexStatic( const uint8_t ucQueueType,
StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
#endif
#if ( configUSE_COUNTING_SEMAPHORES == 1 )
QueueHandle_t xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount,
const UBaseType_t uxInitialCount ) PRIVILEGED_FUNCTION;
#endif
#if ( ( configUSE_COUNTING_SEMAPHORES == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
QueueHandle_t xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount,
const UBaseType_t uxInitialCount,
StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
#endif
BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
TaskHandle_t xQueueGetMutexHolder( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
TaskHandle_t xQueueGetMutexHolderFromISR( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
#if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) )
TaskHandle_t xQueueGetMutexHolder( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
TaskHandle_t xQueueGetMutexHolderFromISR( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
#endif
/*
* For internal use only. Use xSemaphoreTakeMutexRecursive() or
* xSemaphoreGiveMutexRecursive() instead of calling these functions directly.
* For internal use only. Use xSemaphoreTakeRecursive() or
* xSemaphoreGiveRecursive() instead of calling these functions directly.
*/
BaseType_t xQueueTakeMutexRecursive( QueueHandle_t xMutex,
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
@@ -1476,7 +1533,7 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
* Reset a queue back to its original empty state. The return value is now
* obsolete and is always set to pdPASS.
*/
#define xQueueReset( xQueue ) xQueueGenericReset( xQueue, pdFALSE )
#define xQueueReset( xQueue ) xQueueGenericReset( ( xQueue ), pdFALSE )
/*
* The registry is provided as a means for kernel aware debuggers to
@@ -1488,21 +1545,25 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
* configQUEUE_REGISTRY_SIZE defines the maximum number of handles the
* registry can hold. configQUEUE_REGISTRY_SIZE must be greater than 0
* within FreeRTOSConfig.h for the registry to be available. Its value
* does not effect the number of queues, semaphores and mutexes that can be
* does not affect the number of queues, semaphores and mutexes that can be
* created - just the number that the registry can hold.
*
* If vQueueAddToRegistry is called more than once with the same xQueue
* parameter, the registry will store the pcQueueName parameter from the
* most recent call to vQueueAddToRegistry.
*
* @param xQueue The handle of the queue being added to the registry. This
* is the handle returned by a call to xQueueCreate(). Semaphore and mutex
* handles can also be passed in here.
*
* @param pcName The name to be associated with the handle. This is the
* @param pcQueueName The name to be associated with the handle. This is the
* name that the kernel aware debugger will display. The queue registry only
* stores a pointer to the string - so the string must be persistent (global or
* preferably in ROM/Flash), not on the stack.
*/
#if ( configQUEUE_REGISTRY_SIZE > 0 )
void vQueueAddToRegistry( QueueHandle_t xQueue,
const char * pcQueueName ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
const char * pcQueueName ) PRIVILEGED_FUNCTION;
#endif
/*
@@ -1531,7 +1592,7 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
* returned.
*/
#if ( configQUEUE_REGISTRY_SIZE > 0 )
const char * pcQueueGetName( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
const char * pcQueueGetName( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
#endif
/*
@@ -1558,6 +1619,18 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
#endif
/*
* Generic version of the function used to retrieve the buffers of statically
* created queues. This is called by other functions and macros that retrieve
* the buffers of other statically created RTOS objects that use the queue
* structure as their base.
*/
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
BaseType_t xQueueGenericGetStaticBuffers( QueueHandle_t xQueue,
uint8_t ** ppucQueueStorage,
StaticQueue_t ** ppxStaticQueue ) PRIVILEGED_FUNCTION;
#endif
/*
* Queue sets provide a mechanism to allow a task to block (pend) on a read
* operation from multiple queues or semaphores simultaneously.
@@ -1572,7 +1645,7 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
* or semaphores contained in the set is in a state where a queue read or
* semaphore take operation would be successful.
*
* Note 1: See the documentation on http://wwwFreeRTOS.org/RTOS-queue-sets.html
* Note 1: See the documentation on https://www.FreeRTOS.org/RTOS-queue-sets.html
* for reasons why queue sets are very rarely needed in practice as there are
* simpler methods of blocking on multiple objects.
*
@@ -1606,7 +1679,9 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
* @return If the queue set is created successfully then a handle to the created
* queue set is returned. Otherwise NULL is returned.
*/
QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILEGED_FUNCTION;
#if ( ( configUSE_QUEUE_SETS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILEGED_FUNCTION;
#endif
/*
* Adds a queue or semaphore to a queue set that was previously created by a
@@ -1630,8 +1705,10 @@ QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILE
* queue set because it is already a member of a different queue set then pdFAIL
* is returned.
*/
BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
#if ( configUSE_QUEUE_SETS == 1 )
BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
#endif
/*
* Removes a queue or semaphore from a queue set. A queue or semaphore can only
@@ -1650,8 +1727,10 @@ BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
* then pdPASS is returned. If the queue was not in the queue set, or the
* queue (or semaphore) was not empty, then pdFAIL is returned.
*/
BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
#if ( configUSE_QUEUE_SETS == 1 )
BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
#endif
/*
* xQueueSelectFromSet() selects from the members of a queue set a queue or
@@ -1663,7 +1742,7 @@ BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
* See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this
* function.
*
* Note 1: See the documentation on http://wwwFreeRTOS.org/RTOS-queue-sets.html
* Note 1: See the documentation on https://www.FreeRTOS.org/RTOS-queue-sets.html
* for reasons why queue sets are very rarely needed in practice as there are
* simpler methods of blocking on multiple objects.
*
@@ -1687,13 +1766,17 @@ BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
* in the queue set that is available, or NULL if no such queue or semaphore
* exists before before the specified block time expires.
*/
QueueSetMemberHandle_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet,
const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
#if ( configUSE_QUEUE_SETS == 1 )
QueueSetMemberHandle_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet,
const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
#endif
/*
* A version of xQueueSelectFromSet() that can be used from an ISR.
*/
QueueSetMemberHandle_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
#if ( configUSE_QUEUE_SETS == 1 )
QueueSetMemberHandle_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
#endif
/* Not public API functions. */
void vQueueWaitForMessageRestricted( QueueHandle_t xQueue,
@@ -1701,11 +1784,22 @@ void vQueueWaitForMessageRestricted( QueueHandle_t xQueue,
const BaseType_t xWaitIndefinitely ) PRIVILEGED_FUNCTION;
BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
BaseType_t xNewQueue ) PRIVILEGED_FUNCTION;
void vQueueSetQueueNumber( QueueHandle_t xQueue,
UBaseType_t uxQueueNumber ) PRIVILEGED_FUNCTION;
UBaseType_t uxQueueGetQueueNumber( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
uint8_t ucQueueGetQueueType( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
#if ( configUSE_TRACE_FACILITY == 1 )
void vQueueSetQueueNumber( QueueHandle_t xQueue,
UBaseType_t uxQueueNumber ) PRIVILEGED_FUNCTION;
#endif
#if ( configUSE_TRACE_FACILITY == 1 )
UBaseType_t uxQueueGetQueueNumber( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
#endif
#if ( configUSE_TRACE_FACILITY == 1 )
uint8_t ucQueueGetQueueType( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
#endif
UBaseType_t uxQueueGetQueueItemSize( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
UBaseType_t uxQueueGetQueueLength( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
/* *INDENT-OFF* */
#ifdef __cplusplus