mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-14 16:57:41 -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
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -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 ) */
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue