mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-12 09:07:46 -04:00
Replace standard types with stdint.h types.
Replace #define types with typedefs. Rename all typedefs to have a _t extension. Add #defines to automatically convert old FreeRTOS specific types to their new names (with the _t).
This commit is contained in:
parent
f292243dcf
commit
3e20aa7d60
190 changed files with 4940 additions and 4603 deletions
|
@ -87,12 +87,12 @@ privileged Vs unprivileged linkage and placement. */
|
|||
|
||||
|
||||
/* Constants used with the cRxLock and xTxLock structure members. */
|
||||
#define queueUNLOCKED ( ( signed portBASE_TYPE ) -1 )
|
||||
#define queueLOCKED_UNMODIFIED ( ( signed portBASE_TYPE ) 0 )
|
||||
#define queueUNLOCKED ( ( BaseType_t ) -1 )
|
||||
#define queueLOCKED_UNMODIFIED ( ( BaseType_t ) 0 )
|
||||
|
||||
/* When the xQUEUE structure is used to represent a base queue its pcHead and
|
||||
/* When the Queue_t structure is used to represent a base queue its pcHead and
|
||||
pcTail members are used as pointers into the queue storage area. When the
|
||||
xQUEUE structure is used to represent a mutex pcHead and pcTail pointers are
|
||||
Queue_t structure is used to represent a mutex pcHead and pcTail pointers are
|
||||
not necessary, and the pcHead pointer is set to NULL to indicate that the
|
||||
pcTail pointer actually points to the mutex holder (if any). Map alternative
|
||||
names to the pcHead and pcTail structure members to ensure the readability of
|
||||
|
@ -107,8 +107,8 @@ structure member). */
|
|||
|
||||
/* Semaphores do not actually store or copy data, so have an item size of
|
||||
zero. */
|
||||
#define queueSEMAPHORE_QUEUE_ITEM_LENGTH ( ( unsigned portBASE_TYPE ) 0 )
|
||||
#define queueMUTEX_GIVE_BLOCK_TIME ( ( portTickType ) 0U )
|
||||
#define queueSEMAPHORE_QUEUE_ITEM_LENGTH ( ( UBaseType_t ) 0 )
|
||||
#define queueMUTEX_GIVE_BLOCK_TIME ( ( TickType_t ) 0U )
|
||||
|
||||
#if( configUSE_PREEMPTION == 0 )
|
||||
/* If the cooperative scheduler is being used then a yield should not be
|
||||
|
@ -124,36 +124,36 @@ zero. */
|
|||
*/
|
||||
typedef struct QueueDefinition
|
||||
{
|
||||
signed char *pcHead; /*< Points to the beginning of the queue storage area. */
|
||||
signed char *pcTail; /*< Points to the byte at the end of the queue storage area. Once more byte is allocated than necessary to store the queue items, this is used as a marker. */
|
||||
signed char *pcWriteTo; /*< Points to the free next place in the storage area. */
|
||||
int8_t *pcHead; /*< Points to the beginning of the queue storage area. */
|
||||
int8_t *pcTail; /*< Points to the byte at the end of the queue storage area. Once more byte is allocated than necessary to store the queue items, this is used as a marker. */
|
||||
int8_t *pcWriteTo; /*< Points to the free next place in the storage area. */
|
||||
|
||||
union /* Use of a union is an exception to the coding standard to ensure two mutually exclusive structure members don't appear simultaneously (wasting RAM). */
|
||||
union /* Use of a union is an exception to the coding standard to ensure two mutually exclusive structure members don't appear simultaneously (wasting RAM). */
|
||||
{
|
||||
signed char *pcReadFrom; /*< Points to the last place that a queued item was read from when the structure is used as a queue. */
|
||||
unsigned portBASE_TYPE uxRecursiveCallCount;/*< Maintains a count of the number of times a recursive mutex has been recursively 'taken' when the structure is used as a mutex. */
|
||||
int8_t *pcReadFrom; /*< Points to the last place that a queued item was read from when the structure is used as a queue. */
|
||||
UBaseType_t uxRecursiveCallCount;/*< Maintains a count of the number of times a recursive mutex has been recursively 'taken' when the structure is used as a mutex. */
|
||||
} u;
|
||||
|
||||
xList xTasksWaitingToSend; /*< List of tasks that are blocked waiting to post onto this queue. Stored in priority order. */
|
||||
xList xTasksWaitingToReceive; /*< List of tasks that are blocked waiting to read from this queue. Stored in priority order. */
|
||||
List_t xTasksWaitingToSend; /*< List of tasks that are blocked waiting to post onto this queue. Stored in priority order. */
|
||||
List_t xTasksWaitingToReceive; /*< List of tasks that are blocked waiting to read from this queue. Stored in priority order. */
|
||||
|
||||
volatile unsigned portBASE_TYPE uxMessagesWaiting;/*< The number of items currently in the queue. */
|
||||
unsigned portBASE_TYPE uxLength; /*< The length of the queue defined as the number of items it will hold, not the number of bytes. */
|
||||
unsigned portBASE_TYPE uxItemSize; /*< The size of each items that the queue will hold. */
|
||||
volatile UBaseType_t uxMessagesWaiting;/*< The number of items currently in the queue. */
|
||||
UBaseType_t uxLength; /*< The length of the queue defined as the number of items it will hold, not the number of bytes. */
|
||||
UBaseType_t uxItemSize; /*< The size of each items that the queue will hold. */
|
||||
|
||||
volatile signed portBASE_TYPE xRxLock; /*< Stores the number of items received from the queue (removed from the queue) while the queue was locked. Set to queueUNLOCKED when the queue is not locked. */
|
||||
volatile signed portBASE_TYPE xTxLock; /*< Stores the number of items transmitted to the queue (added to the queue) while the queue was locked. Set to queueUNLOCKED when the queue is not locked. */
|
||||
volatile BaseType_t xRxLock; /*< Stores the number of items received from the queue (removed from the queue) while the queue was locked. Set to queueUNLOCKED when the queue is not locked. */
|
||||
volatile BaseType_t xTxLock; /*< Stores the number of items transmitted to the queue (added to the queue) while the queue was locked. Set to queueUNLOCKED when the queue is not locked. */
|
||||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
unsigned portBASE_TYPE uxQueueNumber;
|
||||
unsigned char ucQueueType;
|
||||
UBaseType_t uxQueueNumber;
|
||||
uint8_t ucQueueType;
|
||||
#endif
|
||||
|
||||
#if ( configUSE_QUEUE_SETS == 1 )
|
||||
struct QueueDefinition *pxQueueSetContainer;
|
||||
#endif
|
||||
|
||||
} xQUEUE;
|
||||
} Queue_t;
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
|
@ -168,13 +168,13 @@ typedef struct QueueDefinition
|
|||
typedef struct QUEUE_REGISTRY_ITEM
|
||||
{
|
||||
char *pcQueueName; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
xQueueHandle xHandle;
|
||||
} xQueueRegistryItem;
|
||||
QueueHandle_t xHandle;
|
||||
} QueueRegistryItem_t;
|
||||
|
||||
/* The queue registry is simply an array of xQueueRegistryItem structures.
|
||||
/* The queue registry is simply an array of QueueRegistryItem_t structures.
|
||||
The pcQueueName member of a structure being NULL is indicative of the
|
||||
array position being vacant. */
|
||||
xQueueRegistryItem xQueueRegistry[ configQUEUE_REGISTRY_SIZE ];
|
||||
QueueRegistryItem_t xQueueRegistry[ configQUEUE_REGISTRY_SIZE ];
|
||||
|
||||
#endif /* configQUEUE_REGISTRY_SIZE */
|
||||
|
||||
|
@ -186,39 +186,39 @@ typedef struct QueueDefinition
|
|||
* to indicate that a task may require unblocking. When the queue in unlocked
|
||||
* these lock counts are inspected, and the appropriate action taken.
|
||||
*/
|
||||
static void prvUnlockQueue( xQUEUE * const pxQueue ) PRIVILEGED_FUNCTION;
|
||||
static void prvUnlockQueue( Queue_t * const pxQueue ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/*
|
||||
* Uses a critical section to determine if there is any data in a queue.
|
||||
*
|
||||
* @return pdTRUE if the queue contains no items, otherwise pdFALSE.
|
||||
*/
|
||||
static signed portBASE_TYPE prvIsQueueEmpty( const xQUEUE *pxQueue ) PRIVILEGED_FUNCTION;
|
||||
static BaseType_t prvIsQueueEmpty( const Queue_t *pxQueue ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/*
|
||||
* Uses a critical section to determine if there is any space in a queue.
|
||||
*
|
||||
* @return pdTRUE if there is no space, otherwise pdFALSE;
|
||||
*/
|
||||
static signed portBASE_TYPE prvIsQueueFull( const xQUEUE *pxQueue ) PRIVILEGED_FUNCTION;
|
||||
static BaseType_t prvIsQueueFull( const Queue_t *pxQueue ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/*
|
||||
* Copies an item into the queue, either at the front of the queue or the
|
||||
* back of the queue.
|
||||
*/
|
||||
static void prvCopyDataToQueue( xQUEUE * const pxQueue, const void *pvItemToQueue, const portBASE_TYPE xPosition ) PRIVILEGED_FUNCTION;
|
||||
static void prvCopyDataToQueue( Queue_t * const pxQueue, const void *pvItemToQueue, const BaseType_t xPosition ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/*
|
||||
* Copies an item out of a queue.
|
||||
*/
|
||||
static void prvCopyDataFromQueue( xQUEUE * const pxQueue, void * const pvBuffer ) PRIVILEGED_FUNCTION;
|
||||
static void prvCopyDataFromQueue( Queue_t * const pxQueue, void * const pvBuffer ) PRIVILEGED_FUNCTION;
|
||||
|
||||
#if ( configUSE_QUEUE_SETS == 1 )
|
||||
/*
|
||||
* Checks to see if a queue is a member of a queue set, and if so, notifies
|
||||
* the queue set that the queue contains data.
|
||||
*/
|
||||
static portBASE_TYPE prvNotifyQueueSetContainer( const xQUEUE * const pxQueue, const portBASE_TYPE xCopyPosition ) PRIVILEGED_FUNCTION;
|
||||
static BaseType_t prvNotifyQueueSetContainer( const Queue_t * const pxQueue, const BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION;
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -242,18 +242,18 @@ static void prvCopyDataFromQueue( xQUEUE * const pxQueue, void * const pvBuffer
|
|||
taskEXIT_CRITICAL()
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
portBASE_TYPE xQueueGenericReset( xQueueHandle xQueue, portBASE_TYPE xNewQueue )
|
||||
BaseType_t xQueueGenericReset( QueueHandle_t xQueue, BaseType_t xNewQueue )
|
||||
{
|
||||
xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
||||
Queue_t * const pxQueue = ( Queue_t * ) xQueue;
|
||||
|
||||
configASSERT( pxQueue );
|
||||
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
pxQueue->pcTail = pxQueue->pcHead + ( pxQueue->uxLength * pxQueue->uxItemSize );
|
||||
pxQueue->uxMessagesWaiting = ( unsigned portBASE_TYPE ) 0U;
|
||||
pxQueue->uxMessagesWaiting = ( UBaseType_t ) 0U;
|
||||
pxQueue->pcWriteTo = pxQueue->pcHead;
|
||||
pxQueue->u.pcReadFrom = pxQueue->pcHead + ( ( pxQueue->uxLength - ( unsigned portBASE_TYPE ) 1U ) * pxQueue->uxItemSize );
|
||||
pxQueue->u.pcReadFrom = pxQueue->pcHead + ( ( pxQueue->uxLength - ( UBaseType_t ) 1U ) * pxQueue->uxItemSize );
|
||||
pxQueue->xRxLock = queueUNLOCKED;
|
||||
pxQueue->xTxLock = queueUNLOCKED;
|
||||
|
||||
|
@ -295,27 +295,27 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
xQueueHandle xQueueGenericCreate( const unsigned portBASE_TYPE uxQueueLength, const unsigned portBASE_TYPE uxItemSize, const unsigned char ucQueueType )
|
||||
QueueHandle_t xQueueGenericCreate( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, const uint8_t ucQueueType )
|
||||
{
|
||||
xQUEUE *pxNewQueue;
|
||||
Queue_t *pxNewQueue;
|
||||
size_t xQueueSizeInBytes;
|
||||
xQueueHandle xReturn = NULL;
|
||||
QueueHandle_t xReturn = NULL;
|
||||
|
||||
/* Remove compiler warnings about unused parameters should
|
||||
configUSE_TRACE_FACILITY not be set to 1. */
|
||||
( void ) ucQueueType;
|
||||
|
||||
/* Allocate the new queue structure. */
|
||||
if( uxQueueLength > ( unsigned portBASE_TYPE ) 0 )
|
||||
if( uxQueueLength > ( UBaseType_t ) 0 )
|
||||
{
|
||||
pxNewQueue = ( xQUEUE * ) pvPortMalloc( sizeof( xQUEUE ) );
|
||||
pxNewQueue = ( Queue_t * ) pvPortMalloc( sizeof( Queue_t ) );
|
||||
if( pxNewQueue != NULL )
|
||||
{
|
||||
/* Create the list of pointers to queue items. The queue is one byte
|
||||
longer than asked for to make wrap checking easier/faster. */
|
||||
xQueueSizeInBytes = ( size_t ) ( uxQueueLength * uxItemSize ) + ( size_t ) 1; /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
|
||||
|
||||
pxNewQueue->pcHead = ( signed char * ) pvPortMalloc( xQueueSizeInBytes );
|
||||
pxNewQueue->pcHead = ( int8_t * ) pvPortMalloc( xQueueSizeInBytes );
|
||||
if( pxNewQueue->pcHead != NULL )
|
||||
{
|
||||
/* Initialise the queue members as described above where the
|
||||
|
@ -363,16 +363,16 @@ xQueueHandle xReturn = NULL;
|
|||
|
||||
#if ( configUSE_MUTEXES == 1 )
|
||||
|
||||
xQueueHandle xQueueCreateMutex( const unsigned char ucQueueType )
|
||||
QueueHandle_t xQueueCreateMutex( const uint8_t ucQueueType )
|
||||
{
|
||||
xQUEUE *pxNewQueue;
|
||||
Queue_t *pxNewQueue;
|
||||
|
||||
/* Prevent compiler warnings about unused parameters if
|
||||
configUSE_TRACE_FACILITY does not equal 1. */
|
||||
( void ) ucQueueType;
|
||||
|
||||
/* Allocate the new queue structure. */
|
||||
pxNewQueue = ( xQUEUE * ) pvPortMalloc( sizeof( xQUEUE ) );
|
||||
pxNewQueue = ( Queue_t * ) pvPortMalloc( sizeof( Queue_t ) );
|
||||
if( pxNewQueue != NULL )
|
||||
{
|
||||
/* Information required for priority inheritance. */
|
||||
|
@ -387,9 +387,9 @@ xQueueHandle xReturn = NULL;
|
|||
/* Each mutex has a length of 1 (like a binary semaphore) and
|
||||
an item size of 0 as nothing is actually copied into or out
|
||||
of the mutex. */
|
||||
pxNewQueue->uxMessagesWaiting = ( unsigned portBASE_TYPE ) 0U;
|
||||
pxNewQueue->uxLength = ( unsigned portBASE_TYPE ) 1U;
|
||||
pxNewQueue->uxItemSize = ( unsigned portBASE_TYPE ) 0U;
|
||||
pxNewQueue->uxMessagesWaiting = ( UBaseType_t ) 0U;
|
||||
pxNewQueue->uxLength = ( UBaseType_t ) 1U;
|
||||
pxNewQueue->uxItemSize = ( UBaseType_t ) 0U;
|
||||
pxNewQueue->xRxLock = queueUNLOCKED;
|
||||
pxNewQueue->xTxLock = queueUNLOCKED;
|
||||
|
||||
|
@ -412,7 +412,7 @@ xQueueHandle xReturn = NULL;
|
|||
traceCREATE_MUTEX( pxNewQueue );
|
||||
|
||||
/* Start with the semaphore in the expected state. */
|
||||
( void ) xQueueGenericSend( pxNewQueue, NULL, ( portTickType ) 0U, queueSEND_TO_BACK );
|
||||
( void ) xQueueGenericSend( pxNewQueue, NULL, ( TickType_t ) 0U, queueSEND_TO_BACK );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -428,7 +428,7 @@ xQueueHandle xReturn = NULL;
|
|||
|
||||
#if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) )
|
||||
|
||||
void* xQueueGetMutexHolder( xQueueHandle xSemaphore )
|
||||
void* xQueueGetMutexHolder( QueueHandle_t xSemaphore )
|
||||
{
|
||||
void *pxReturn;
|
||||
|
||||
|
@ -439,9 +439,9 @@ xQueueHandle xReturn = NULL;
|
|||
following critical section exiting and the function returning. */
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
if( ( ( xQUEUE * ) xSemaphore )->uxQueueType == queueQUEUE_IS_MUTEX )
|
||||
if( ( ( Queue_t * ) xSemaphore )->uxQueueType == queueQUEUE_IS_MUTEX )
|
||||
{
|
||||
pxReturn = ( void * ) ( ( xQUEUE * ) xSemaphore )->pxMutexHolder;
|
||||
pxReturn = ( void * ) ( ( Queue_t * ) xSemaphore )->pxMutexHolder;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -458,10 +458,10 @@ xQueueHandle xReturn = NULL;
|
|||
|
||||
#if ( configUSE_RECURSIVE_MUTEXES == 1 )
|
||||
|
||||
portBASE_TYPE xQueueGiveMutexRecursive( xQueueHandle xMutex )
|
||||
BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex )
|
||||
{
|
||||
portBASE_TYPE xReturn;
|
||||
xQUEUE * const pxMutex = ( xQUEUE * ) xMutex;
|
||||
BaseType_t xReturn;
|
||||
Queue_t * const pxMutex = ( Queue_t * ) xMutex;
|
||||
|
||||
configASSERT( pxMutex );
|
||||
|
||||
|
@ -471,7 +471,7 @@ xQueueHandle xReturn = NULL;
|
|||
this is the only condition we are interested in it does not matter if
|
||||
pxMutexHolder is accessed simultaneously by another task. Therefore no
|
||||
mutual exclusion is required to test the pxMutexHolder variable. */
|
||||
if( pxMutex->pxMutexHolder == ( void * ) xTaskGetCurrentTaskHandle() ) /*lint !e961 Not a redundant cast as xTaskHandle is a typedef. */
|
||||
if( pxMutex->pxMutexHolder == ( void * ) xTaskGetCurrentTaskHandle() ) /*lint !e961 Not a redundant cast as TaskHandle_t is a typedef. */
|
||||
{
|
||||
traceGIVE_MUTEX_RECURSIVE( pxMutex );
|
||||
|
||||
|
@ -483,7 +483,7 @@ xQueueHandle xReturn = NULL;
|
|||
( pxMutex->u.uxRecursiveCallCount )--;
|
||||
|
||||
/* Have we unwound the call count? */
|
||||
if( pxMutex->u.uxRecursiveCallCount == ( unsigned portBASE_TYPE ) 0 )
|
||||
if( pxMutex->u.uxRecursiveCallCount == ( UBaseType_t ) 0 )
|
||||
{
|
||||
/* Return the mutex. This will automatically unblock any other
|
||||
task that might be waiting to access the mutex. */
|
||||
|
@ -512,10 +512,10 @@ xQueueHandle xReturn = NULL;
|
|||
|
||||
#if ( configUSE_RECURSIVE_MUTEXES == 1 )
|
||||
|
||||
portBASE_TYPE xQueueTakeMutexRecursive( xQueueHandle xMutex, portTickType xBlockTime )
|
||||
BaseType_t xQueueTakeMutexRecursive( QueueHandle_t xMutex, TickType_t xBlockTime )
|
||||
{
|
||||
portBASE_TYPE xReturn;
|
||||
xQUEUE * const pxMutex = ( xQUEUE * ) xMutex;
|
||||
BaseType_t xReturn;
|
||||
Queue_t * const pxMutex = ( Queue_t * ) xMutex;
|
||||
|
||||
configASSERT( pxMutex );
|
||||
|
||||
|
@ -524,7 +524,7 @@ xQueueHandle xReturn = NULL;
|
|||
|
||||
traceTAKE_MUTEX_RECURSIVE( pxMutex );
|
||||
|
||||
if( pxMutex->pxMutexHolder == ( void * ) xTaskGetCurrentTaskHandle() ) /*lint !e961 Cast is not redundant as xTaskHandle is a typedef. */
|
||||
if( pxMutex->pxMutexHolder == ( void * ) xTaskGetCurrentTaskHandle() ) /*lint !e961 Cast is not redundant as TaskHandle_t is a typedef. */
|
||||
{
|
||||
( pxMutex->u.uxRecursiveCallCount )++;
|
||||
xReturn = pdPASS;
|
||||
|
@ -553,9 +553,9 @@ xQueueHandle xReturn = NULL;
|
|||
|
||||
#if ( configUSE_COUNTING_SEMAPHORES == 1 )
|
||||
|
||||
xQueueHandle xQueueCreateCountingSemaphore( const unsigned portBASE_TYPE uxMaxCount, const unsigned portBASE_TYPE uxInitialCount )
|
||||
QueueHandle_t xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount )
|
||||
{
|
||||
xQueueHandle xHandle;
|
||||
QueueHandle_t xHandle;
|
||||
|
||||
configASSERT( uxMaxCount != 0 );
|
||||
configASSERT( uxInitialCount <= uxMaxCount );
|
||||
|
@ -564,7 +564,7 @@ xQueueHandle xReturn = NULL;
|
|||
|
||||
if( xHandle != NULL )
|
||||
{
|
||||
( ( xQUEUE * ) xHandle )->uxMessagesWaiting = uxInitialCount;
|
||||
( ( Queue_t * ) xHandle )->uxMessagesWaiting = uxInitialCount;
|
||||
|
||||
traceCREATE_COUNTING_SEMAPHORE();
|
||||
}
|
||||
|
@ -580,14 +580,14 @@ xQueueHandle xReturn = NULL;
|
|||
#endif /* configUSE_COUNTING_SEMAPHORES */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
signed portBASE_TYPE xQueueGenericSend( xQueueHandle xQueue, const void * const pvItemToQueue, portTickType xTicksToWait, const portBASE_TYPE xCopyPosition )
|
||||
BaseType_t xQueueGenericSend( QueueHandle_t xQueue, const void * const pvItemToQueue, TickType_t xTicksToWait, const BaseType_t xCopyPosition )
|
||||
{
|
||||
signed portBASE_TYPE xEntryTimeSet = pdFALSE;
|
||||
xTimeOutType xTimeOut;
|
||||
xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
||||
BaseType_t xEntryTimeSet = pdFALSE;
|
||||
TimeOut_t xTimeOut;
|
||||
Queue_t * const pxQueue = ( Queue_t * ) xQueue;
|
||||
|
||||
configASSERT( pxQueue );
|
||||
configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );
|
||||
configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) );
|
||||
configASSERT( !( ( xCopyPosition == queueOVERWRITE ) && ( pxQueue->uxLength != 1 ) ) );
|
||||
#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
|
||||
{
|
||||
|
@ -687,7 +687,7 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
|||
}
|
||||
else
|
||||
{
|
||||
if( xTicksToWait == ( portTickType ) 0 )
|
||||
if( xTicksToWait == ( TickType_t ) 0 )
|
||||
{
|
||||
/* The queue was full and no block time is specified (or
|
||||
the block time has expired) so leave now. */
|
||||
|
@ -769,14 +769,14 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
|||
|
||||
#if ( configUSE_ALTERNATIVE_API == 1 )
|
||||
|
||||
signed portBASE_TYPE xQueueAltGenericSend( xQueueHandle xQueue, const void * const pvItemToQueue, portTickType xTicksToWait, portBASE_TYPE xCopyPosition )
|
||||
BaseType_t xQueueAltGenericSend( QueueHandle_t xQueue, const void * const pvItemToQueue, TickType_t xTicksToWait, BaseType_t xCopyPosition )
|
||||
{
|
||||
signed portBASE_TYPE xEntryTimeSet = pdFALSE;
|
||||
xTimeOutType xTimeOut;
|
||||
xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
||||
BaseType_t xEntryTimeSet = pdFALSE;
|
||||
TimeOut_t xTimeOut;
|
||||
Queue_t * const pxQueue = ( Queue_t * ) xQueue;
|
||||
|
||||
configASSERT( pxQueue );
|
||||
configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );
|
||||
configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) );
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
|
@ -814,7 +814,7 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
|||
}
|
||||
else
|
||||
{
|
||||
if( xTicksToWait == ( portTickType ) 0 )
|
||||
if( xTicksToWait == ( TickType_t ) 0 )
|
||||
{
|
||||
taskEXIT_CRITICAL();
|
||||
return errQUEUE_FULL;
|
||||
|
@ -859,21 +859,21 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
|||
|
||||
#if ( configUSE_ALTERNATIVE_API == 1 )
|
||||
|
||||
signed portBASE_TYPE xQueueAltGenericReceive( xQueueHandle xQueue, void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeeking )
|
||||
BaseType_t xQueueAltGenericReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait, BaseType_t xJustPeeking )
|
||||
{
|
||||
signed portBASE_TYPE xEntryTimeSet = pdFALSE;
|
||||
xTimeOutType xTimeOut;
|
||||
signed char *pcOriginalReadPosition;
|
||||
xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
||||
BaseType_t xEntryTimeSet = pdFALSE;
|
||||
TimeOut_t xTimeOut;
|
||||
int8_t *pcOriginalReadPosition;
|
||||
Queue_t * const pxQueue = ( Queue_t * ) xQueue;
|
||||
|
||||
configASSERT( pxQueue );
|
||||
configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );
|
||||
configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) );
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
if( pxQueue->uxMessagesWaiting > ( unsigned portBASE_TYPE ) 0 )
|
||||
if( pxQueue->uxMessagesWaiting > ( UBaseType_t ) 0 )
|
||||
{
|
||||
/* Remember our read position in case we are just peeking. */
|
||||
pcOriginalReadPosition = pxQueue->u.pcReadFrom;
|
||||
|
@ -893,7 +893,7 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
|||
{
|
||||
/* Record the information required to implement
|
||||
priority inheritance should it become necessary. */
|
||||
pxQueue->pxMutexHolder = ( signed char * ) xTaskGetCurrentTaskHandle();
|
||||
pxQueue->pxMutexHolder = ( int8_t * ) xTaskGetCurrentTaskHandle();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -949,7 +949,7 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
|||
}
|
||||
else
|
||||
{
|
||||
if( xTicksToWait == ( portTickType ) 0 )
|
||||
if( xTicksToWait == ( TickType_t ) 0 )
|
||||
{
|
||||
taskEXIT_CRITICAL();
|
||||
traceQUEUE_RECEIVE_FAILED( pxQueue );
|
||||
|
@ -1012,14 +1012,14 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
|||
#endif /* configUSE_ALTERNATIVE_API */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle xQueue, const void * const pvItemToQueue, signed portBASE_TYPE * const pxHigherPriorityTaskWoken, const portBASE_TYPE xCopyPosition )
|
||||
BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue, const void * const pvItemToQueue, BaseType_t * const pxHigherPriorityTaskWoken, const BaseType_t xCopyPosition )
|
||||
{
|
||||
signed portBASE_TYPE xReturn;
|
||||
unsigned portBASE_TYPE uxSavedInterruptStatus;
|
||||
xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
||||
BaseType_t xReturn;
|
||||
UBaseType_t uxSavedInterruptStatus;
|
||||
Queue_t * const pxQueue = ( Queue_t * ) xQueue;
|
||||
|
||||
configASSERT( pxQueue );
|
||||
configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );
|
||||
configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) );
|
||||
configASSERT( !( ( xCopyPosition == queueOVERWRITE ) && ( pxQueue->uxLength != 1 ) ) );
|
||||
|
||||
/* RTOS ports that support interrupt nesting have the concept of a maximum
|
||||
|
@ -1156,15 +1156,15 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
signed portBASE_TYPE xQueueGenericReceive( xQueueHandle xQueue, void * const pvBuffer, portTickType xTicksToWait, const portBASE_TYPE xJustPeeking )
|
||||
BaseType_t xQueueGenericReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait, const BaseType_t xJustPeeking )
|
||||
{
|
||||
signed portBASE_TYPE xEntryTimeSet = pdFALSE;
|
||||
xTimeOutType xTimeOut;
|
||||
signed char *pcOriginalReadPosition;
|
||||
xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
||||
BaseType_t xEntryTimeSet = pdFALSE;
|
||||
TimeOut_t xTimeOut;
|
||||
int8_t *pcOriginalReadPosition;
|
||||
Queue_t * const pxQueue = ( Queue_t * ) xQueue;
|
||||
|
||||
configASSERT( pxQueue );
|
||||
configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );
|
||||
configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) );
|
||||
#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
|
||||
{
|
||||
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
|
||||
|
@ -1181,7 +1181,7 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
|||
{
|
||||
/* Is there data in the queue now? To be running we must be
|
||||
the highest priority task wanting to access the queue. */
|
||||
if( pxQueue->uxMessagesWaiting > ( unsigned portBASE_TYPE ) 0 )
|
||||
if( pxQueue->uxMessagesWaiting > ( UBaseType_t ) 0 )
|
||||
{
|
||||
/* Remember the read position in case the queue is only being
|
||||
peeked. */
|
||||
|
@ -1202,7 +1202,7 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
|||
{
|
||||
/* Record the information required to implement
|
||||
priority inheritance should it become necessary. */
|
||||
pxQueue->pxMutexHolder = ( signed char * ) xTaskGetCurrentTaskHandle(); /*lint !e961 Cast is not redundant as xTaskHandle is a typedef. */
|
||||
pxQueue->pxMutexHolder = ( int8_t * ) xTaskGetCurrentTaskHandle(); /*lint !e961 Cast is not redundant as TaskHandle_t is a typedef. */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1262,7 +1262,7 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
|||
}
|
||||
else
|
||||
{
|
||||
if( xTicksToWait == ( portTickType ) 0 )
|
||||
if( xTicksToWait == ( TickType_t ) 0 )
|
||||
{
|
||||
/* The queue was empty and no block time is specified (or
|
||||
the block time has expired) so leave now. */
|
||||
|
@ -1345,14 +1345,14 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle xQueue, void * const pvBuffer, signed portBASE_TYPE * const pxHigherPriorityTaskWoken )
|
||||
BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue, void * const pvBuffer, BaseType_t * const pxHigherPriorityTaskWoken )
|
||||
{
|
||||
signed portBASE_TYPE xReturn;
|
||||
unsigned portBASE_TYPE uxSavedInterruptStatus;
|
||||
xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
||||
BaseType_t xReturn;
|
||||
UBaseType_t uxSavedInterruptStatus;
|
||||
Queue_t * const pxQueue = ( Queue_t * ) xQueue;
|
||||
|
||||
configASSERT( pxQueue );
|
||||
configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );
|
||||
configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) );
|
||||
|
||||
/* RTOS ports that support interrupt nesting have the concept of a maximum
|
||||
system call (or maximum API call) interrupt priority. Interrupts that are
|
||||
|
@ -1373,7 +1373,7 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
|||
uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
|
||||
{
|
||||
/* Cannot block in an ISR, so check there is data available. */
|
||||
if( pxQueue->uxMessagesWaiting > ( unsigned portBASE_TYPE ) 0 )
|
||||
if( pxQueue->uxMessagesWaiting > ( UBaseType_t ) 0 )
|
||||
{
|
||||
traceQUEUE_RECEIVE_FROM_ISR( pxQueue );
|
||||
|
||||
|
@ -1432,15 +1432,15 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
signed portBASE_TYPE xQueuePeekFromISR( xQueueHandle xQueue, void * const pvBuffer )
|
||||
BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue, void * const pvBuffer )
|
||||
{
|
||||
signed portBASE_TYPE xReturn;
|
||||
unsigned portBASE_TYPE uxSavedInterruptStatus;
|
||||
signed char *pcOriginalReadPosition;
|
||||
xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
||||
BaseType_t xReturn;
|
||||
UBaseType_t uxSavedInterruptStatus;
|
||||
int8_t *pcOriginalReadPosition;
|
||||
Queue_t * const pxQueue = ( Queue_t * ) xQueue;
|
||||
|
||||
configASSERT( pxQueue );
|
||||
configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );
|
||||
configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) );
|
||||
|
||||
/* RTOS ports that support interrupt nesting have the concept of a maximum
|
||||
system call (or maximum API call) interrupt priority. Interrupts that are
|
||||
|
@ -1461,7 +1461,7 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
|||
uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
|
||||
{
|
||||
/* Cannot block in an ISR, so check there is data available. */
|
||||
if( pxQueue->uxMessagesWaiting > ( unsigned portBASE_TYPE ) 0 )
|
||||
if( pxQueue->uxMessagesWaiting > ( UBaseType_t ) 0 )
|
||||
{
|
||||
traceQUEUE_PEEK_FROM_ISR( pxQueue );
|
||||
|
||||
|
@ -1485,15 +1485,15 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
unsigned portBASE_TYPE uxQueueMessagesWaiting( const xQueueHandle xQueue )
|
||||
UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue )
|
||||
{
|
||||
unsigned portBASE_TYPE uxReturn;
|
||||
UBaseType_t uxReturn;
|
||||
|
||||
configASSERT( xQueue );
|
||||
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
uxReturn = ( ( xQUEUE * ) xQueue )->uxMessagesWaiting;
|
||||
uxReturn = ( ( Queue_t * ) xQueue )->uxMessagesWaiting;
|
||||
}
|
||||
taskEXIT_CRITICAL();
|
||||
|
||||
|
@ -1501,12 +1501,12 @@ unsigned portBASE_TYPE uxReturn;
|
|||
} /*lint !e818 Pointer cannot be declared const as xQueue is a typedef not pointer. */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
unsigned portBASE_TYPE uxQueueSpacesAvailable( const xQueueHandle xQueue )
|
||||
UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue )
|
||||
{
|
||||
unsigned portBASE_TYPE uxReturn;
|
||||
xQUEUE *pxQueue;
|
||||
UBaseType_t uxReturn;
|
||||
Queue_t *pxQueue;
|
||||
|
||||
pxQueue = ( xQUEUE * ) xQueue;
|
||||
pxQueue = ( Queue_t * ) xQueue;
|
||||
configASSERT( pxQueue );
|
||||
|
||||
taskENTER_CRITICAL();
|
||||
|
@ -1519,21 +1519,21 @@ xQUEUE *pxQueue;
|
|||
} /*lint !e818 Pointer cannot be declared const as xQueue is a typedef not pointer. */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
unsigned portBASE_TYPE uxQueueMessagesWaitingFromISR( const xQueueHandle xQueue )
|
||||
UBaseType_t uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue )
|
||||
{
|
||||
unsigned portBASE_TYPE uxReturn;
|
||||
UBaseType_t uxReturn;
|
||||
|
||||
configASSERT( xQueue );
|
||||
|
||||
uxReturn = ( ( xQUEUE * ) xQueue )->uxMessagesWaiting;
|
||||
uxReturn = ( ( Queue_t * ) xQueue )->uxMessagesWaiting;
|
||||
|
||||
return uxReturn;
|
||||
} /*lint !e818 Pointer cannot be declared const as xQueue is a typedef not pointer. */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vQueueDelete( xQueueHandle xQueue )
|
||||
void vQueueDelete( QueueHandle_t xQueue )
|
||||
{
|
||||
xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
||||
Queue_t * const pxQueue = ( Queue_t * ) xQueue;
|
||||
|
||||
configASSERT( pxQueue );
|
||||
|
||||
|
@ -1553,9 +1553,9 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
|||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
|
||||
unsigned portBASE_TYPE uxQueueGetQueueNumber( xQueueHandle xQueue )
|
||||
UBaseType_t uxQueueGetQueueNumber( QueueHandle_t xQueue )
|
||||
{
|
||||
return ( ( xQUEUE * ) xQueue )->uxQueueNumber;
|
||||
return ( ( Queue_t * ) xQueue )->uxQueueNumber;
|
||||
}
|
||||
|
||||
#endif /* configUSE_TRACE_FACILITY */
|
||||
|
@ -1563,9 +1563,9 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
|||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
|
||||
void vQueueSetQueueNumber( xQueueHandle xQueue, unsigned portBASE_TYPE uxQueueNumber )
|
||||
void vQueueSetQueueNumber( QueueHandle_t xQueue, UBaseType_t uxQueueNumber )
|
||||
{
|
||||
( ( xQUEUE * ) xQueue )->uxQueueNumber = uxQueueNumber;
|
||||
( ( Queue_t * ) xQueue )->uxQueueNumber = uxQueueNumber;
|
||||
}
|
||||
|
||||
#endif /* configUSE_TRACE_FACILITY */
|
||||
|
@ -1573,17 +1573,17 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
|||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
|
||||
unsigned char ucQueueGetQueueType( xQueueHandle xQueue )
|
||||
uint8_t ucQueueGetQueueType( QueueHandle_t xQueue )
|
||||
{
|
||||
return ( ( xQUEUE * ) xQueue )->ucQueueType;
|
||||
return ( ( Queue_t * ) xQueue )->ucQueueType;
|
||||
}
|
||||
|
||||
#endif /* configUSE_TRACE_FACILITY */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvCopyDataToQueue( xQUEUE * const pxQueue, const void *pvItemToQueue, const portBASE_TYPE xPosition )
|
||||
static void prvCopyDataToQueue( Queue_t * const pxQueue, const void *pvItemToQueue, const BaseType_t xPosition )
|
||||
{
|
||||
if( pxQueue->uxItemSize == ( unsigned portBASE_TYPE ) 0 )
|
||||
if( pxQueue->uxItemSize == ( UBaseType_t ) 0 )
|
||||
{
|
||||
#if ( configUSE_MUTEXES == 1 )
|
||||
{
|
||||
|
@ -1628,7 +1628,7 @@ static void prvCopyDataToQueue( xQUEUE * const pxQueue, const void *pvItemToQueu
|
|||
|
||||
if( xPosition == queueOVERWRITE )
|
||||
{
|
||||
if( pxQueue->uxMessagesWaiting > ( unsigned portBASE_TYPE ) 0 )
|
||||
if( pxQueue->uxMessagesWaiting > ( UBaseType_t ) 0 )
|
||||
{
|
||||
/* An item is not being added but overwritten, so subtract
|
||||
one from the recorded number of items in the queue so when
|
||||
|
@ -1651,7 +1651,7 @@ static void prvCopyDataToQueue( xQUEUE * const pxQueue, const void *pvItemToQueu
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvCopyDataFromQueue( xQUEUE * const pxQueue, void * const pvBuffer )
|
||||
static void prvCopyDataFromQueue( Queue_t * const pxQueue, void * const pvBuffer )
|
||||
{
|
||||
if( pxQueue->uxQueueType != queueQUEUE_IS_MUTEX )
|
||||
{
|
||||
|
@ -1673,7 +1673,7 @@ static void prvCopyDataFromQueue( xQUEUE * const pxQueue, void * const pvBuffer
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvUnlockQueue( xQUEUE * const pxQueue )
|
||||
static void prvUnlockQueue( Queue_t * const pxQueue )
|
||||
{
|
||||
/* THIS FUNCTION MUST BE CALLED WITH THE SCHEDULER SUSPENDED. */
|
||||
|
||||
|
@ -1788,13 +1788,13 @@ static void prvUnlockQueue( xQUEUE * const pxQueue )
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static signed portBASE_TYPE prvIsQueueEmpty( const xQUEUE *pxQueue )
|
||||
static BaseType_t prvIsQueueEmpty( const Queue_t *pxQueue )
|
||||
{
|
||||
signed portBASE_TYPE xReturn;
|
||||
BaseType_t xReturn;
|
||||
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
if( pxQueue->uxMessagesWaiting == ( unsigned portBASE_TYPE ) 0 )
|
||||
if( pxQueue->uxMessagesWaiting == ( UBaseType_t ) 0 )
|
||||
{
|
||||
xReturn = pdTRUE;
|
||||
}
|
||||
|
@ -1809,12 +1809,12 @@ signed portBASE_TYPE xReturn;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
signed portBASE_TYPE xQueueIsQueueEmptyFromISR( const xQueueHandle xQueue )
|
||||
BaseType_t xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue )
|
||||
{
|
||||
signed portBASE_TYPE xReturn;
|
||||
BaseType_t xReturn;
|
||||
|
||||
configASSERT( xQueue );
|
||||
if( ( ( xQUEUE * ) xQueue )->uxMessagesWaiting == ( unsigned portBASE_TYPE ) 0 )
|
||||
if( ( ( Queue_t * ) xQueue )->uxMessagesWaiting == ( UBaseType_t ) 0 )
|
||||
{
|
||||
xReturn = pdTRUE;
|
||||
}
|
||||
|
@ -1827,9 +1827,9 @@ signed portBASE_TYPE xReturn;
|
|||
} /*lint !e818 xQueue could not be pointer to const because it is a typedef. */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static signed portBASE_TYPE prvIsQueueFull( const xQUEUE *pxQueue )
|
||||
static BaseType_t prvIsQueueFull( const Queue_t *pxQueue )
|
||||
{
|
||||
signed portBASE_TYPE xReturn;
|
||||
BaseType_t xReturn;
|
||||
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
|
@ -1848,12 +1848,12 @@ signed portBASE_TYPE xReturn;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
signed portBASE_TYPE xQueueIsQueueFullFromISR( const xQueueHandle xQueue )
|
||||
BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
|
||||
{
|
||||
signed portBASE_TYPE xReturn;
|
||||
BaseType_t xReturn;
|
||||
|
||||
configASSERT( xQueue );
|
||||
if( ( ( xQUEUE * ) xQueue )->uxMessagesWaiting == ( ( xQUEUE * ) xQueue )->uxLength )
|
||||
if( ( ( Queue_t * ) xQueue )->uxMessagesWaiting == ( ( Queue_t * ) xQueue )->uxLength )
|
||||
{
|
||||
xReturn = pdTRUE;
|
||||
}
|
||||
|
@ -1868,10 +1868,10 @@ signed portBASE_TYPE xReturn;
|
|||
|
||||
#if ( configUSE_CO_ROUTINES == 1 )
|
||||
|
||||
signed portBASE_TYPE xQueueCRSend( xQueueHandle xQueue, const void *pvItemToQueue, portTickType xTicksToWait )
|
||||
BaseType_t xQueueCRSend( QueueHandle_t xQueue, const void *pvItemToQueue, TickType_t xTicksToWait )
|
||||
{
|
||||
signed portBASE_TYPE xReturn;
|
||||
xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
||||
BaseType_t xReturn;
|
||||
Queue_t * const pxQueue = ( Queue_t * ) xQueue;
|
||||
|
||||
/* If the queue is already full we may have to block. A critical section
|
||||
is required to prevent an interrupt removing something from the queue
|
||||
|
@ -1882,7 +1882,7 @@ signed portBASE_TYPE xReturn;
|
|||
{
|
||||
/* The queue is full - do we want to block or just leave without
|
||||
posting? */
|
||||
if( xTicksToWait > ( portTickType ) 0 )
|
||||
if( xTicksToWait > ( TickType_t ) 0 )
|
||||
{
|
||||
/* As this is called from a coroutine we cannot block directly, but
|
||||
return indicating that we need to block. */
|
||||
|
@ -1945,21 +1945,21 @@ signed portBASE_TYPE xReturn;
|
|||
|
||||
#if ( configUSE_CO_ROUTINES == 1 )
|
||||
|
||||
signed portBASE_TYPE xQueueCRReceive( xQueueHandle xQueue, void *pvBuffer, portTickType xTicksToWait )
|
||||
BaseType_t xQueueCRReceive( QueueHandle_t xQueue, void *pvBuffer, TickType_t xTicksToWait )
|
||||
{
|
||||
signed portBASE_TYPE xReturn;
|
||||
xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
||||
BaseType_t xReturn;
|
||||
Queue_t * const pxQueue = ( Queue_t * ) xQueue;
|
||||
|
||||
/* If the queue is already empty we may have to block. A critical section
|
||||
is required to prevent an interrupt adding something to the queue
|
||||
between the check to see if the queue is empty and blocking on the queue. */
|
||||
portDISABLE_INTERRUPTS();
|
||||
{
|
||||
if( pxQueue->uxMessagesWaiting == ( unsigned portBASE_TYPE ) 0 )
|
||||
if( pxQueue->uxMessagesWaiting == ( UBaseType_t ) 0 )
|
||||
{
|
||||
/* There are no messages in the queue, do we want to block or just
|
||||
leave with nothing? */
|
||||
if( xTicksToWait > ( portTickType ) 0 )
|
||||
if( xTicksToWait > ( TickType_t ) 0 )
|
||||
{
|
||||
/* As this is a co-routine we cannot block directly, but return
|
||||
indicating that we need to block. */
|
||||
|
@ -1982,7 +1982,7 @@ signed portBASE_TYPE xReturn;
|
|||
|
||||
portDISABLE_INTERRUPTS();
|
||||
{
|
||||
if( pxQueue->uxMessagesWaiting > ( unsigned portBASE_TYPE ) 0 )
|
||||
if( pxQueue->uxMessagesWaiting > ( UBaseType_t ) 0 )
|
||||
{
|
||||
/* Data is available from the queue. */
|
||||
pxQueue->u.pcReadFrom += pxQueue->uxItemSize;
|
||||
|
@ -2035,9 +2035,9 @@ signed portBASE_TYPE xReturn;
|
|||
|
||||
#if ( configUSE_CO_ROUTINES == 1 )
|
||||
|
||||
signed portBASE_TYPE xQueueCRSendFromISR( xQueueHandle xQueue, const void *pvItemToQueue, signed portBASE_TYPE xCoRoutinePreviouslyWoken )
|
||||
BaseType_t xQueueCRSendFromISR( QueueHandle_t xQueue, const void *pvItemToQueue, BaseType_t xCoRoutinePreviouslyWoken )
|
||||
{
|
||||
xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
||||
Queue_t * const pxQueue = ( Queue_t * ) xQueue;
|
||||
|
||||
/* Cannot block within an ISR so if there is no space on the queue then
|
||||
exit without doing anything. */
|
||||
|
@ -2083,14 +2083,14 @@ signed portBASE_TYPE xReturn;
|
|||
|
||||
#if ( configUSE_CO_ROUTINES == 1 )
|
||||
|
||||
signed portBASE_TYPE xQueueCRReceiveFromISR( xQueueHandle xQueue, void *pvBuffer, signed portBASE_TYPE *pxCoRoutineWoken )
|
||||
BaseType_t xQueueCRReceiveFromISR( QueueHandle_t xQueue, void *pvBuffer, BaseType_t *pxCoRoutineWoken )
|
||||
{
|
||||
signed portBASE_TYPE xReturn;
|
||||
xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
||||
BaseType_t xReturn;
|
||||
Queue_t * const pxQueue = ( Queue_t * ) xQueue;
|
||||
|
||||
/* We cannot block from an ISR, so check there is data available. If
|
||||
not then just leave without doing anything. */
|
||||
if( pxQueue->uxMessagesWaiting > ( unsigned portBASE_TYPE ) 0 )
|
||||
if( pxQueue->uxMessagesWaiting > ( UBaseType_t ) 0 )
|
||||
{
|
||||
/* Copy the data from the queue. */
|
||||
pxQueue->u.pcReadFrom += pxQueue->uxItemSize;
|
||||
|
@ -2143,13 +2143,13 @@ signed portBASE_TYPE xReturn;
|
|||
|
||||
#if ( configQUEUE_REGISTRY_SIZE > 0 )
|
||||
|
||||
void vQueueAddToRegistry( xQueueHandle xQueue, char *pcQueueName ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
void vQueueAddToRegistry( QueueHandle_t xQueue, char *pcQueueName ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
{
|
||||
unsigned portBASE_TYPE ux;
|
||||
UBaseType_t ux;
|
||||
|
||||
/* See if there is an empty space in the registry. A NULL name denotes
|
||||
a free slot. */
|
||||
for( ux = ( unsigned portBASE_TYPE ) 0U; ux < ( unsigned portBASE_TYPE ) configQUEUE_REGISTRY_SIZE; ux++ )
|
||||
for( ux = ( UBaseType_t ) 0U; ux < ( UBaseType_t ) configQUEUE_REGISTRY_SIZE; ux++ )
|
||||
{
|
||||
if( xQueueRegistry[ ux ].pcQueueName == NULL )
|
||||
{
|
||||
|
@ -2170,13 +2170,13 @@ signed portBASE_TYPE xReturn;
|
|||
|
||||
#if ( configQUEUE_REGISTRY_SIZE > 0 )
|
||||
|
||||
void vQueueUnregisterQueue( xQueueHandle xQueue )
|
||||
void vQueueUnregisterQueue( QueueHandle_t xQueue )
|
||||
{
|
||||
unsigned portBASE_TYPE ux;
|
||||
UBaseType_t ux;
|
||||
|
||||
/* See if the handle of the queue being unregistered in actually in the
|
||||
registry. */
|
||||
for( ux = ( unsigned portBASE_TYPE ) 0U; ux < ( unsigned portBASE_TYPE ) configQUEUE_REGISTRY_SIZE; ux++ )
|
||||
for( ux = ( UBaseType_t ) 0U; ux < ( UBaseType_t ) configQUEUE_REGISTRY_SIZE; ux++ )
|
||||
{
|
||||
if( xQueueRegistry[ ux ].xHandle == xQueue )
|
||||
{
|
||||
|
@ -2197,9 +2197,9 @@ signed portBASE_TYPE xReturn;
|
|||
|
||||
#if ( configUSE_TIMERS == 1 )
|
||||
|
||||
void vQueueWaitForMessageRestricted( xQueueHandle xQueue, portTickType xTicksToWait )
|
||||
void vQueueWaitForMessageRestricted( QueueHandle_t xQueue, TickType_t xTicksToWait )
|
||||
{
|
||||
xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
|
||||
Queue_t * const pxQueue = ( Queue_t * ) xQueue;
|
||||
|
||||
/* This function should not be called by application code hence the
|
||||
'Restricted' in its name. It is not part of the public API. It is
|
||||
|
@ -2216,7 +2216,7 @@ signed portBASE_TYPE xReturn;
|
|||
the queue is locked, and the calling task blocks on the queue, then the
|
||||
calling task will be immediately unblocked when the queue is unlocked. */
|
||||
prvLockQueue( pxQueue );
|
||||
if( pxQueue->uxMessagesWaiting == ( unsigned portBASE_TYPE ) 0U )
|
||||
if( pxQueue->uxMessagesWaiting == ( UBaseType_t ) 0U )
|
||||
{
|
||||
/* There is nothing in the queue, block for the specified period. */
|
||||
vTaskPlaceOnEventListRestricted( &( pxQueue->xTasksWaitingToReceive ), xTicksToWait );
|
||||
|
@ -2233,11 +2233,11 @@ signed portBASE_TYPE xReturn;
|
|||
|
||||
#if ( configUSE_QUEUE_SETS == 1 )
|
||||
|
||||
xQueueSetHandle xQueueCreateSet( const unsigned portBASE_TYPE uxEventQueueLength )
|
||||
QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength )
|
||||
{
|
||||
xQueueSetHandle pxQueue;
|
||||
QueueSetHandle_t pxQueue;
|
||||
|
||||
pxQueue = xQueueGenericCreate( uxEventQueueLength, sizeof( xQUEUE * ), queueQUEUE_TYPE_SET );
|
||||
pxQueue = xQueueGenericCreate( uxEventQueueLength, sizeof( Queue_t * ), queueQUEUE_TYPE_SET );
|
||||
|
||||
return pxQueue;
|
||||
}
|
||||
|
@ -2247,16 +2247,16 @@ signed portBASE_TYPE xReturn;
|
|||
|
||||
#if ( configUSE_QUEUE_SETS == 1 )
|
||||
|
||||
portBASE_TYPE xQueueAddToSet( xQueueSetMemberHandle xQueueOrSemaphore, xQueueSetHandle xQueueSet )
|
||||
BaseType_t xQueueAddToSet( QueueSetMember_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet )
|
||||
{
|
||||
portBASE_TYPE xReturn;
|
||||
BaseType_t xReturn;
|
||||
|
||||
if( ( ( xQUEUE * ) xQueueOrSemaphore )->pxQueueSetContainer != NULL )
|
||||
if( ( ( Queue_t * ) xQueueOrSemaphore )->pxQueueSetContainer != NULL )
|
||||
{
|
||||
/* Cannot add a queue/semaphore to more than one queue set. */
|
||||
xReturn = pdFAIL;
|
||||
}
|
||||
else if( ( ( xQUEUE * ) xQueueOrSemaphore )->uxMessagesWaiting != ( unsigned portBASE_TYPE ) 0 )
|
||||
else if( ( ( Queue_t * ) xQueueOrSemaphore )->uxMessagesWaiting != ( UBaseType_t ) 0 )
|
||||
{
|
||||
/* Cannot add a queue/semaphore to a queue set if there are already
|
||||
items in the queue/semaphore. */
|
||||
|
@ -2266,7 +2266,7 @@ signed portBASE_TYPE xReturn;
|
|||
{
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
( ( xQUEUE * ) xQueueOrSemaphore )->pxQueueSetContainer = xQueueSet;
|
||||
( ( Queue_t * ) xQueueOrSemaphore )->pxQueueSetContainer = xQueueSet;
|
||||
}
|
||||
taskEXIT_CRITICAL();
|
||||
xReturn = pdPASS;
|
||||
|
@ -2280,17 +2280,17 @@ signed portBASE_TYPE xReturn;
|
|||
|
||||
#if ( configUSE_QUEUE_SETS == 1 )
|
||||
|
||||
portBASE_TYPE xQueueRemoveFromSet( xQueueSetMemberHandle xQueueOrSemaphore, xQueueSetHandle xQueueSet )
|
||||
BaseType_t xQueueRemoveFromSet( QueueSetMember_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet )
|
||||
{
|
||||
portBASE_TYPE xReturn;
|
||||
xQUEUE * const pxQueueOrSemaphore = ( xQUEUE * ) xQueueOrSemaphore;
|
||||
BaseType_t xReturn;
|
||||
Queue_t * const pxQueueOrSemaphore = ( Queue_t * ) xQueueOrSemaphore;
|
||||
|
||||
if( pxQueueOrSemaphore->pxQueueSetContainer != xQueueSet )
|
||||
{
|
||||
/* The queue was not a member of the set. */
|
||||
xReturn = pdFAIL;
|
||||
}
|
||||
else if( pxQueueOrSemaphore->uxMessagesWaiting != ( unsigned portBASE_TYPE ) 0 )
|
||||
else if( pxQueueOrSemaphore->uxMessagesWaiting != ( UBaseType_t ) 0 )
|
||||
{
|
||||
/* It is dangerous to remove a queue from a set when the queue is
|
||||
not empty because the queue set will still hold pending events for
|
||||
|
@ -2316,11 +2316,11 @@ signed portBASE_TYPE xReturn;
|
|||
|
||||
#if ( configUSE_QUEUE_SETS == 1 )
|
||||
|
||||
xQueueSetMemberHandle xQueueSelectFromSet( xQueueSetHandle xQueueSet, portTickType const xBlockTimeTicks )
|
||||
QueueSetMember_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet, TickType_t const xBlockTimeTicks )
|
||||
{
|
||||
xQueueSetMemberHandle xReturn = NULL;
|
||||
QueueSetMember_t xReturn = NULL;
|
||||
|
||||
( void ) xQueueGenericReceive( ( xQueueHandle ) xQueueSet, &xReturn, xBlockTimeTicks, pdFALSE ); /*lint !e961 Casting from one typedef to another is not redundant. */
|
||||
( void ) xQueueGenericReceive( ( QueueHandle_t ) xQueueSet, &xReturn, xBlockTimeTicks, pdFALSE ); /*lint !e961 Casting from one typedef to another is not redundant. */
|
||||
return xReturn;
|
||||
}
|
||||
|
||||
|
@ -2329,11 +2329,11 @@ signed portBASE_TYPE xReturn;
|
|||
|
||||
#if ( configUSE_QUEUE_SETS == 1 )
|
||||
|
||||
xQueueSetMemberHandle xQueueSelectFromSetFromISR( xQueueSetHandle xQueueSet )
|
||||
QueueSetMember_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet )
|
||||
{
|
||||
xQueueSetMemberHandle xReturn = NULL;
|
||||
QueueSetMember_t xReturn = NULL;
|
||||
|
||||
( void ) xQueueReceiveFromISR( ( xQueueHandle ) xQueueSet, &xReturn, NULL ); /*lint !e961 Casting from one typedef to another is not redundant. */
|
||||
( void ) xQueueReceiveFromISR( ( QueueHandle_t ) xQueueSet, &xReturn, NULL ); /*lint !e961 Casting from one typedef to another is not redundant. */
|
||||
return xReturn;
|
||||
}
|
||||
|
||||
|
@ -2342,10 +2342,10 @@ signed portBASE_TYPE xReturn;
|
|||
|
||||
#if ( configUSE_QUEUE_SETS == 1 )
|
||||
|
||||
static portBASE_TYPE prvNotifyQueueSetContainer( const xQUEUE * const pxQueue, const portBASE_TYPE xCopyPosition )
|
||||
static BaseType_t prvNotifyQueueSetContainer( const Queue_t * const pxQueue, const BaseType_t xCopyPosition )
|
||||
{
|
||||
xQUEUE *pxQueueSetContainer = pxQueue->pxQueueSetContainer;
|
||||
portBASE_TYPE xReturn = pdFALSE;
|
||||
Queue_t *pxQueueSetContainer = pxQueue->pxQueueSetContainer;
|
||||
BaseType_t xReturn = pdFALSE;
|
||||
|
||||
configASSERT( pxQueueSetContainer );
|
||||
configASSERT( pxQueueSetContainer->uxMessagesWaiting < pxQueueSetContainer->uxLength );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue