mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-11 13:00:19 +00:00
feat(freertos/smp): Update SMP FreeRTOS files to V11.0.1
This commit updates the source files of Amazon SMP FreeRTOS to upstream V11.0.1 (https://github.com/FreeRTOS/FreeRTOS-Kernel/tree/V11.0.1). This version contains SMP support.
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
/*
|
||||
* FreeRTOS SMP Kernel V202110.00
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* FreeRTOS Kernel V11.0.1
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2021 Amazon.com, Inc. or its affiliates
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* SPDX-FileContributor: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* 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 +83,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 +117,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
* returned.
|
||||
*
|
||||
* Example usage:
|
||||
* <pre>
|
||||
* @code{c}
|
||||
* struct AMessage
|
||||
* {
|
||||
* char ucMessageID;
|
||||
@@ -139,7 +145,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
*
|
||||
* // ... Rest of task code.
|
||||
* }
|
||||
* </pre>
|
||||
* @endcode
|
||||
* \defgroup xQueueCreate xQueueCreate
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
@@ -149,14 +155,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 +186,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 +199,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 +218,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 +231,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
*
|
||||
* // ... Rest of task code.
|
||||
* }
|
||||
* </pre>
|
||||
* @endcode
|
||||
* \defgroup xQueueCreateStatic xQueueCreateStatic
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
@@ -264,13 +270,13 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
|
||||
/**
|
||||
* queue. h
|
||||
* <pre>
|
||||
* BaseType_t xQueueSendToToFront(
|
||||
* @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
|
||||
@@ -293,7 +299,7 @@ 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;
|
||||
@@ -336,7 +342,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
*
|
||||
* // ... Rest of task code.
|
||||
* }
|
||||
* </pre>
|
||||
* @endcode
|
||||
* \defgroup xQueueSend xQueueSend
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
@@ -345,13 +351,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().
|
||||
*
|
||||
@@ -376,7 +382,7 @@ 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;
|
||||
@@ -419,7 +425,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
*
|
||||
* // ... Rest of task code.
|
||||
* }
|
||||
* </pre>
|
||||
* @endcode
|
||||
* \defgroup xQueueSend xQueueSend
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
@@ -428,13 +434,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
|
||||
@@ -461,7 +467,7 @@ 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;
|
||||
@@ -504,7 +510,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
*
|
||||
* // ... Rest of task code.
|
||||
* }
|
||||
* </pre>
|
||||
* @endcode
|
||||
* \defgroup xQueueSend xQueueSend
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
@@ -513,12 +519,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.
|
||||
@@ -542,7 +548,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 )
|
||||
* {
|
||||
@@ -588,7 +594,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
*
|
||||
* // ...
|
||||
* }
|
||||
* </pre>
|
||||
* @endcode
|
||||
* \defgroup xQueueOverwrite xQueueOverwrite
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
@@ -598,14 +604,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.
|
||||
@@ -634,7 +640,7 @@ 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;
|
||||
@@ -677,7 +683,7 @@ typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||
*
|
||||
* // ... Rest of task code.
|
||||
* }
|
||||
* </pre>
|
||||
* @endcode
|
||||
* \defgroup xQueueSend xQueueSend
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
@@ -688,13 +694,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
|
||||
@@ -725,7 +731,7 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
|
||||
* otherwise pdFALSE.
|
||||
*
|
||||
* Example usage:
|
||||
* <pre>
|
||||
* @code{c}
|
||||
* struct AMessage
|
||||
* {
|
||||
* char ucMessageID;
|
||||
@@ -775,7 +781,7 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
|
||||
*
|
||||
* // ... Rest of task code.
|
||||
* }
|
||||
* </pre>
|
||||
* @endcode
|
||||
* \defgroup xQueuePeek xQueuePeek
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
@@ -785,12 +791,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).
|
||||
@@ -820,13 +826,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
|
||||
@@ -854,7 +860,7 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue,
|
||||
* otherwise pdFALSE.
|
||||
*
|
||||
* Example usage:
|
||||
* <pre>
|
||||
* @code{c}
|
||||
* struct AMessage
|
||||
* {
|
||||
* char ucMessageID;
|
||||
@@ -904,7 +910,7 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue,
|
||||
*
|
||||
* // ... Rest of task code.
|
||||
* }
|
||||
* </pre>
|
||||
* @endcode
|
||||
* \defgroup xQueueReceive xQueueReceive
|
||||
* \ingroup QueueManagement
|
||||
*/
|
||||
@@ -914,9 +920,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.
|
||||
*
|
||||
@@ -931,9 +937,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
|
||||
@@ -950,9 +956,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.
|
||||
@@ -966,13 +972,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().
|
||||
*
|
||||
@@ -993,7 +999,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
|
||||
@@ -1001,11 +1007,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;
|
||||
@@ -1027,7 +1033,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
* taskYIELD ();
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
* @endcode
|
||||
*
|
||||
* \defgroup xQueueSendFromISR xQueueSendFromISR
|
||||
* \ingroup QueueManagement
|
||||
@@ -1038,13 +1044,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().
|
||||
*
|
||||
@@ -1073,7 +1079,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;
|
||||
@@ -1099,7 +1105,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
* taskYIELD ();
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
* @endcode
|
||||
*
|
||||
* \defgroup xQueueSendFromISR xQueueSendFromISR
|
||||
* \ingroup QueueManagement
|
||||
@@ -1109,13 +1115,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).
|
||||
@@ -1146,7 +1152,7 @@ void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||
* the queue is already full.
|
||||
*
|
||||
* Example usage:
|
||||
* <pre>
|
||||
* @code{c}
|
||||
*
|
||||
* QueueHandle_t xQueue;
|
||||
*
|
||||
@@ -1183,12 +1189,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
|
||||
*/
|
||||
@@ -1197,13 +1206,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
|
||||
@@ -1235,7 +1244,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;
|
||||
@@ -1258,11 +1267,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
|
||||
@@ -1272,14 +1284,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
|
||||
@@ -1315,7 +1327,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;
|
||||
@@ -1335,14 +1347,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
|
||||
@@ -1356,13 +1371,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.
|
||||
@@ -1373,16 +1388,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;
|
||||
*
|
||||
@@ -1427,17 +1442,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
|
||||
*/
|
||||
@@ -1447,12 +1462,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
|
||||
@@ -1462,18 +1479,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(),
|
||||
@@ -1481,17 +1500,30 @@ 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
|
||||
@@ -1505,7 +1537,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
|
||||
@@ -1517,21 +1549,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
|
||||
|
||||
/*
|
||||
@@ -1560,7 +1596,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
|
||||
|
||||
/*
|
||||
@@ -1647,7 +1683,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
|
||||
@@ -1671,8 +1709,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
|
||||
@@ -1691,8 +1731,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
|
||||
@@ -1728,13 +1770,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,
|
||||
@@ -1742,11 +1788,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
|
||||
|
Reference in New Issue
Block a user