Update uncrustify configuration and improve CI setup (see FreeRTOS/FreeRTOS-Kernel/pull/445) (#782)

* pin uncrustify version and update configuration file

* Update AbortDelay.c

* Update BlockQ.c

* Update MessageBufferDemo.c

* Update QPeek.c

* Update StaticAllocation.c

* Update integer.c

* Update recmutex.c

* Update create.c

* Update prvCopyDataToQueue.c

* Update prvUnlockQueue.c

* Update vQueueDelete.c

* Update xQueueGenericSend.c

* Update xQueueGenericSendFromISR.c

* Update xQueuePeek.c

* Update xQueueReceive.c

* Update IntSemTest.c

* Update dynamic.c

* Update lexicon.txt

Co-authored-by: alfred gedeon <28123637+alfred2g@users.noreply.github.com>
This commit is contained in:
swaldhoer
2022-02-04 22:37:42 +01:00
committed by GitHub
parent fea193d03c
commit 2b956b97c7
23 changed files with 1090 additions and 576 deletions

View File

@@ -30,7 +30,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install Uncrustify - name: Install Uncrustify
run: sudo apt-get install uncrustify run: sudo apt-get install uncrustify=0.69.0+dfsg1-1build1
- name: Run Uncrustify - name: Run Uncrustify
run: | run: |
uncrustify --version uncrustify --version

View File

@@ -20,7 +20,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* https://www.FreeRTOS.org * https://www.FreeRTOS.org
* https://aws.amazon.com/freertos * https://github.com/FreeRTOS
* *
*/ */
@@ -420,18 +420,18 @@
EventBits_t xBitsToWaitFor = ( EventBits_t ) 0x01, xReturn; EventBits_t xBitsToWaitFor = ( EventBits_t ) 0x01, xReturn;
#if ( configSUPPORT_STATIC_ALLOCATION == 1 ) #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
{ {
static StaticEventGroup_t xEventGroupBuffer; static StaticEventGroup_t xEventGroupBuffer;
/* Create the event group. Statically allocated memory is used so the /* Create the event group. Statically allocated memory is used so the
* creation cannot fail. */ * creation cannot fail. */
xEventGroup = xEventGroupCreateStatic( &xEventGroupBuffer ); xEventGroup = xEventGroupCreateStatic( &xEventGroupBuffer );
} }
#else #else
{ {
xEventGroup = xEventGroupCreate(); xEventGroup = xEventGroupCreate();
configASSERT( xEventGroup ); configASSERT( xEventGroup );
} }
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */ #endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
/* Note the time before the delay so the length of the delay is known. */ /* Note the time before the delay so the length of the delay is known. */
@@ -488,25 +488,25 @@
uint8_t uxRxData; uint8_t uxRxData;
#if ( configSUPPORT_STATIC_ALLOCATION == 1 ) #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
{ {
/* Defines the memory that will actually hold the streams within the /* Defines the memory that will actually hold the streams within the
* stream buffer. */ * stream buffer. */
static uint8_t ucStorageBuffer[ sizeof( configMESSAGE_BUFFER_LENGTH_TYPE ) + 1 ]; static uint8_t ucStorageBuffer[ sizeof( configMESSAGE_BUFFER_LENGTH_TYPE ) + 1 ];
/* The variable used to hold the stream buffer structure. */ /* The variable used to hold the stream buffer structure. */
StaticStreamBuffer_t xStreamBufferStruct; StaticStreamBuffer_t xStreamBufferStruct;
xStreamBuffer = xStreamBufferCreateStatic( sizeof( ucStorageBuffer ), xStreamBuffer = xStreamBufferCreateStatic( sizeof( ucStorageBuffer ),
xTriggerLevelBytes, xTriggerLevelBytes,
ucStorageBuffer, ucStorageBuffer,
&xStreamBufferStruct ); &xStreamBufferStruct );
} }
#else /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */ #else /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
{ {
xStreamBuffer = xStreamBufferCreate( sizeof( uint8_t ), xTriggerLevelBytes ); xStreamBuffer = xStreamBufferCreate( sizeof( uint8_t ), xTriggerLevelBytes );
configASSERT( xStreamBuffer ); configASSERT( xStreamBuffer );
} }
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */ #endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
/* Note the time before the delay so the length of the delay is known. */ /* Note the time before the delay so the length of the delay is known. */
@@ -563,19 +563,19 @@
uint8_t ucItemToQueue; uint8_t ucItemToQueue;
#if ( configSUPPORT_STATIC_ALLOCATION == 1 ) #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
{ {
static StaticQueue_t xQueueBuffer; static StaticQueue_t xQueueBuffer;
static uint8_t ucQueueStorage[ sizeof( uint8_t ) ]; static uint8_t ucQueueStorage[ sizeof( uint8_t ) ];
/* Create the queue. Statically allocated memory is used so the /* Create the queue. Statically allocated memory is used so the
* creation cannot fail. */ * creation cannot fail. */
xQueue = xQueueCreateStatic( xQueueLength, sizeof( uint8_t ), ucQueueStorage, &xQueueBuffer ); xQueue = xQueueCreateStatic( xQueueLength, sizeof( uint8_t ), ucQueueStorage, &xQueueBuffer );
} }
#else #else
{ {
xQueue = xQueueCreate( xQueueLength, sizeof( uint8_t ) ); xQueue = xQueueCreate( xQueueLength, sizeof( uint8_t ) );
configASSERT( xQueue ); configASSERT( xQueue );
} }
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */ #endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
/* This function tests aborting when in the blocked state waiting to send, /* This function tests aborting when in the blocked state waiting to send,
@@ -639,17 +639,17 @@
SemaphoreHandle_t xSemaphore; SemaphoreHandle_t xSemaphore;
#if ( configSUPPORT_STATIC_ALLOCATION == 1 ) #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
{ {
static StaticSemaphore_t xSemaphoreBuffer; static StaticSemaphore_t xSemaphoreBuffer;
/* Create the semaphore. Statically allocated memory is used so the /* Create the semaphore. Statically allocated memory is used so the
* creation cannot fail. */ * creation cannot fail. */
xSemaphore = xSemaphoreCreateBinaryStatic( &xSemaphoreBuffer ); xSemaphore = xSemaphoreCreateBinaryStatic( &xSemaphoreBuffer );
} }
#else #else
{ {
xSemaphore = xSemaphoreCreateBinary(); xSemaphore = xSemaphoreCreateBinary();
} }
#endif #endif
/* Note the time before the delay so the length of the delay is known. */ /* Note the time before the delay so the length of the delay is known. */

View File

@@ -20,7 +20,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* https://www.FreeRTOS.org * https://www.FreeRTOS.org
* https://aws.amazon.com/freertos * https://github.com/FreeRTOS
* *
*/ */
@@ -242,12 +242,12 @@ static portTASK_FUNCTION( vBlockingQueueConsumer, pvParameters )
} }
#if configUSE_PREEMPTION == 0 #if configUSE_PREEMPTION == 0
{
if( pxQueueParameters->xBlockTime == 0 )
{ {
if( pxQueueParameters->xBlockTime == 0 ) taskYIELD();
{
taskYIELD();
}
} }
}
#endif #endif
} }
} }

View File

@@ -192,9 +192,9 @@ void vStartGenericQueueTasks( UBaseType_t uxPriority )
/* If INCLUDE_xTaskAbortDelay is set then additional tests are performed, /* If INCLUDE_xTaskAbortDelay is set then additional tests are performed,
* requiring two instances of prvHighPriorityMutexTask(). */ * requiring two instances of prvHighPriorityMutexTask(). */
#if ( INCLUDE_xTaskAbortDelay == 1 ) #if ( INCLUDE_xTaskAbortDelay == 1 )
{ {
xTaskCreate( prvHighPriorityMutexTask, "MuHigh2", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_MEDIUM_PRIORITY, &xSecondMediumPriorityMutexTask ); xTaskCreate( prvHighPriorityMutexTask, "MuHigh2", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_MEDIUM_PRIORITY, &xSecondMediumPriorityMutexTask );
} }
#endif /* INCLUDE_xTaskAbortDelay */ #endif /* INCLUDE_xTaskAbortDelay */
} }
} }
@@ -679,9 +679,9 @@ static void prvTakeTwoMutexesReturnInDifferentOrder( SemaphoreHandle_t xMutex,
/* Ensure the task is reporting its priority as blocked and not /* Ensure the task is reporting its priority as blocked and not
* suspended (as it would have done in versions up to V7.5.3). */ * suspended (as it would have done in versions up to V7.5.3). */
#if ( INCLUDE_eTaskGetState == 1 ) #if ( INCLUDE_eTaskGetState == 1 )
{ {
configASSERT( eTaskGetState( xHighPriorityMutexTask ) == eBlocked ); configASSERT( eTaskGetState( xHighPriorityMutexTask ) == eBlocked );
} }
#endif /* INCLUDE_eTaskGetState */ #endif /* INCLUDE_eTaskGetState */
/* This task should now have inherited the priority of the high priority /* This task should now have inherited the priority of the high priority
@@ -812,9 +812,9 @@ static void prvTakeTwoMutexesReturnInSameOrder( SemaphoreHandle_t xMutex,
/* Ensure the task is reporting its priority as blocked and not /* Ensure the task is reporting its priority as blocked and not
* suspended (as it would have done in versions up to V7.5.3). */ * suspended (as it would have done in versions up to V7.5.3). */
#if ( INCLUDE_eTaskGetState == 1 ) #if ( INCLUDE_eTaskGetState == 1 )
{ {
configASSERT( eTaskGetState( xHighPriorityMutexTask ) == eBlocked ); configASSERT( eTaskGetState( xHighPriorityMutexTask ) == eBlocked );
} }
#endif /* INCLUDE_eTaskGetState */ #endif /* INCLUDE_eTaskGetState */
/* This task should now have inherited the priority of the high priority /* This task should now have inherited the priority of the high priority
@@ -943,12 +943,12 @@ static void prvLowPriorityMutexTask( void * pvParameters )
#endif #endif
#if ( INCLUDE_xTaskAbortDelay == 1 ) #if ( INCLUDE_xTaskAbortDelay == 1 )
{ {
/* Tests the behaviour when a low priority task inherits the /* Tests the behaviour when a low priority task inherits the
* priority of a high priority task only for the high priority task to * priority of a high priority task only for the high priority task to
* timeout before obtaining the mutex. */ * timeout before obtaining the mutex. */
prvHighPriorityTimeout( xMutex ); prvHighPriorityTimeout( xMutex );
} }
#endif #endif
} }
} }

View File

@@ -20,7 +20,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* https://www.FreeRTOS.org * https://www.FreeRTOS.org
* https://aws.amazon.com/freertos * https://github.com/FreeRTOS
* *
*/ */
@@ -177,9 +177,9 @@ static void prvTakeAndGiveInTheSameOrder( void )
/* Ensure the slave is suspended, and that this task is running at the /* Ensure the slave is suspended, and that this task is running at the
* lower priority as expected as the start conditions. */ * lower priority as expected as the start conditions. */
#if ( INCLUDE_eTaskGetState == 1 ) #if ( INCLUDE_eTaskGetState == 1 )
{ {
configASSERT( eTaskGetState( xSlaveHandle ) == eSuspended ); configASSERT( eTaskGetState( xSlaveHandle ) == eSuspended );
} }
#endif /* INCLUDE_eTaskGetState */ #endif /* INCLUDE_eTaskGetState */
if( uxTaskPriorityGet( NULL ) != intsemMASTER_PRIORITY ) if( uxTaskPriorityGet( NULL ) != intsemMASTER_PRIORITY )
@@ -200,9 +200,9 @@ static void prvTakeAndGiveInTheSameOrder( void )
/* The slave has the higher priority so should now have executed and /* The slave has the higher priority so should now have executed and
* blocked on the semaphore. */ * blocked on the semaphore. */
#if ( INCLUDE_eTaskGetState == 1 ) #if ( INCLUDE_eTaskGetState == 1 )
{ {
configASSERT( eTaskGetState( xSlaveHandle ) == eBlocked ); configASSERT( eTaskGetState( xSlaveHandle ) == eBlocked );
} }
#endif /* INCLUDE_eTaskGetState */ #endif /* INCLUDE_eTaskGetState */
/* This task should now have inherited the priority of the slave /* This task should now have inherited the priority of the slave
@@ -264,9 +264,9 @@ static void prvTakeAndGiveInTheSameOrder( void )
} }
#if ( INCLUDE_eTaskGetState == 1 ) #if ( INCLUDE_eTaskGetState == 1 )
{ {
configASSERT( eTaskGetState( xSlaveHandle ) == eSuspended ); configASSERT( eTaskGetState( xSlaveHandle ) == eSuspended );
} }
#endif /* INCLUDE_eTaskGetState */ #endif /* INCLUDE_eTaskGetState */
/* Reset the mutex ready for the next round. */ /* Reset the mutex ready for the next round. */
@@ -279,9 +279,9 @@ static void prvTakeAndGiveInTheOppositeOrder( void )
/* Ensure the slave is suspended, and that this task is running at the /* Ensure the slave is suspended, and that this task is running at the
* lower priority as expected as the start conditions. */ * lower priority as expected as the start conditions. */
#if ( INCLUDE_eTaskGetState == 1 ) #if ( INCLUDE_eTaskGetState == 1 )
{ {
configASSERT( eTaskGetState( xSlaveHandle ) == eSuspended ); configASSERT( eTaskGetState( xSlaveHandle ) == eSuspended );
} }
#endif /* INCLUDE_eTaskGetState */ #endif /* INCLUDE_eTaskGetState */
if( uxTaskPriorityGet( NULL ) != intsemMASTER_PRIORITY ) if( uxTaskPriorityGet( NULL ) != intsemMASTER_PRIORITY )
@@ -302,9 +302,9 @@ static void prvTakeAndGiveInTheOppositeOrder( void )
/* The slave has the higher priority so should now have executed and /* The slave has the higher priority so should now have executed and
* blocked on the semaphore. */ * blocked on the semaphore. */
#if ( INCLUDE_eTaskGetState == 1 ) #if ( INCLUDE_eTaskGetState == 1 )
{ {
configASSERT( eTaskGetState( xSlaveHandle ) == eBlocked ); configASSERT( eTaskGetState( xSlaveHandle ) == eBlocked );
} }
#endif /* INCLUDE_eTaskGetState */ #endif /* INCLUDE_eTaskGetState */
/* This task should now have inherited the priority of the slave /* This task should now have inherited the priority of the slave

View File

@@ -20,7 +20,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* https://www.FreeRTOS.org * https://www.FreeRTOS.org
* https://aws.amazon.com/freertos * https://github.com/FreeRTOS
* *
*/ */
@@ -163,23 +163,23 @@ void vStartMessageBufferTasks( configSTACK_DEPTH_TYPE xStackSize )
xTaskCreate( prvNonBlockingSenderTask, "NonBlkTx", xStackSize, ( void * ) xMessageBuffer, tskIDLE_PRIORITY, NULL ); xTaskCreate( prvNonBlockingSenderTask, "NonBlkTx", xStackSize, ( void * ) xMessageBuffer, tskIDLE_PRIORITY, NULL );
#if ( configSUPPORT_STATIC_ALLOCATION == 1 ) #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
{ {
/* The sender tasks set up the message buffers before creating the /* The sender tasks set up the message buffers before creating the
* receiver tasks. Priorities must be 0 and 1 as the priority is used to * receiver tasks. Priorities must be 0 and 1 as the priority is used to
* index into the xStaticMessageBuffers and ucBufferStorage arrays. */ * index into the xStaticMessageBuffers and ucBufferStorage arrays. */
xTaskCreate( prvSenderTask, "1Sender", xBlockingStackSize, NULL, mbHIGHER_PRIORITY, NULL ); xTaskCreate( prvSenderTask, "1Sender", xBlockingStackSize, NULL, mbHIGHER_PRIORITY, NULL );
xTaskCreate( prvSenderTask, "2Sender", xBlockingStackSize, NULL, mbLOWER_PRIORITY, NULL ); xTaskCreate( prvSenderTask, "2Sender", xBlockingStackSize, NULL, mbLOWER_PRIORITY, NULL );
} }
#endif /* configSUPPORT_STATIC_ALLOCATION */ #endif /* configSUPPORT_STATIC_ALLOCATION */
#if ( configRUN_ADDITIONAL_TESTS == 1 ) #if ( configRUN_ADDITIONAL_TESTS == 1 )
{ {
xCoherenceTestMessageBuffer = xMessageBufferCreate( mbCOHERENCE_TEST_BUFFER_SIZE ); xCoherenceTestMessageBuffer = xMessageBufferCreate( mbCOHERENCE_TEST_BUFFER_SIZE );
configASSERT( xCoherenceTestMessageBuffer ); configASSERT( xCoherenceTestMessageBuffer );
xTaskCreate( prvSpaceAvailableCoherenceActor, "mbsanity1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); xTaskCreate( prvSpaceAvailableCoherenceActor, "mbsanity1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
xTaskCreate( prvSpaceAvailableCoherenceTester, "mbsanity2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); xTaskCreate( prvSpaceAvailableCoherenceTester, "mbsanity2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
} }
#endif #endif
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@@ -419,19 +419,19 @@ static void prvSingleTaskTests( MessageBufferHandle_t xMessageBuffer )
configASSERT( xReturned == 0 ); configASSERT( xReturned == 0 );
( void ) xReturned; /* In case configASSERT() is not defined. */ ( void ) xReturned; /* In case configASSERT() is not defined. */
#ifndef configMESSAGE_BUFFER_LENGTH_TYPE #ifndef configMESSAGE_BUFFER_LENGTH_TYPE
{ {
/* The following will fail if configMESSAGE_BUFFER_LENGTH_TYPE is set /* The following will fail if configMESSAGE_BUFFER_LENGTH_TYPE is set
* to a non 32-bit type. */ * to a non 32-bit type. */
xReturned = xMessageBufferSend( xMessageBuffer, ( const void * ) pc55ByteString, mbMESSAGE_BUFFER_LENGTH_BYTES - 1, mbDONT_BLOCK ); xReturned = xMessageBufferSend( xMessageBuffer, ( const void * ) pc55ByteString, mbMESSAGE_BUFFER_LENGTH_BYTES - 1, mbDONT_BLOCK );
configASSERT( xReturned == 0 ); configASSERT( xReturned == 0 );
( void ) xReturned; /* In case configASSERT() is not defined. */ ( void ) xReturned; /* In case configASSERT() is not defined. */
xReturned = xMessageBufferSend( xMessageBuffer, ( const void * ) pc55ByteString, mbMESSAGE_BUFFER_LENGTH_BYTES - 2, mbDONT_BLOCK ); xReturned = xMessageBufferSend( xMessageBuffer, ( const void * ) pc55ByteString, mbMESSAGE_BUFFER_LENGTH_BYTES - 2, mbDONT_BLOCK );
configASSERT( xReturned == 0 ); configASSERT( xReturned == 0 );
( void ) xReturned; /* In case configASSERT() is not defined. */ ( void ) xReturned; /* In case configASSERT() is not defined. */
xReturned = xMessageBufferSend( xMessageBuffer, ( const void * ) pc55ByteString, mbMESSAGE_BUFFER_LENGTH_BYTES - 3, mbDONT_BLOCK ); xReturned = xMessageBufferSend( xMessageBuffer, ( const void * ) pc55ByteString, mbMESSAGE_BUFFER_LENGTH_BYTES - 3, mbDONT_BLOCK );
configASSERT( xReturned == 0 ); configASSERT( xReturned == 0 );
( void ) xReturned; /* In case configASSERT() is not defined. */ ( void ) xReturned; /* In case configASSERT() is not defined. */
} }
#endif /* ifndef configMESSAGE_BUFFER_LENGTH_TYPE */ #endif /* ifndef configMESSAGE_BUFFER_LENGTH_TYPE */
/* Don't expect any messages to be available as the above were too large to /* Don't expect any messages to be available as the above were too large to
@@ -934,36 +934,36 @@ BaseType_t xAreMessageBufferTasksStillRunning( void )
} }
#if ( configSUPPORT_STATIC_ALLOCATION == 1 ) #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
{
static uint32_t ulLastSenderLoopCounters[ mbNUMBER_OF_ECHO_CLIENTS ] = { 0 };
for( x = 0; x < mbNUMBER_OF_SENDER_TASKS; x++ )
{ {
static uint32_t ulLastSenderLoopCounters[ mbNUMBER_OF_ECHO_CLIENTS ] = { 0 }; if( ulLastSenderLoopCounters[ x ] == ulSenderLoopCounters[ x ] )
for( x = 0; x < mbNUMBER_OF_SENDER_TASKS; x++ )
{
if( ulLastSenderLoopCounters[ x ] == ulSenderLoopCounters[ x ] )
{
xReturn = pdFAIL;
}
else
{
ulLastSenderLoopCounters[ x ] = ulSenderLoopCounters[ x ];
}
}
}
#endif /* configSUPPORT_STATIC_ALLOCATION */
#if ( configRUN_ADDITIONAL_TESTS == 1 )
{
static uint32_t ullastSizeCoherencyTestCycles = 0UL;
if( ullastSizeCoherencyTestCycles == ulSizeCoherencyTestCycles )
{ {
xReturn = pdFAIL; xReturn = pdFAIL;
} }
else else
{ {
ullastSizeCoherencyTestCycles = ulSizeCoherencyTestCycles; ulLastSenderLoopCounters[ x ] = ulSenderLoopCounters[ x ];
} }
} }
}
#endif /* configSUPPORT_STATIC_ALLOCATION */
#if ( configRUN_ADDITIONAL_TESTS == 1 )
{
static uint32_t ullastSizeCoherencyTestCycles = 0UL;
if( ullastSizeCoherencyTestCycles == ulSizeCoherencyTestCycles )
{
xReturn = pdFAIL;
}
else
{
ullastSizeCoherencyTestCycles = ulSizeCoherencyTestCycles;
}
}
#endif /* if ( configRUN_ADDITIONAL_TESTS == 1 ) */ #endif /* if ( configRUN_ADDITIONAL_TESTS == 1 ) */
return xReturn; return xReturn;

View File

@@ -20,7 +20,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* https://www.FreeRTOS.org * https://www.FreeRTOS.org
* https://aws.amazon.com/freertos * https://github.com/FreeRTOS
* *
*/ */
@@ -111,14 +111,14 @@ static void prvHighestPriorityPeekTask( void * pvParameters )
uint32_t ulValue; uint32_t ulValue;
#ifdef USE_STDIO #ifdef USE_STDIO
{ {
void vPrintDisplayMessage( const char * const * ppcMessageToSend ); void vPrintDisplayMessage( const char * const * ppcMessageToSend );
const char * const pcTaskStartMsg = "Queue peek test started.\r\n"; const char * const pcTaskStartMsg = "Queue peek test started.\r\n";
/* Queue a message for printing to say the task has started. */ /* Queue a message for printing to say the task has started. */
vPrintDisplayMessage( &pcTaskStartMsg ); vPrintDisplayMessage( &pcTaskStartMsg );
} }
#endif #endif
for( ; ; ) for( ; ; )

View File

@@ -20,7 +20,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* https://www.FreeRTOS.org * https://www.FreeRTOS.org
* https://aws.amazon.com/freertos * https://github.com/FreeRTOS
* *
*/ */
@@ -286,15 +286,15 @@
vSemaphoreDelete( xSemaphore ); vSemaphoreDelete( xSemaphore );
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
{ {
/* Now do the same but using dynamically allocated buffers to ensure the /* Now do the same but using dynamically allocated buffers to ensure the
* delete functions are working correctly in both the static and dynamic * delete functions are working correctly in both the static and dynamic
* allocation cases. */ * allocation cases. */
xSemaphore = xSemaphoreCreateCounting( uxMaxCount, 0 ); xSemaphore = xSemaphoreCreateCounting( uxMaxCount, 0 );
configASSERT( xSemaphore != NULL ); configASSERT( xSemaphore != NULL );
prvSanityCheckCreatedSemaphore( xSemaphore, uxMaxCount ); prvSanityCheckCreatedSemaphore( xSemaphore, uxMaxCount );
vSemaphoreDelete( xSemaphore ); vSemaphoreDelete( xSemaphore );
} }
#endif #endif
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@@ -335,12 +335,12 @@
* functions are working correctly in both the static and dynamic memory * functions are working correctly in both the static and dynamic memory
* allocation cases. */ * allocation cases. */
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
{ {
xSemaphore = xSemaphoreCreateRecursiveMutex(); xSemaphore = xSemaphoreCreateRecursiveMutex();
configASSERT( xSemaphore != NULL ); configASSERT( xSemaphore != NULL );
prvSanityCheckCreatedRecursiveMutex( xSemaphore ); prvSanityCheckCreatedRecursiveMutex( xSemaphore );
vSemaphoreDelete( xSemaphore ); vSemaphoreDelete( xSemaphore );
} }
#endif #endif
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@@ -390,20 +390,20 @@
* function is working correctly in both the static and dynamic memory * function is working correctly in both the static and dynamic memory
* allocation cases. */ * allocation cases. */
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
{ {
xQueue = xQueueCreate( staticQUEUE_LENGTH_IN_ITEMS, /* The maximum number of items the queue can hold. */ xQueue = xQueueCreate( staticQUEUE_LENGTH_IN_ITEMS, /* The maximum number of items the queue can hold. */
sizeof( uint64_t ) ); /* The size of each item. */ sizeof( uint64_t ) ); /* The size of each item. */
/* The queue handle should equal the static queue structure passed into the /* The queue handle should equal the static queue structure passed into the
* xQueueCreateStatic() function. */ * xQueueCreateStatic() function. */
configASSERT( xQueue != NULL ); configASSERT( xQueue != NULL );
/* Ensure the queue passes a few sanity checks as a valid queue. */ /* Ensure the queue passes a few sanity checks as a valid queue. */
prvSanityCheckCreatedQueue( xQueue ); prvSanityCheckCreatedQueue( xQueue );
/* Delete the queue again so the buffers can be reused. */ /* Delete the queue again so the buffers can be reused. */
vQueueDelete( xQueue ); vQueueDelete( xQueue );
} }
#endif /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */ #endif /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@@ -453,28 +453,28 @@
* function is working correctly in both the static and dynamic allocation * function is working correctly in both the static and dynamic allocation
* cases. */ * cases. */
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
{
xSemaphore = xSemaphoreCreateMutex();
/* The semaphore handle should equal the static semaphore structure
* passed into the xSemaphoreCreateMutexStatic() function. */
configASSERT( xSemaphore != NULL );
/* Take the mutex so the mutex is in the state expected by the
* prvSanityCheckCreatedSemaphore() function. */
xReturned = xSemaphoreTake( xSemaphore, staticDONT_BLOCK );
if( xReturned != pdPASS )
{ {
xSemaphore = xSemaphoreCreateMutex(); xErrorOccurred = pdTRUE;
/* The semaphore handle should equal the static semaphore structure
* passed into the xSemaphoreCreateMutexStatic() function. */
configASSERT( xSemaphore != NULL );
/* Take the mutex so the mutex is in the state expected by the
* prvSanityCheckCreatedSemaphore() function. */
xReturned = xSemaphoreTake( xSemaphore, staticDONT_BLOCK );
if( xReturned != pdPASS )
{
xErrorOccurred = pdTRUE;
}
/* Ensure the semaphore passes a few sanity checks as a valid semaphore. */
prvSanityCheckCreatedSemaphore( xSemaphore, staticBINARY_SEMAPHORE_MAX_COUNT );
/* Delete the semaphore again so the buffers can be reused. */
vSemaphoreDelete( xSemaphore );
} }
/* Ensure the semaphore passes a few sanity checks as a valid semaphore. */
prvSanityCheckCreatedSemaphore( xSemaphore, staticBINARY_SEMAPHORE_MAX_COUNT );
/* Delete the semaphore again so the buffers can be reused. */
vSemaphoreDelete( xSemaphore );
}
#endif /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */ #endif /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@@ -516,31 +516,31 @@
* delete function is working correctly in both the static and dynamic * delete function is working correctly in both the static and dynamic
* allocation cases. */ * allocation cases. */
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
{ {
xSemaphore = xSemaphoreCreateBinary(); xSemaphore = xSemaphoreCreateBinary();
configASSERT( xSemaphore != NULL ); configASSERT( xSemaphore != NULL );
prvSanityCheckCreatedSemaphore( xSemaphore, staticBINARY_SEMAPHORE_MAX_COUNT ); prvSanityCheckCreatedSemaphore( xSemaphore, staticBINARY_SEMAPHORE_MAX_COUNT );
vSemaphoreDelete( xSemaphore ); vSemaphoreDelete( xSemaphore );
} }
#endif #endif
/* There isn't a static version of the old and deprecated /* There isn't a static version of the old and deprecated
* vSemaphoreCreateBinary() macro (because its deprecated!), but check it is * vSemaphoreCreateBinary() macro (because its deprecated!), but check it is
* still functioning correctly. */ * still functioning correctly. */
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
{
vSemaphoreCreateBinary( xSemaphore );
/* The macro starts with the binary semaphore available, but the test
* function expects it to be unavailable. */
if( xSemaphoreTake( xSemaphore, staticDONT_BLOCK ) == pdFAIL )
{ {
vSemaphoreCreateBinary( xSemaphore ); xErrorOccurred = pdTRUE;
/* The macro starts with the binary semaphore available, but the test
* function expects it to be unavailable. */
if( xSemaphoreTake( xSemaphore, staticDONT_BLOCK ) == pdFAIL )
{
xErrorOccurred = pdTRUE;
}
prvSanityCheckCreatedSemaphore( xSemaphore, staticBINARY_SEMAPHORE_MAX_COUNT );
vSemaphoreDelete( xSemaphore );
} }
prvSanityCheckCreatedSemaphore( xSemaphore, staticBINARY_SEMAPHORE_MAX_COUNT );
vSemaphoreDelete( xSemaphore );
}
#endif /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */ #endif /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@@ -644,37 +644,37 @@
* the delete function is working correctly in both the static and dynamic * the delete function is working correctly in both the static and dynamic
* allocation cases. */ * allocation cases. */
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
{
xTimer = xTimerCreate( "T1", /* Text name for the task. Helps debugging only. Not used by FreeRTOS. */
xTimerPeriod, /* The period of the timer in ticks. */
pdTRUE, /* This is an auto-reload timer. */
( void * ) &uxVariableToIncrement, /* The variable incremented by the test is passed into the timer callback using the timer ID. */
prvTimerCallback ); /* The function to execute when the timer expires. */
configASSERT( xTimer != NULL );
uxVariableToIncrement = 0;
xReturned = xTimerStart( xTimer, staticDONT_BLOCK );
if( xReturned != pdPASS )
{ {
xTimer = xTimerCreate( "T1", /* Text name for the task. Helps debugging only. Not used by FreeRTOS. */ xErrorOccurred = pdTRUE;
xTimerPeriod, /* The period of the timer in ticks. */
pdTRUE, /* This is an auto-reload timer. */
( void * ) &uxVariableToIncrement, /* The variable incremented by the test is passed into the timer callback using the timer ID. */
prvTimerCallback ); /* The function to execute when the timer expires. */
configASSERT( xTimer != NULL );
uxVariableToIncrement = 0;
xReturned = xTimerStart( xTimer, staticDONT_BLOCK );
if( xReturned != pdPASS )
{
xErrorOccurred = pdTRUE;
}
vTaskDelay( xTimerPeriod * staticMAX_TIMER_CALLBACK_EXECUTIONS );
if( uxVariableToIncrement != staticMAX_TIMER_CALLBACK_EXECUTIONS )
{
xErrorOccurred = pdTRUE;
}
xReturned = xTimerDelete( xTimer, staticDONT_BLOCK );
if( xReturned != pdPASS )
{
xErrorOccurred = pdTRUE;
}
} }
vTaskDelay( xTimerPeriod * staticMAX_TIMER_CALLBACK_EXECUTIONS );
if( uxVariableToIncrement != staticMAX_TIMER_CALLBACK_EXECUTIONS )
{
xErrorOccurred = pdTRUE;
}
xReturned = xTimerDelete( xTimer, staticDONT_BLOCK );
if( xReturned != pdPASS )
{
xErrorOccurred = pdTRUE;
}
}
#endif /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */ #endif /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@@ -713,12 +713,12 @@
* delete function is working correctly in both the static and dynamic * delete function is working correctly in both the static and dynamic
* allocation cases. */ * allocation cases. */
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
{ {
xEventGroup = xEventGroupCreate(); xEventGroup = xEventGroupCreate();
configASSERT( xEventGroup != NULL ); configASSERT( xEventGroup != NULL );
prvSanityCheckCreatedEventGroup( xEventGroup ); prvSanityCheckCreatedEventGroup( xEventGroup );
vEventGroupDelete( xEventGroup ); vEventGroupDelete( xEventGroup );
} }
#endif #endif
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@@ -774,31 +774,31 @@
* function is working correctly in both the static and dynamic allocation * function is working correctly in both the static and dynamic allocation
* cases. */ * cases. */
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
{
BaseType_t xReturned;
xReturned = xTaskCreate(
prvStaticallyAllocatedTask, /* Function that implements the task - the same function is used but is actually dynamically allocated this time. */
"Static", /* Human readable name for the task. */
configMINIMAL_STACK_SIZE, /* Task's stack size, in words (not bytes!). */
NULL, /* Parameter to pass into the task. */
uxTaskPriorityGet( NULL ) + 1, /* The priority of the task. */
&xCreatedTask ); /* Handle of the task being created. */
if( eTaskGetState( xCreatedTask ) != eSuspended )
{ {
BaseType_t xReturned; xErrorOccurred = pdTRUE;
xReturned = xTaskCreate(
prvStaticallyAllocatedTask, /* Function that implements the task - the same function is used but is actually dynamically allocated this time. */
"Static", /* Human readable name for the task. */
configMINIMAL_STACK_SIZE, /* Task's stack size, in words (not bytes!). */
NULL, /* Parameter to pass into the task. */
uxTaskPriorityGet( NULL ) + 1, /* The priority of the task. */
&xCreatedTask ); /* Handle of the task being created. */
if( eTaskGetState( xCreatedTask ) != eSuspended )
{
xErrorOccurred = pdTRUE;
}
configASSERT( xReturned == pdPASS );
if( xReturned != pdPASS )
{
xErrorOccurred = pdTRUE;
}
vTaskDelete( xCreatedTask );
} }
configASSERT( xReturned == pdPASS );
if( xReturned != pdPASS )
{
xErrorOccurred = pdTRUE;
}
vTaskDelete( xCreatedTask );
}
#endif /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */ #endif /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/

View File

@@ -204,13 +204,13 @@ void vStartStreamBufferTasks( void )
xTaskCreate( prvInterruptTriggerLevelTest, "StrTrig", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL ); xTaskCreate( prvInterruptTriggerLevelTest, "StrTrig", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL );
#if ( configSUPPORT_STATIC_ALLOCATION == 1 ) #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
{ {
/* The sender tasks set up the stream buffers before creating the /* The sender tasks set up the stream buffers before creating the
* receiver tasks. Priorities must be 0 and 1 as the priority is used to * receiver tasks. Priorities must be 0 and 1 as the priority is used to
* index into the xStaticStreamBuffers and ucBufferStorage arrays. */ * index into the xStaticStreamBuffers and ucBufferStorage arrays. */
xTaskCreate( prvSenderTask, "Str1Sender", sbSMALLER_STACK_SIZE, NULL, sbHIGHER_PRIORITY, NULL ); xTaskCreate( prvSenderTask, "Str1Sender", sbSMALLER_STACK_SIZE, NULL, sbHIGHER_PRIORITY, NULL );
xTaskCreate( prvSenderTask, "Str2Sender", sbSMALLER_STACK_SIZE, NULL, sbLOWER_PRIORITY, NULL ); xTaskCreate( prvSenderTask, "Str2Sender", sbSMALLER_STACK_SIZE, NULL, sbLOWER_PRIORITY, NULL );
} }
#endif /* configSUPPORT_STATIC_ALLOCATION */ #endif /* configSUPPORT_STATIC_ALLOCATION */
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@@ -1225,21 +1225,21 @@ BaseType_t xAreStreamBufferTasksStillRunning( void )
} }
#if ( configSUPPORT_STATIC_ALLOCATION == 1 ) #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
{ {
static uint32_t ulLastSenderLoopCounters[ sbNUMBER_OF_ECHO_CLIENTS ] = { 0 }; static uint32_t ulLastSenderLoopCounters[ sbNUMBER_OF_ECHO_CLIENTS ] = { 0 };
for( x = 0; x < sbNUMBER_OF_SENDER_TASKS; x++ ) for( x = 0; x < sbNUMBER_OF_SENDER_TASKS; x++ )
{
if( ulLastSenderLoopCounters[ x ] == ulSenderLoopCounters[ x ] )
{ {
if( ulLastSenderLoopCounters[ x ] == ulSenderLoopCounters[ x ] ) xErrorStatus = pdFAIL;
{ }
xErrorStatus = pdFAIL; else
} {
else ulLastSenderLoopCounters[ x ] = ulSenderLoopCounters[ x ];
{
ulLastSenderLoopCounters[ x ] = ulSenderLoopCounters[ x ];
}
} }
} }
}
#endif /* configSUPPORT_STATIC_ALLOCATION */ #endif /* configSUPPORT_STATIC_ALLOCATION */
return xErrorStatus; return xErrorStatus;

View File

@@ -20,7 +20,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* https://www.FreeRTOS.org * https://www.FreeRTOS.org
* https://aws.amazon.com/freertos * https://github.com/FreeRTOS
* *
*/ */
@@ -264,9 +264,9 @@ static portTASK_FUNCTION( vCounterControlTask, pvParameters )
vTaskSuspend( xContinuousIncrementHandle ); vTaskSuspend( xContinuousIncrementHandle );
{ {
#if ( INCLUDE_eTaskGetState == 1 ) #if ( INCLUDE_eTaskGetState == 1 )
{ {
configASSERT( eTaskGetState( xContinuousIncrementHandle ) == eSuspended ); configASSERT( eTaskGetState( xContinuousIncrementHandle ) == eSuspended );
} }
#endif /* INCLUDE_eTaskGetState */ #endif /* INCLUDE_eTaskGetState */
ulLastCounter = ulCounter; ulLastCounter = ulCounter;
@@ -278,9 +278,9 @@ static portTASK_FUNCTION( vCounterControlTask, pvParameters )
#endif #endif
#if ( INCLUDE_eTaskGetState == 1 ) #if ( INCLUDE_eTaskGetState == 1 )
{ {
configASSERT( eTaskGetState( xContinuousIncrementHandle ) == eReady ); configASSERT( eTaskGetState( xContinuousIncrementHandle ) == eReady );
} }
#endif /* INCLUDE_eTaskGetState */ #endif /* INCLUDE_eTaskGetState */
/* Now delay to ensure the other task has processor time. */ /* Now delay to ensure the other task has processor time. */
@@ -311,9 +311,9 @@ static portTASK_FUNCTION( vCounterControlTask, pvParameters )
ulCounter = ( uint32_t ) 0; ulCounter = ( uint32_t ) 0;
#if ( INCLUDE_eTaskGetState == 1 ) #if ( INCLUDE_eTaskGetState == 1 )
{ {
configASSERT( eTaskGetState( xLimitedIncrementHandle ) == eSuspended ); configASSERT( eTaskGetState( xLimitedIncrementHandle ) == eSuspended );
} }
#endif /* INCLUDE_eTaskGetState */ #endif /* INCLUDE_eTaskGetState */
/* Resume the limited count task which has a higher priority than us. /* Resume the limited count task which has a higher priority than us.
@@ -328,9 +328,9 @@ static portTASK_FUNCTION( vCounterControlTask, pvParameters )
/* This task should not run again until xLimitedIncrementHandle has /* This task should not run again until xLimitedIncrementHandle has
* suspended itself. */ * suspended itself. */
#if ( INCLUDE_eTaskGetState == 1 ) #if ( INCLUDE_eTaskGetState == 1 )
{ {
configASSERT( eTaskGetState( xLimitedIncrementHandle ) == eSuspended ); configASSERT( eTaskGetState( xLimitedIncrementHandle ) == eSuspended );
} }
#endif /* INCLUDE_eTaskGetState */ #endif /* INCLUDE_eTaskGetState */
/* Does the counter variable have the expected value? */ /* Does the counter variable have the expected value? */
@@ -415,9 +415,9 @@ static portTASK_FUNCTION( vQueueReceiveWhenSuspendedTask, pvParameters )
xTaskResumeAll(); xTaskResumeAll();
#if configUSE_PREEMPTION == 0 #if configUSE_PREEMPTION == 0
{ {
taskYIELD(); taskYIELD();
} }
#endif #endif
} while( xGotValue == pdFALSE ); } while( xGotValue == pdFALSE );

View File

@@ -20,7 +20,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* https://www.FreeRTOS.org * https://www.FreeRTOS.org
* https://aws.amazon.com/freertos * https://github.com/FreeRTOS
* *
*/ */
@@ -99,9 +99,9 @@ static portTASK_FUNCTION( vCompeteingIntMathTask, pvParameters )
/* Yield in case cooperative scheduling is being used. */ /* Yield in case cooperative scheduling is being used. */
#if configUSE_PREEMPTION == 0 #if configUSE_PREEMPTION == 0
{ {
taskYIELD(); taskYIELD();
} }
#endif #endif
/* Finish off the calculation. */ /* Finish off the calculation. */
@@ -128,9 +128,9 @@ static portTASK_FUNCTION( vCompeteingIntMathTask, pvParameters )
/* Yield in case cooperative scheduling is being used. */ /* Yield in case cooperative scheduling is being used. */
#if configUSE_PREEMPTION == 0 #if configUSE_PREEMPTION == 0
{ {
taskYIELD(); taskYIELD();
} }
#endif #endif
} }
} }

