mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-14 08:47:45 -04:00
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:
parent
fea193d03c
commit
2b956b97c7
23 changed files with 1090 additions and 576 deletions
|
@ -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. */
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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( ; ; )
|
||||
|
|
|
@ -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 ) */
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
#define PORTMACRO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
|
@ -146,7 +146,7 @@
|
|||
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void * pvParameters )
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* PORTMACRO_H */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
|
@ -176,15 +176,15 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
|
|||
#endif
|
||||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
{
|
||||
pxNewQueue->ucQueueType = ucQueueType;
|
||||
}
|
||||
{
|
||||
pxNewQueue->ucQueueType = ucQueueType;
|
||||
}
|
||||
#endif /* configUSE_TRACE_FACILITY */
|
||||
|
||||
#if ( configUSE_QUEUE_SETS == 1 )
|
||||
{
|
||||
pxNewQueue->pxQueueSetContainer = NULL;
|
||||
}
|
||||
{
|
||||
pxNewQueue->pxQueueSetContainer = NULL;
|
||||
}
|
||||
#endif /* configUSE_QUEUE_SETS */
|
||||
|
||||
traceQUEUE_CREATE( pxNewQueue );
|
||||
|
@ -262,12 +262,12 @@ QueueHandle_t xQueueGenericCreate( const UBaseType_t uxQueueLength,
|
|||
#endif /* ifdef VERIFAST */
|
||||
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
{
|
||||
/* Queues can be created either statically or dynamically, so
|
||||
* note this task was created dynamically in case it is later
|
||||
* deleted. */
|
||||
pxNewQueue->ucStaticallyAllocated = pdFALSE;
|
||||
}
|
||||
{
|
||||
/* Queues can be created either statically or dynamically, so
|
||||
* note this task was created dynamically in case it is later
|
||||
* deleted. */
|
||||
pxNewQueue->ucStaticallyAllocated = pdFALSE;
|
||||
}
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
|
||||
prvInitialiseNewQueue( uxQueueLength, uxItemSize, pucQueueStorage, ucQueueType, pxNewQueue );
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* 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
|
||||
* 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 */
|
||||
/*@assert false;@*/
|
||||
#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 );
|
||||
pxQueue->u.xSemaphore.xMutexHolder = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
/* The mutex is no longer being held. */
|
||||
xReturn = xTaskPriorityDisinherit( pxQueue->u.xSemaphore.xMutexHolder );
|
||||
pxQueue->u.xSemaphore.xMutexHolder = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
}
|
||||
#endif /* configUSE_MUTEXES */
|
||||
}
|
||||
else if( xPosition == queueSEND_TO_BACK )
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* 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
|
||||
* 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
|
||||
* blocked waiting for data to become available? */
|
||||
#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.
|
||||
* A context switch is required. */
|
||||
vTaskMissedYield();
|
||||
}
|
||||
else
|
||||
{
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
/* 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. */
|
||||
vTaskMissedYield();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 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;
|
||||
}
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
}
|
||||
#else /* configUSE_QUEUE_SETS */
|
||||
else
|
||||
{
|
||||
/* Tasks that are removed from the event list will get added to
|
||||
* the pending ready list as the scheduler is still suspended. */
|
||||
/* 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. */
|
||||
/* The task waiting has a higher priority so record that a
|
||||
* context switch is required. */
|
||||
vTaskMissedYield();
|
||||
}
|
||||
else
|
||||
|
@ -120,6 +97,29 @@ static void prvUnlockQueue( Queue_t * const pxQueue )
|
|||
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 */
|
||||
|
||||
--cTxLock;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
|
@ -47,39 +47,39 @@ void vQueueDelete( QueueHandle_t xQueue )
|
|||
traceQUEUE_DELETE( pxQueue );
|
||||
|
||||
#if ( configQUEUE_REGISTRY_SIZE > 0 )
|
||||
{
|
||||
vQueueUnregisterQueue( pxQueue );
|
||||
}
|
||||
{
|
||||
vQueueUnregisterQueue( pxQueue );
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 0 ) )
|
||||
{
|
||||
/* The queue can only have been allocated dynamically - free it
|
||||
* again. */
|
||||
vPortFree( pxQueue );
|
||||
#ifdef VERIFAST /*< leak ghost state on deletion */
|
||||
/*@leak buffer(_, _, _, _);@*/
|
||||
/*@leak malloc_block(_, _);@*/
|
||||
#endif
|
||||
}
|
||||
{
|
||||
/* The queue can only have been allocated dynamically - free it
|
||||
* again. */
|
||||
vPortFree( pxQueue );
|
||||
#ifdef VERIFAST /*< leak ghost state on deletion */
|
||||
/*@leak buffer(_, _, _, _);@*/
|
||||
/*@leak malloc_block(_, _);@*/
|
||||
#endif
|
||||
}
|
||||
#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
|
||||
* check before attempting to free the memory. */
|
||||
if( pxQueue->ucStaticallyAllocated == ( uint8_t ) pdFALSE )
|
||||
{
|
||||
vPortFree( pxQueue );
|
||||
}
|
||||
else
|
||||
{
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
vPortFree( pxQueue );
|
||||
}
|
||||
else
|
||||
{
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
}
|
||||
#else /* if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 0 ) ) */
|
||||
{
|
||||
/* The queue must have been statically allocated, so is not going to be
|
||||
* deleted. Avoid compiler warnings about the unused parameter. */
|
||||
( void ) pxQueue;
|
||||
}
|
||||
{
|
||||
/* The queue must have been statically allocated, so is not going to be
|
||||
* deleted. Avoid compiler warnings about the unused parameter. */
|
||||
( void ) pxQueue;
|
||||
}
|
||||
#endif /* configSUPPORT_DYNAMIC_ALLOCATION */
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
|
@ -52,10 +52,10 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
|
|||
configASSERT( pxQueue );
|
||||
configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) );
|
||||
configASSERT( !( ( xCopyPosition == queueOVERWRITE ) && ( pxQueue->uxLength != 1 ) ) );
|
||||
#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
|
||||
{
|
||||
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
|
||||
}
|
||||
#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
|
||||
{
|
||||
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
|
||||
}
|
||||
#endif
|
||||
#endif /* ifdef VERIFAST */
|
||||
|
||||
|
@ -85,70 +85,34 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
|
|||
|
||||
/* VeriFast: we do not verify this configuration option */
|
||||
#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;
|
||||
|
||||
xYieldRequired = prvCopyDataToQueue( pxQueue, pvItemToQueue, xCopyPosition );
|
||||
|
||||
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. */
|
||||
queueYIELD_IF_USING_PREEMPTION();
|
||||
}
|
||||
else
|
||||
{
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
/* 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. */
|
||||
queueYIELD_IF_USING_PREEMPTION();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 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();
|
||||
}
|
||||
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
|
||||
* queue then unblock it now. */
|
||||
if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE )
|
||||
|
@ -156,9 +120,9 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
|
|||
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. */
|
||||
* 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
|
||||
|
@ -169,8 +133,8 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
|
|||
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
|
||||
* 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();
|
||||
}
|
||||
|
@ -179,6 +143,42 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
|
|||
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 */
|
||||
|
||||
/*@
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* 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
|
||||
* 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 */
|
||||
#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
|
||||
* 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();
|
||||
}
|
||||
*pxHigherPriorityTaskWoken = pdTRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -137,40 +132,17 @@ BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue,
|
|||
}
|
||||
else
|
||||
{
|
||||
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();
|
||||
}
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
}
|
||||
#else /* configUSE_QUEUE_SETS */
|
||||
else
|
||||
{
|
||||
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. */
|
||||
/* The task waiting has a higher priority so
|
||||
* record that a context switch is required. */
|
||||
if( pxHigherPriorityTaskWoken != NULL )
|
||||
{
|
||||
*pxHigherPriorityTaskWoken = pdTRUE;
|
||||
|
@ -189,12 +161,40 @@ BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue,
|
|||
{
|
||||
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 */
|
||||
}
|
||||
else
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* 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
|
||||
* 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 ) ) );
|
||||
|
||||
/* Cannot block if the scheduler is suspended. */
|
||||
#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
|
||||
{
|
||||
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
|
||||
}
|
||||
#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
|
||||
{
|
||||
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
|
||||
}
|
||||
#endif
|
||||
#endif /* ifdef VERIFAST */
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* 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
|
||||
* 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 ) ) );
|
||||
|
||||
/* Cannot block if the scheduler is suspended. */
|
||||
#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
|
||||
{
|
||||
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
|
||||
}
|
||||
#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
|
||||
{
|
||||
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
|
||||
}
|
||||
#endif
|
||||
#endif /* ifdef VERIFAST */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue