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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 1090 additions and 576 deletions

View file

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

View file

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

View file

@ -20,7 +20,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* 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
* lower priority as expected as the start conditions. */
#if ( INCLUDE_eTaskGetState == 1 )
{
configASSERT( eTaskGetState( xSlaveHandle ) == eSuspended );
}
{
configASSERT( eTaskGetState( xSlaveHandle ) == eSuspended );
}
#endif /* INCLUDE_eTaskGetState */
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
* blocked on the semaphore. */
#if ( INCLUDE_eTaskGetState == 1 )
{
configASSERT( eTaskGetState( xSlaveHandle ) == eBlocked );
}
{
configASSERT( eTaskGetState( xSlaveHandle ) == eBlocked );
}
#endif /* INCLUDE_eTaskGetState */
/* This task should now have inherited the priority of the slave
@ -264,9 +264,9 @@ static void prvTakeAndGiveInTheSameOrder( void )
}
#if ( INCLUDE_eTaskGetState == 1 )
{
configASSERT( eTaskGetState( xSlaveHandle ) == eSuspended );
}
{
configASSERT( eTaskGetState( xSlaveHandle ) == eSuspended );
}
#endif /* INCLUDE_eTaskGetState */
/* 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
* lower priority as expected as the start conditions. */
#if ( INCLUDE_eTaskGetState == 1 )
{
configASSERT( eTaskGetState( xSlaveHandle ) == eSuspended );
}
{
configASSERT( eTaskGetState( xSlaveHandle ) == eSuspended );
}
#endif /* INCLUDE_eTaskGetState */
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
* blocked on the semaphore. */
#if ( INCLUDE_eTaskGetState == 1 )
{
configASSERT( eTaskGetState( xSlaveHandle ) == eBlocked );
}
{
configASSERT( eTaskGetState( xSlaveHandle ) == eBlocked );
}
#endif /* INCLUDE_eTaskGetState */
/* 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.
*
* 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 );
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
{
/* 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
* index into the xStaticMessageBuffers and ucBufferStorage arrays. */
xTaskCreate( prvSenderTask, "1Sender", xBlockingStackSize, NULL, mbHIGHER_PRIORITY, NULL );
xTaskCreate( prvSenderTask, "2Sender", xBlockingStackSize, NULL, mbLOWER_PRIORITY, NULL );
}
{
/* 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
* index into the xStaticMessageBuffers and ucBufferStorage arrays. */
xTaskCreate( prvSenderTask, "1Sender", xBlockingStackSize, NULL, mbHIGHER_PRIORITY, NULL );
xTaskCreate( prvSenderTask, "2Sender", xBlockingStackSize, NULL, mbLOWER_PRIORITY, NULL );
}
#endif /* configSUPPORT_STATIC_ALLOCATION */
#if ( configRUN_ADDITIONAL_TESTS == 1 )
{
xCoherenceTestMessageBuffer = xMessageBufferCreate( mbCOHERENCE_TEST_BUFFER_SIZE );
configASSERT( xCoherenceTestMessageBuffer );
{
xCoherenceTestMessageBuffer = xMessageBufferCreate( mbCOHERENCE_TEST_BUFFER_SIZE );
configASSERT( xCoherenceTestMessageBuffer );
xTaskCreate( prvSpaceAvailableCoherenceActor, "mbsanity1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
xTaskCreate( prvSpaceAvailableCoherenceTester, "mbsanity2", 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 );
}
#endif
}
/*-----------------------------------------------------------*/
@ -419,19 +419,19 @@ static void prvSingleTaskTests( MessageBufferHandle_t xMessageBuffer )
configASSERT( xReturned == 0 );
( void ) xReturned; /* In case configASSERT() is not defined. */
#ifndef configMESSAGE_BUFFER_LENGTH_TYPE
{
/* The following will fail if configMESSAGE_BUFFER_LENGTH_TYPE is set
* to a non 32-bit type. */
xReturned = xMessageBufferSend( xMessageBuffer, ( const void * ) pc55ByteString, mbMESSAGE_BUFFER_LENGTH_BYTES - 1, mbDONT_BLOCK );
configASSERT( xReturned == 0 );
( void ) xReturned; /* In case configASSERT() is not defined. */
xReturned = xMessageBufferSend( xMessageBuffer, ( const void * ) pc55ByteString, mbMESSAGE_BUFFER_LENGTH_BYTES - 2, mbDONT_BLOCK );
configASSERT( xReturned == 0 );
( void ) xReturned; /* In case configASSERT() is not defined. */
xReturned = xMessageBufferSend( xMessageBuffer, ( const void * ) pc55ByteString, mbMESSAGE_BUFFER_LENGTH_BYTES - 3, mbDONT_BLOCK );
configASSERT( xReturned == 0 );
( void ) xReturned; /* In case configASSERT() is not defined. */
}
{
/* The following will fail if configMESSAGE_BUFFER_LENGTH_TYPE is set
* to a non 32-bit type. */
xReturned = xMessageBufferSend( xMessageBuffer, ( const void * ) pc55ByteString, mbMESSAGE_BUFFER_LENGTH_BYTES - 1, mbDONT_BLOCK );
configASSERT( xReturned == 0 );
( void ) xReturned; /* In case configASSERT() is not defined. */
xReturned = xMessageBufferSend( xMessageBuffer, ( const void * ) pc55ByteString, mbMESSAGE_BUFFER_LENGTH_BYTES - 2, mbDONT_BLOCK );
configASSERT( xReturned == 0 );
( void ) xReturned; /* In case configASSERT() is not defined. */
xReturned = xMessageBufferSend( xMessageBuffer, ( const void * ) pc55ByteString, mbMESSAGE_BUFFER_LENGTH_BYTES - 3, mbDONT_BLOCK );
configASSERT( xReturned == 0 );
( void ) xReturned; /* In case configASSERT() is not defined. */
}
#endif /* ifndef configMESSAGE_BUFFER_LENGTH_TYPE */
/* 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 )
{
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 };
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 )
if( ulLastSenderLoopCounters[ x ] == ulSenderLoopCounters[ x ] )
{
xReturn = pdFAIL;
}
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 ) */
return xReturn;

View file

@ -20,7 +20,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* 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;
#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. */
vPrintDisplayMessage( &pcTaskStartMsg );
}
/* Queue a message for printing to say the task has started. */
vPrintDisplayMessage( &pcTaskStartMsg );
}
#endif
for( ; ; )

View file

@ -20,7 +20,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* https://www.FreeRTOS.org
* https://aws.amazon.com/freertos
* https://github.com/FreeRTOS
*
*/
@ -286,15 +286,15 @@
vSemaphoreDelete( xSemaphore );
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
{
/* Now do the same but using dynamically allocated buffers to ensure the
* delete functions are working correctly in both the static and dynamic
* allocation cases. */
xSemaphore = xSemaphoreCreateCounting( uxMaxCount, 0 );
configASSERT( xSemaphore != NULL );
prvSanityCheckCreatedSemaphore( xSemaphore, uxMaxCount );
vSemaphoreDelete( xSemaphore );
}
{
/* Now do the same but using dynamically allocated buffers to ensure the
* delete functions are working correctly in both the static and dynamic
* allocation cases. */
xSemaphore = xSemaphoreCreateCounting( uxMaxCount, 0 );
configASSERT( xSemaphore != NULL );
prvSanityCheckCreatedSemaphore( xSemaphore, uxMaxCount );
vSemaphoreDelete( xSemaphore );
}
#endif
}
/*-----------------------------------------------------------*/
@ -335,12 +335,12 @@
* functions are working correctly in both the static and dynamic memory
* allocation cases. */
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
{
xSemaphore = xSemaphoreCreateRecursiveMutex();
configASSERT( xSemaphore != NULL );
prvSanityCheckCreatedRecursiveMutex( xSemaphore );
vSemaphoreDelete( xSemaphore );
}
{
xSemaphore = xSemaphoreCreateRecursiveMutex();
configASSERT( xSemaphore != NULL );
prvSanityCheckCreatedRecursiveMutex( xSemaphore );
vSemaphoreDelete( xSemaphore );
}
#endif
}
/*-----------------------------------------------------------*/
@ -390,20 +390,20 @@
* function is working correctly in both the static and dynamic memory
* allocation cases. */
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
{
xQueue = xQueueCreate( staticQUEUE_LENGTH_IN_ITEMS, /* The maximum number of items the queue can hold. */
sizeof( uint64_t ) ); /* The size of each item. */
{
xQueue = xQueueCreate( staticQUEUE_LENGTH_IN_ITEMS, /* The maximum number of items the queue can hold. */
sizeof( uint64_t ) ); /* The size of each item. */
/* The queue handle should equal the static queue structure passed into the
* xQueueCreateStatic() function. */
configASSERT( xQueue != NULL );
/* The queue handle should equal the static queue structure passed into the
* xQueueCreateStatic() function. */
configASSERT( xQueue != NULL );
/* Ensure the queue passes a few sanity checks as a valid queue. */
prvSanityCheckCreatedQueue( xQueue );
/* Ensure the queue passes a few sanity checks as a valid queue. */
prvSanityCheckCreatedQueue( xQueue );
/* Delete the queue again so the buffers can be reused. */
vQueueDelete( xQueue );
}
/* Delete the queue again so the buffers can be reused. */
vQueueDelete( xQueue );
}
#endif /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */
}
/*-----------------------------------------------------------*/
@ -453,28 +453,28 @@
* function is working correctly in both the static and dynamic allocation
* cases. */
#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();
/* 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 );
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 );
}
#endif /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */
}
/*-----------------------------------------------------------*/
@ -516,31 +516,31 @@
* delete function is working correctly in both the static and dynamic
* allocation cases. */
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
{
xSemaphore = xSemaphoreCreateBinary();
configASSERT( xSemaphore != NULL );
prvSanityCheckCreatedSemaphore( xSemaphore, staticBINARY_SEMAPHORE_MAX_COUNT );
vSemaphoreDelete( xSemaphore );
}
{
xSemaphore = xSemaphoreCreateBinary();
configASSERT( xSemaphore != NULL );
prvSanityCheckCreatedSemaphore( xSemaphore, staticBINARY_SEMAPHORE_MAX_COUNT );
vSemaphoreDelete( xSemaphore );
}
#endif
/* There isn't a static version of the old and deprecated
* vSemaphoreCreateBinary() macro (because its deprecated!), but check it is
* still functioning correctly. */
#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 );
/* 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 );
xErrorOccurred = pdTRUE;
}
prvSanityCheckCreatedSemaphore( xSemaphore, staticBINARY_SEMAPHORE_MAX_COUNT );
vSemaphoreDelete( xSemaphore );
}
#endif /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */
}
/*-----------------------------------------------------------*/
@ -644,37 +644,37 @@
* the delete function is working correctly in both the static and dynamic
* allocation cases. */
#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. */
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;
}
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 ) */
}
/*-----------------------------------------------------------*/
@ -713,12 +713,12 @@
* delete function is working correctly in both the static and dynamic
* allocation cases. */
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
{
xEventGroup = xEventGroupCreate();
configASSERT( xEventGroup != NULL );
prvSanityCheckCreatedEventGroup( xEventGroup );
vEventGroupDelete( xEventGroup );
}
{
xEventGroup = xEventGroupCreate();
configASSERT( xEventGroup != NULL );
prvSanityCheckCreatedEventGroup( xEventGroup );
vEventGroupDelete( xEventGroup );
}
#endif
}
/*-----------------------------------------------------------*/
@ -774,31 +774,31 @@
* function is working correctly in both the static and dynamic allocation
* cases. */
#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;
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 );
xErrorOccurred = pdTRUE;
}
configASSERT( xReturned == pdPASS );
if( xReturned != pdPASS )
{
xErrorOccurred = pdTRUE;
}
vTaskDelete( xCreatedTask );
}
#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 );
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
{
/* 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
* index into the xStaticStreamBuffers and ucBufferStorage arrays. */
xTaskCreate( prvSenderTask, "Str1Sender", sbSMALLER_STACK_SIZE, NULL, sbHIGHER_PRIORITY, NULL );
xTaskCreate( prvSenderTask, "Str2Sender", sbSMALLER_STACK_SIZE, NULL, sbLOWER_PRIORITY, NULL );
}
{
/* 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
* index into the xStaticStreamBuffers and ucBufferStorage arrays. */
xTaskCreate( prvSenderTask, "Str1Sender", sbSMALLER_STACK_SIZE, NULL, sbHIGHER_PRIORITY, NULL );
xTaskCreate( prvSenderTask, "Str2Sender", sbSMALLER_STACK_SIZE, NULL, sbLOWER_PRIORITY, NULL );
}
#endif /* configSUPPORT_STATIC_ALLOCATION */
}
/*-----------------------------------------------------------*/
@ -1225,21 +1225,21 @@ BaseType_t xAreStreamBufferTasksStillRunning( void )
}
#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;
}
else
{
ulLastSenderLoopCounters[ x ] = ulSenderLoopCounters[ x ];
}
xErrorStatus = pdFAIL;
}
else
{
ulLastSenderLoopCounters[ x ] = ulSenderLoopCounters[ x ];
}
}
}
#endif /* configSUPPORT_STATIC_ALLOCATION */
return xErrorStatus;

View file

@ -20,7 +20,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* https://www.FreeRTOS.org
* https://aws.amazon.com/freertos
* https://github.com/FreeRTOS
*
*/
@ -264,9 +264,9 @@ static portTASK_FUNCTION( vCounterControlTask, pvParameters )
vTaskSuspend( xContinuousIncrementHandle );
{
#if ( INCLUDE_eTaskGetState == 1 )
{
configASSERT( eTaskGetState( xContinuousIncrementHandle ) == eSuspended );
}
{
configASSERT( eTaskGetState( xContinuousIncrementHandle ) == eSuspended );
}
#endif /* INCLUDE_eTaskGetState */
ulLastCounter = ulCounter;
@ -278,9 +278,9 @@ static portTASK_FUNCTION( vCounterControlTask, pvParameters )
#endif
#if ( INCLUDE_eTaskGetState == 1 )
{
configASSERT( eTaskGetState( xContinuousIncrementHandle ) == eReady );
}
{
configASSERT( eTaskGetState( xContinuousIncrementHandle ) == eReady );
}
#endif /* INCLUDE_eTaskGetState */
/* Now delay to ensure the other task has processor time. */
@ -311,9 +311,9 @@ static portTASK_FUNCTION( vCounterControlTask, pvParameters )
ulCounter = ( uint32_t ) 0;
#if ( INCLUDE_eTaskGetState == 1 )
{
configASSERT( eTaskGetState( xLimitedIncrementHandle ) == eSuspended );
}
{
configASSERT( eTaskGetState( xLimitedIncrementHandle ) == eSuspended );
}
#endif /* INCLUDE_eTaskGetState */
/* 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
* suspended itself. */
#if ( INCLUDE_eTaskGetState == 1 )
{
configASSERT( eTaskGetState( xLimitedIncrementHandle ) == eSuspended );
}
{
configASSERT( eTaskGetState( xLimitedIncrementHandle ) == eSuspended );
}
#endif /* INCLUDE_eTaskGetState */
/* Does the counter variable have the expected value? */
@ -415,9 +415,9 @@ static portTASK_FUNCTION( vQueueReceiveWhenSuspendedTask, pvParameters )
xTaskResumeAll();
#if configUSE_PREEMPTION == 0
{
taskYIELD();
}
{
taskYIELD();
}
#endif
} while( xGotValue == pdFALSE );