View File

@@ -20,7 +20,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* https://www.FreeRTOS.org * https://www.FreeRTOS.org
* https://aws.amazon.com/freertos * https://github.com/FreeRTOS
* *
*/ */
@@ -281,10 +281,10 @@ static void prvRecursiveMutexPollingTask( void * pvParameters )
if( xSemaphoreTakeRecursive( xMutex, recmuNO_DELAY ) == pdPASS ) if( xSemaphoreTakeRecursive( xMutex, recmuNO_DELAY ) == pdPASS )
{ {
#if ( INCLUDE_eTaskGetState == 1 ) #if ( INCLUDE_eTaskGetState == 1 )
{ {
configASSERT( eTaskGetState( xControllingTaskHandle ) == eSuspended ); configASSERT( eTaskGetState( xControllingTaskHandle ) == eSuspended );
configASSERT( eTaskGetState( xBlockingTaskHandle ) == eSuspended ); configASSERT( eTaskGetState( xBlockingTaskHandle ) == eSuspended );
} }
#endif /* INCLUDE_eTaskGetState */ #endif /* INCLUDE_eTaskGetState */
/* Is the blocking task suspended? */ /* Is the blocking task suspended? */
@@ -325,17 +325,17 @@ static void prvRecursiveMutexPollingTask( void * pvParameters )
} }
#if ( INCLUDE_uxTaskPriorityGet == 1 ) #if ( INCLUDE_uxTaskPriorityGet == 1 )
{ {
/* Check priority inherited. */ /* Check priority inherited. */
configASSERT( uxTaskPriorityGet( NULL ) == recmuCONTROLLING_TASK_PRIORITY ); configASSERT( uxTaskPriorityGet( NULL ) == recmuCONTROLLING_TASK_PRIORITY );
} }
#endif /* INCLUDE_uxTaskPriorityGet */ #endif /* INCLUDE_uxTaskPriorityGet */
#if ( INCLUDE_eTaskGetState == 1 ) #if ( INCLUDE_eTaskGetState == 1 )
{ {
configASSERT( eTaskGetState( xControllingTaskHandle ) == eBlocked ); configASSERT( eTaskGetState( xControllingTaskHandle ) == eBlocked );
configASSERT( eTaskGetState( xBlockingTaskHandle ) == eBlocked ); configASSERT( eTaskGetState( xBlockingTaskHandle ) == eBlocked );
} }
#endif /* INCLUDE_eTaskGetState */ #endif /* INCLUDE_eTaskGetState */
/* Release the mutex, disinheriting the higher priority again. */ /* Release the mutex, disinheriting the higher priority again. */
@@ -345,18 +345,18 @@ static void prvRecursiveMutexPollingTask( void * pvParameters )
} }
#if ( INCLUDE_uxTaskPriorityGet == 1 ) #if ( INCLUDE_uxTaskPriorityGet == 1 )
{ {
/* Check priority disinherited. */ /* Check priority disinherited. */
configASSERT( uxTaskPriorityGet( NULL ) == recmuPOLLING_TASK_PRIORITY ); configASSERT( uxTaskPriorityGet( NULL ) == recmuPOLLING_TASK_PRIORITY );
} }
#endif /* INCLUDE_uxTaskPriorityGet */ #endif /* INCLUDE_uxTaskPriorityGet */
} }
} }
#if configUSE_PREEMPTION == 0 #if configUSE_PREEMPTION == 0
{ {
taskYIELD(); taskYIELD();
} }
#endif #endif
} }
} }

View File

@@ -51,7 +51,7 @@
#define PORTMACRO_H #define PORTMACRO_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/*----------------------------------------------------------- /*-----------------------------------------------------------
@@ -146,7 +146,7 @@
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void * pvParameters ) #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void * pvParameters )
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* PORTMACRO_H */ #endif /* PORTMACRO_H */

View File

@@ -1,6 +1,6 @@
/* /*
* FreeRTOS V202112.00 * FreeRTOS V202112.00
* Copyright (C) Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * 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 * this software and associated documentation files (the "Software"), to deal in
@@ -176,15 +176,15 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
#endif #endif
#if ( configUSE_TRACE_FACILITY == 1 ) #if ( configUSE_TRACE_FACILITY == 1 )
{ {
pxNewQueue->ucQueueType = ucQueueType; pxNewQueue->ucQueueType = ucQueueType;
} }
#endif /* configUSE_TRACE_FACILITY */ #endif /* configUSE_TRACE_FACILITY */
#if ( configUSE_QUEUE_SETS == 1 ) #if ( configUSE_QUEUE_SETS == 1 )
{ {
pxNewQueue->pxQueueSetContainer = NULL; pxNewQueue->pxQueueSetContainer = NULL;
} }
#endif /* configUSE_QUEUE_SETS */ #endif /* configUSE_QUEUE_SETS */
traceQUEUE_CREATE( pxNewQueue ); traceQUEUE_CREATE( pxNewQueue );
@@ -262,12 +262,12 @@ QueueHandle_t xQueueGenericCreate( const UBaseType_t uxQueueLength,
#endif /* ifdef VERIFAST */ #endif /* ifdef VERIFAST */
#if ( configSUPPORT_STATIC_ALLOCATION == 1 ) #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
{ {
/* Queues can be created either statically or dynamically, so /* Queues can be created either statically or dynamically, so
* note this task was created dynamically in case it is later * note this task was created dynamically in case it is later
* deleted. */ * deleted. */
pxNewQueue->ucStaticallyAllocated = pdFALSE; pxNewQueue->ucStaticallyAllocated = pdFALSE;
} }
#endif /* configSUPPORT_STATIC_ALLOCATION */ #endif /* configSUPPORT_STATIC_ALLOCATION */
prvInitialiseNewQueue( uxQueueLength, uxItemSize, pucQueueStorage, ucQueueType, pxNewQueue ); prvInitialiseNewQueue( uxQueueLength, uxItemSize, pucQueueStorage, ucQueueType, pxNewQueue );

View File

@@ -1,6 +1,6 @@
/* /*
* FreeRTOS V202112.00 * FreeRTOS V202112.00
* Copyright (C) Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * 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 * this software and associated documentation files (the "Software"), to deal in
@@ -60,18 +60,18 @@ static BaseType_t prvCopyDataToQueue( Queue_t * const pxQueue,
/* This case is unreachable for queues */ /* This case is unreachable for queues */
/*@assert false;@*/ /*@assert false;@*/
#if ( configUSE_MUTEXES == 1 ) #if ( configUSE_MUTEXES == 1 )
{
if( pxQueue->uxQueueType == queueQUEUE_IS_MUTEX )
{ {
if( pxQueue->uxQueueType == queueQUEUE_IS_MUTEX ) /* The mutex is no longer being held. */
{ xReturn = xTaskPriorityDisinherit( pxQueue->u.xSemaphore.xMutexHolder );
/* The mutex is no longer being held. */ pxQueue->u.xSemaphore.xMutexHolder = NULL;
xReturn = xTaskPriorityDisinherit( pxQueue->u.xSemaphore.xMutexHolder );
pxQueue->u.xSemaphore.xMutexHolder = NULL;
}
else
{
mtCOVERAGE_TEST_MARKER();
}
} }
else
{
mtCOVERAGE_TEST_MARKER();
}
}
#endif /* configUSE_MUTEXES */ #endif /* configUSE_MUTEXES */
} }
else if( xPosition == queueSEND_TO_BACK ) else if( xPosition == queueSEND_TO_BACK )

View File

@@ -1,6 +1,6 @@
/* /*
* FreeRTOS V202112.00 * FreeRTOS V202112.00
* Copyright (C) Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * 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 * this software and associated documentation files (the "Software"), to deal in
@@ -59,55 +59,32 @@ static void prvUnlockQueue( Queue_t * const pxQueue )
/* Data was posted while the queue was locked. Are any tasks /* Data was posted while the queue was locked. Are any tasks
* blocked waiting for data to become available? */ * blocked waiting for data to become available? */
#if ( configUSE_QUEUE_SETS == 1 ) #if ( configUSE_QUEUE_SETS == 1 )
{
if( pxQueue->pxQueueSetContainer != NULL )
{ {
if( pxQueue->pxQueueSetContainer != NULL ) if( prvNotifyQueueSetContainer( pxQueue ) != pdFALSE )
{ {
if( prvNotifyQueueSetContainer( pxQueue ) != pdFALSE ) /* The queue is a member of a queue set, and posting to
{ * the queue set caused a higher priority task to unblock.
/* The queue is a member of a queue set, and posting to * A context switch is required. */
* the queue set caused a higher priority task to unblock. vTaskMissedYield();
* A context switch is required. */
vTaskMissedYield();
}
else
{
mtCOVERAGE_TEST_MARKER();
}
} }
else else
{ {
/* Tasks that are removed from the event list will get mtCOVERAGE_TEST_MARKER();
* added to the pending ready list as the scheduler is still
* suspended. */
if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE )
{
if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
{
/* The task waiting has a higher priority so record that a
* context switch is required. */
vTaskMissedYield();
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
else
{
break;
}
} }
} }
#else /* configUSE_QUEUE_SETS */ else
{ {
/* Tasks that are removed from the event list will get added to /* Tasks that are removed from the event list will get
* the pending ready list as the scheduler is still suspended. */ * added to the pending ready list as the scheduler is still
* suspended. */
if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE )
{ {
if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
{ {
/* The task waiting has a higher priority so record that /* The task waiting has a higher priority so record that a
* a context switch is required. */ * context switch is required. */
vTaskMissedYield(); vTaskMissedYield();
} }
else else
@@ -120,6 +97,29 @@ static void prvUnlockQueue( Queue_t * const pxQueue )
break; break;
} }
} }
}
#else /* configUSE_QUEUE_SETS */
{
/* Tasks that are removed from the event list will get added to
* the pending ready list as the scheduler is still suspended. */
if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE )
{
if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
{
/* The task waiting has a higher priority so record that
* a context switch is required. */
vTaskMissedYield();
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
else
{
break;
}
}
#endif /* configUSE_QUEUE_SETS */ #endif /* configUSE_QUEUE_SETS */
--cTxLock; --cTxLock;

View File

@@ -1,6 +1,6 @@
/* /*
* FreeRTOS V202112.00 * FreeRTOS V202112.00
* Copyright (C) Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * 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 * this software and associated documentation files (the "Software"), to deal in
@@ -47,39 +47,39 @@ void vQueueDelete( QueueHandle_t xQueue )
traceQUEUE_DELETE( pxQueue ); traceQUEUE_DELETE( pxQueue );
#if ( configQUEUE_REGISTRY_SIZE > 0 ) #if ( configQUEUE_REGISTRY_SIZE > 0 )
{ {
vQueueUnregisterQueue( pxQueue ); vQueueUnregisterQueue( pxQueue );
} }
#endif #endif
#if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 0 ) ) #if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 0 ) )
{ {
/* The queue can only have been allocated dynamically - free it /* The queue can only have been allocated dynamically - free it
* again. */ * again. */
vPortFree( pxQueue ); vPortFree( pxQueue );
#ifdef VERIFAST /*< leak ghost state on deletion */ #ifdef VERIFAST /*< leak ghost state on deletion */
/*@leak buffer(_, _, _, _);@*/ /*@leak buffer(_, _, _, _);@*/
/*@leak malloc_block(_, _);@*/ /*@leak malloc_block(_, _);@*/
#endif #endif
} }
#elif ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) ) #elif ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
{
/* The queue could have been allocated statically or dynamically, so
* check before attempting to free the memory. */
if( pxQueue->ucStaticallyAllocated == ( uint8_t ) pdFALSE )
{ {
/* The queue could have been allocated statically or dynamically, so vPortFree( pxQueue );
* check before attempting to free the memory. */
if( pxQueue->ucStaticallyAllocated == ( uint8_t ) pdFALSE )
{
vPortFree( pxQueue );
}
else
{
mtCOVERAGE_TEST_MARKER();
}
} }
else
{
mtCOVERAGE_TEST_MARKER();
}
}
#else /* if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 0 ) ) */ #else /* if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 0 ) ) */
{ {
/* The queue must have been statically allocated, so is not going to be /* The queue must have been statically allocated, so is not going to be
* deleted. Avoid compiler warnings about the unused parameter. */ * deleted. Avoid compiler warnings about the unused parameter. */
( void ) pxQueue; ( void ) pxQueue;
} }
#endif /* configSUPPORT_DYNAMIC_ALLOCATION */ #endif /* configSUPPORT_DYNAMIC_ALLOCATION */
} }

View File

@@ -1,6 +1,6 @@
/* /*
* FreeRTOS V202112.00 * FreeRTOS V202112.00
* Copyright (C) Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * 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 * this software and associated documentation files (the "Software"), to deal in
@@ -52,10 +52,10 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
configASSERT( pxQueue ); configASSERT( pxQueue );
configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) ); configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) );
configASSERT( !( ( xCopyPosition == queueOVERWRITE ) && ( pxQueue->uxLength != 1 ) ) ); configASSERT( !( ( xCopyPosition == queueOVERWRITE ) && ( pxQueue->uxLength != 1 ) ) );
#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) ) #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
{ {
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) ); configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
} }
#endif #endif
#endif /* ifdef VERIFAST */ #endif /* ifdef VERIFAST */
@@ -85,70 +85,34 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
/* VeriFast: we do not verify this configuration option */ /* VeriFast: we do not verify this configuration option */
#if ( configUSE_QUEUE_SETS == 1 ) #if ( configUSE_QUEUE_SETS == 1 )
{
const UBaseType_t uxPreviousMessagesWaiting = pxQueue->uxMessagesWaiting;
xYieldRequired = prvCopyDataToQueue( pxQueue, pvItemToQueue, xCopyPosition );
if( pxQueue->pxQueueSetContainer != NULL )
{ {
const UBaseType_t uxPreviousMessagesWaiting = pxQueue->uxMessagesWaiting; if( ( xCopyPosition == queueOVERWRITE ) && ( uxPreviousMessagesWaiting != ( UBaseType_t ) 0 ) )
xYieldRequired = prvCopyDataToQueue( pxQueue, pvItemToQueue, xCopyPosition );
if( pxQueue->pxQueueSetContainer != NULL )
{ {
if( ( xCopyPosition == queueOVERWRITE ) && ( uxPreviousMessagesWaiting != ( UBaseType_t ) 0 ) ) /* Do not notify the queue set as an existing item
{ * was overwritten in the queue so the number of items
/* Do not notify the queue set as an existing item * in the queue has not changed. */
* was overwritten in the queue so the number of items mtCOVERAGE_TEST_MARKER();
* in the queue has not changed. */ }
mtCOVERAGE_TEST_MARKER(); else if( prvNotifyQueueSetContainer( pxQueue ) != pdFALSE )
} {
else if( prvNotifyQueueSetContainer( pxQueue ) != pdFALSE ) /* The queue is a member of a queue set, and posting
{ * to the queue set caused a higher priority task to
/* The queue is a member of a queue set, and posting * unblock. A context switch is required. */
* to the queue set caused a higher priority task to queueYIELD_IF_USING_PREEMPTION();
* unblock. A context switch is required. */
queueYIELD_IF_USING_PREEMPTION();
}
else
{
mtCOVERAGE_TEST_MARKER();
}
} }
else else
{ {
/* If there was a task waiting for data to arrive on the mtCOVERAGE_TEST_MARKER();
* queue then unblock it now. */
if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE )
{
if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
{
/* The unblocked task has a priority higher than
* our own so yield immediately. Yes it is ok to
* do this from within the critical section - the
* kernel takes care of that. */
queueYIELD_IF_USING_PREEMPTION();
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
else if( xYieldRequired != pdFALSE )
{
/* This path is a special case that will only get
* executed if the task was holding multiple mutexes
* and the mutexes were given back in an order that is
* different to that in which they were taken. */
queueYIELD_IF_USING_PREEMPTION();
}
else
{
mtCOVERAGE_TEST_MARKER();
}
} }
} }
#else /* configUSE_QUEUE_SETS */ else
{ {
/*@close queue(pxQueue, Storage, N, M, W, R, K, is_locked, abs);@*/
xYieldRequired = prvCopyDataToQueue( pxQueue, pvItemToQueue, xCopyPosition );
/* If there was a task waiting for data to arrive on the /* If there was a task waiting for data to arrive on the
* queue then unblock it now. */ * queue then unblock it now. */
if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE )
@@ -156,9 +120,9 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
{ {
/* The unblocked task has a priority higher than /* The unblocked task has a priority higher than
* our own so yield immediately. Yes it is ok to do * our own so yield immediately. Yes it is ok to
* this from within the critical section - the kernel * do this from within the critical section - the
* takes care of that. */ * kernel takes care of that. */
queueYIELD_IF_USING_PREEMPTION(); queueYIELD_IF_USING_PREEMPTION();
} }
else else
@@ -169,8 +133,8 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
else if( xYieldRequired != pdFALSE ) else if( xYieldRequired != pdFALSE )
{ {
/* This path is a special case that will only get /* This path is a special case that will only get
* executed if the task was holding multiple mutexes and * executed if the task was holding multiple mutexes
* the mutexes were given back in an order that is * and the mutexes were given back in an order that is
* different to that in which they were taken. */ * different to that in which they were taken. */
queueYIELD_IF_USING_PREEMPTION(); queueYIELD_IF_USING_PREEMPTION();
} }
@@ -179,6 +143,42 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
mtCOVERAGE_TEST_MARKER(); mtCOVERAGE_TEST_MARKER();
} }
} }
}
#else /* configUSE_QUEUE_SETS */
{
/*@close queue(pxQueue, Storage, N, M, W, R, K, is_locked, abs);@*/
xYieldRequired = prvCopyDataToQueue( pxQueue, pvItemToQueue, xCopyPosition );
/* If there was a task waiting for data to arrive on the
* queue then unblock it now. */
if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE )
{
if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
{
/* The unblocked task has a priority higher than
* our own so yield immediately. Yes it is ok to do
* this from within the critical section - the kernel
* takes care of that. */
queueYIELD_IF_USING_PREEMPTION();
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
else if( xYieldRequired != pdFALSE )
{
/* This path is a special case that will only get
* executed if the task was holding multiple mutexes and
* the mutexes were given back in an order that is
* different to that in which they were taken. */
queueYIELD_IF_USING_PREEMPTION();
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
#endif /* configUSE_QUEUE_SETS */ #endif /* configUSE_QUEUE_SETS */
/*@ /*@

View File

@@ -1,6 +1,6 @@
/* /*
* FreeRTOS V202112.00 * FreeRTOS V202112.00
* Copyright (C) Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * 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 * this software and associated documentation files (the "Software"), to deal in
@@ -106,29 +106,24 @@ BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue,
{ {
/* VeriFast: we do not verify this configuration option */ /* VeriFast: we do not verify this configuration option */
#if ( configUSE_QUEUE_SETS == 1 ) #if ( configUSE_QUEUE_SETS == 1 )
{
if( pxQueue->pxQueueSetContainer != NULL )
{ {
if( pxQueue->pxQueueSetContainer != NULL ) if( ( xCopyPosition == queueOVERWRITE ) && ( uxPreviousMessagesWaiting != ( UBaseType_t ) 0 ) )
{ {
if( ( xCopyPosition == queueOVERWRITE ) && ( uxPreviousMessagesWaiting != ( UBaseType_t ) 0 ) ) /* Do not notify the queue set as an existing item
* was overwritten in the queue so the number of items
* in the queue has not changed. */
mtCOVERAGE_TEST_MARKER();
}
else if( prvNotifyQueueSetContainer( pxQueue ) != pdFALSE )
{
/* The queue is a member of a queue set, and posting
* to the queue set caused a higher priority task to
* unblock. A context switch is required. */
if( pxHigherPriorityTaskWoken != NULL )
{ {
/* Do not notify the queue set as an existing item *pxHigherPriorityTaskWoken = pdTRUE;
* was overwritten in the queue so the number of items
* in the queue has not changed. */
mtCOVERAGE_TEST_MARKER();
}
else if( prvNotifyQueueSetContainer( pxQueue ) != pdFALSE )
{
/* The queue is a member of a queue set, and posting
* to the queue set caused a higher priority task to
* unblock. A context switch is required. */
if( pxHigherPriorityTaskWoken != NULL )
{
*pxHigherPriorityTaskWoken = pdTRUE;
}
else
{
mtCOVERAGE_TEST_MARKER();
}
} }
else else
{ {
@@ -137,40 +132,17 @@ BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue,
} }
else else
{ {
if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) mtCOVERAGE_TEST_MARKER();
{
if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
{
/* The task waiting has a higher priority so
* record that a context switch is required. */
if( pxHigherPriorityTaskWoken != NULL )
{
*pxHigherPriorityTaskWoken = pdTRUE;
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
else
{
mtCOVERAGE_TEST_MARKER();
}
} }
} }
#else /* configUSE_QUEUE_SETS */ else
{ {
if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE )
{ {
if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
{ {
/* The task waiting has a higher priority so record that a /* The task waiting has a higher priority so
* context switch is required. */ * record that a context switch is required. */
if( pxHigherPriorityTaskWoken != NULL ) if( pxHigherPriorityTaskWoken != NULL )
{ {
*pxHigherPriorityTaskWoken = pdTRUE; *pxHigherPriorityTaskWoken = pdTRUE;
@@ -189,12 +161,40 @@ BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue,
{ {
mtCOVERAGE_TEST_MARKER(); mtCOVERAGE_TEST_MARKER();
} }
/* Not used in this path. */
#ifndef VERIFAST /*< void cast of unused var */
( void ) uxPreviousMessagesWaiting;
#endif
} }
}
#else /* configUSE_QUEUE_SETS */
{
if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE )
{
if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
{
/* The task waiting has a higher priority so record that a
* context switch is required. */
if( pxHigherPriorityTaskWoken != NULL )
{
*pxHigherPriorityTaskWoken = pdTRUE;
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
else
{
mtCOVERAGE_TEST_MARKER();
}
/* Not used in this path. */
#ifndef VERIFAST /*< void cast of unused var */
( void ) uxPreviousMessagesWaiting;
#endif
}
#endif /* configUSE_QUEUE_SETS */ #endif /* configUSE_QUEUE_SETS */
} }
else else

View File

@@ -1,6 +1,6 @@
/* /*
* FreeRTOS V202112.00 * FreeRTOS V202112.00
* Copyright (C) Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * 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 * this software and associated documentation files (the "Software"), to deal in
@@ -56,10 +56,10 @@ BaseType_t xQueuePeek( QueueHandle_t xQueue,
configASSERT( !( ( ( pvBuffer ) == NULL ) && ( ( pxQueue )->uxItemSize != ( UBaseType_t ) 0U ) ) ); configASSERT( !( ( ( pvBuffer ) == NULL ) && ( ( pxQueue )->uxItemSize != ( UBaseType_t ) 0U ) ) );
/* Cannot block if the scheduler is suspended. */ /* Cannot block if the scheduler is suspended. */
#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) ) #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
{ {
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) ); configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
} }
#endif #endif
#endif /* ifdef VERIFAST */ #endif /* ifdef VERIFAST */

View File

@@ -1,6 +1,6 @@
/* /*
* FreeRTOS V202112.00 * FreeRTOS V202112.00
* Copyright (C) Amazon.com, Inc. or its affiliates. All Rights Reserved. * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of * 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 * this software and associated documentation files (the "Software"), to deal in
@@ -55,10 +55,10 @@ BaseType_t xQueueReceive( QueueHandle_t xQueue,
configASSERT( !( ( ( pvBuffer ) == NULL ) && ( ( pxQueue )->uxItemSize != ( UBaseType_t ) 0U ) ) ); configASSERT( !( ( ( pvBuffer ) == NULL ) && ( ( pxQueue )->uxItemSize != ( UBaseType_t ) 0U ) ) );
/* Cannot block if the scheduler is suspended. */ /* Cannot block if the scheduler is suspended. */
#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) ) #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
{ {
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) ); configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
} }
#endif #endif
#endif /* ifdef VERIFAST */ #endif /* ifdef VERIFAST */

View File

@@ -1801,7 +1801,7 @@ prvcollectdevicemetrics
prvcomtxtimercallback prvcomtxtimercallback
prvconnectandcreatedemotasks prvconnectandcreatedemotasks
prvcopycommand prvcopycommand
prvCopyDataToQueue prvcopydatatoqueue
prvcoreatask prvcoreatask
prvcorebtasks prvcorebtasks
prvcreatecommand prvcreatecommand
@@ -2168,6 +2168,7 @@ queuegenericcreatestatic
queuegenericreset queuegenericreset
queuehandle queuehandle
queuelists queuelists
queuelock
queueoverwrite queueoverwrite
queuequeue queuequeue
queueregistry queueregistry

File diff suppressed because it is too large Load Diff