Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cmake example errors #1037

Merged
merged 10 commits into from
Apr 18, 2024
48 changes: 24 additions & 24 deletions include/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,19 +322,19 @@ typedef struct xLIST
#define listREMOVE_ITEM( pxItemToRemove ) \
do { \
/* The list item knows which list it is in. Obtain the list from the list \
* item. */ \
List_t * const pxList = ( pxItemToRemove )->pxContainer; \
\
( pxItemToRemove )->pxNext->pxPrevious = ( pxItemToRemove )->pxPrevious; \
( pxItemToRemove )->pxPrevious->pxNext = ( pxItemToRemove )->pxNext; \
/* Make sure the index is left pointing to a valid item. */ \
if( pxList->pxIndex == ( pxItemToRemove ) ) \
{ \
pxList->pxIndex = ( pxItemToRemove )->pxPrevious; \
} \
\
( pxItemToRemove )->pxContainer = NULL; \
( ( pxList )->uxNumberOfItems ) -= ( UBaseType_t ) 1U; \
* item. */ \
List_t * const pxList = ( pxItemToRemove )->pxContainer; \
\
( pxItemToRemove )->pxNext->pxPrevious = ( pxItemToRemove )->pxPrevious; \
( pxItemToRemove )->pxPrevious->pxNext = ( pxItemToRemove )->pxNext; \
/* Make sure the index is left pointing to a valid item. */ \
if( pxList->pxIndex == ( pxItemToRemove ) ) \
{ \
pxList->pxIndex = ( pxItemToRemove )->pxPrevious; \
} \
\
( pxItemToRemove )->pxContainer = NULL; \
( ( pxList )->uxNumberOfItems ) = ( UBaseType_t ) ( ( ( pxList )->uxNumberOfItems ) - 1U ); \
} while( 0 )

/*
Expand Down Expand Up @@ -371,17 +371,17 @@ typedef struct xLIST
\
/* Insert a new list item into ( pxList ), but rather than sort the list, \
* makes the new list item the last item to be removed by a call to \
* listGET_OWNER_OF_NEXT_ENTRY(). */ \
( pxNewListItem )->pxNext = pxIndex; \
( pxNewListItem )->pxPrevious = pxIndex->pxPrevious; \
\
pxIndex->pxPrevious->pxNext = ( pxNewListItem ); \
pxIndex->pxPrevious = ( pxNewListItem ); \
\
/* Remember which list the item is in. */ \
( pxNewListItem )->pxContainer = ( pxList ); \
\
( ( pxList )->uxNumberOfItems ) += ( UBaseType_t ) 1U; \
* listGET_OWNER_OF_NEXT_ENTRY(). */ \
( pxNewListItem )->pxNext = pxIndex; \
( pxNewListItem )->pxPrevious = pxIndex->pxPrevious; \
\
pxIndex->pxPrevious->pxNext = ( pxNewListItem ); \
pxIndex->pxPrevious = ( pxNewListItem ); \
\
/* Remember which list the item is in. */ \
( pxNewListItem )->pxContainer = ( pxList ); \
\
( ( pxList )->uxNumberOfItems ) = ( UBaseType_t ) ( ( ( pxList )->uxNumberOfItems ) + 1U ); \
} while( 0 )

/*
Expand Down
6 changes: 3 additions & 3 deletions list.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void vListInsertEnd( List_t * const pxList,
/* Remember which list the item is in. */
pxNewListItem->pxContainer = pxList;

( pxList->uxNumberOfItems ) += ( UBaseType_t ) 1U;
( pxList->uxNumberOfItems ) = ( UBaseType_t ) ( pxList->uxNumberOfItems + 1U );

traceRETURN_vListInsertEnd();
}
Expand Down Expand Up @@ -205,7 +205,7 @@ void vListInsert( List_t * const pxList,
* item later. */
pxNewListItem->pxContainer = pxList;

( pxList->uxNumberOfItems ) += ( UBaseType_t ) 1U;
( pxList->uxNumberOfItems ) = ( UBaseType_t ) ( pxList->uxNumberOfItems + 1U );

traceRETURN_vListInsert();
}
Expand Down Expand Up @@ -237,7 +237,7 @@ UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
}

pxItemToRemove->pxContainer = NULL;
( pxList->uxNumberOfItems ) -= ( UBaseType_t ) 1U;
( pxList->uxNumberOfItems ) = ( UBaseType_t ) ( pxList->uxNumberOfItems - 1U );

traceRETURN_uxListRemove( pxList->uxNumberOfItems );

Expand Down
12 changes: 6 additions & 6 deletions tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@
pxTemp = pxDelayedTaskList; \
pxDelayedTaskList = pxOverflowDelayedTaskList; \
pxOverflowDelayedTaskList = pxTemp; \
xNumOfOverflows += ( BaseType_t ) 1; \
xNumOfOverflows = ( BaseType_t ) ( xNumOfOverflows + 1 ); \
prvResetNextTaskUnblockTime(); \
} while( 0 )

Expand Down Expand Up @@ -903,7 +903,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
/* System idle tasks are being assigned a priority of tskIDLE_PRIORITY - 1 here. */
if( ( pxCurrentTCBs[ xCoreID ]->uxTaskAttributes & taskATTRIBUTE_IS_IDLE ) != 0U )
{
xCurrentCoreTaskPriority = xCurrentCoreTaskPriority - 1;
xCurrentCoreTaskPriority = ( BaseType_t ) ( xCurrentCoreTaskPriority - 1 );
}

if( ( taskTASK_IS_RUNNING( pxCurrentTCBs[ xCoreID ] ) != pdFALSE ) && ( xYieldPendings[ xCoreID ] == pdFALSE ) )
Expand Down Expand Up @@ -2022,7 +2022,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
* updated. */
taskENTER_CRITICAL();
{
uxCurrentNumberOfTasks += ( UBaseType_t ) 1U;
uxCurrentNumberOfTasks = ( UBaseType_t ) ( uxCurrentNumberOfTasks + 1U );

if( pxCurrentTCB == NULL )
{
Expand Down Expand Up @@ -3594,7 +3594,7 @@ static BaseType_t prvCreateIdleTasks( void )
}
else
{
vApplicationGetPassiveIdleTaskMemory( &pxIdleTaskTCBBuffer, &pxIdleTaskStackBuffer, &uxIdleTaskStackSize, xCoreID - 1 );
vApplicationGetPassiveIdleTaskMemory( &pxIdleTaskTCBBuffer, &pxIdleTaskStackBuffer, &uxIdleTaskStackSize, ( BaseType_t ) ( xCoreID - 1 ) );
}
}
#endif /* if ( configNUMBER_OF_CORES == 1 ) */
Expand Down Expand Up @@ -3816,7 +3816,7 @@ void vTaskSuspendAll( void )

/* The scheduler is suspended if uxSchedulerSuspended is non-zero. An increment
* is used to allow calls to vTaskSuspendAll() to nest. */
uxSchedulerSuspended += ( UBaseType_t ) 1U;
uxSchedulerSuspended = ( UBaseType_t ) ( uxSchedulerSuspended + 1U );

/* Enforces ordering for ports and optimised compilers that may otherwise place
* the above increment elsewhere. */
Expand Down Expand Up @@ -3969,7 +3969,7 @@ BaseType_t xTaskResumeAll( void )
* previous call to vTaskSuspendAll(). */
configASSERT( uxSchedulerSuspended != 0U );

uxSchedulerSuspended -= ( UBaseType_t ) 1U;
uxSchedulerSuspended = ( UBaseType_t ) ( uxSchedulerSuspended - 1U );
portRELEASE_TASK_LOCK();

if( uxSchedulerSuspended == ( UBaseType_t ) 0U )
Expand Down
Loading