View file

@ -20,7 +20,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* 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. */
#if configUSE_PREEMPTION == 0
{
taskYIELD();
}
{
taskYIELD();
}
#endif
/* Finish off the calculation. */
@ -128,9 +128,9 @@ static portTASK_FUNCTION( vCompeteingIntMathTask, pvParameters )
/* Yield in case cooperative scheduling is being used. */
#if configUSE_PREEMPTION == 0
{
taskYIELD();
}
{
taskYIELD();
}
#endif
}
}

View file

@ -20,7 +20,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* 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 ( INCLUDE_eTaskGetState == 1 )
{
configASSERT( eTaskGetState( xControllingTaskHandle ) == eSuspended );
configASSERT( eTaskGetState( xBlockingTaskHandle ) == eSuspended );
}
{
configASSERT( eTaskGetState( xControllingTaskHandle ) == eSuspended );
configASSERT( eTaskGetState( xBlockingTaskHandle ) == eSuspended );
}
#endif /* INCLUDE_eTaskGetState */
/* Is the blocking task suspended? */
@ -325,17 +325,17 @@ static void prvRecursiveMutexPollingTask( void * pvParameters )
}
#if ( INCLUDE_uxTaskPriorityGet == 1 )
{
/* Check priority inherited. */
configASSERT( uxTaskPriorityGet( NULL ) == recmuCONTROLLING_TASK_PRIORITY );
}
{
/* Check priority inherited. */
configASSERT( uxTaskPriorityGet( NULL ) == recmuCONTROLLING_TASK_PRIORITY );
}
#endif /* INCLUDE_uxTaskPriorityGet */
#if ( INCLUDE_eTaskGetState == 1 )
{
configASSERT( eTaskGetState( xControllingTaskHandle ) == eBlocked );
configASSERT( eTaskGetState( xBlockingTaskHandle ) == eBlocked );
}
{
configASSERT( eTaskGetState( xControllingTaskHandle ) == eBlocked );
configASSERT( eTaskGetState( xBlockingTaskHandle ) == eBlocked );
}
#endif /* INCLUDE_eTaskGetState */
/* Release the mutex, disinheriting the higher priority again. */
@ -345,18 +345,18 @@ static void prvRecursiveMutexPollingTask( void * pvParameters )
}
#if ( INCLUDE_uxTaskPriorityGet == 1 )
{
/* Check priority disinherited. */
configASSERT( uxTaskPriorityGet( NULL ) == recmuPOLLING_TASK_PRIORITY );
}
{
/* Check priority disinherited. */
configASSERT( uxTaskPriorityGet( NULL ) == recmuPOLLING_TASK_PRIORITY );
}
#endif /* INCLUDE_uxTaskPriorityGet */
}
}
#if configUSE_PREEMPTION == 0
{
taskYIELD();
}
{
taskYIELD();
}
#endif
}
}