Skip to content

Fix MISRA_C_2012 rule 20.7 violation #843

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

Merged
merged 9 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions stream_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,16 @@
* invoke the callback else use the send complete macro which is provided by default for all instances.
*/
#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
#define prvSEND_COMPLETED( pxStreamBuffer ) \
do { \
if( ( pxStreamBuffer )->pxSendCompletedCallback != NULL ) \
{ \
pxStreamBuffer->pxSendCompletedCallback( ( pxStreamBuffer ), pdFALSE, NULL ); \
} \
else \
{ \
sbSEND_COMPLETED( ( pxStreamBuffer ) ); \
} \
#define prvSEND_COMPLETED( pxStreamBuffer ) \
do { \
if( ( pxStreamBuffer )->pxSendCompletedCallback != NULL ) \
{ \
( pxStreamBuffer )->pxSendCompletedCallback( ( pxStreamBuffer ), pdFALSE, NULL ); \
} \
else \
{ \
sbSEND_COMPLETED( ( pxStreamBuffer ) ); \
} \
} while( 0 )
#else /* if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) */
#define prvSEND_COMPLETED( pxStreamBuffer ) sbSEND_COMPLETED( ( pxStreamBuffer ) )
Expand Down
32 changes: 16 additions & 16 deletions tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,22 +324,22 @@
/* Yields the given core. This must be called from a critical section and xCoreID
* must be valid. This macro is not required in single core since there is only
* one core to yield. */
#define prvYieldCore( xCoreID ) \
do { \
if( xCoreID == ( BaseType_t ) portGET_CORE_ID() ) \
{ \
/* Pending a yield for this core since it is in the critical section. */ \
xYieldPendings[ xCoreID ] = pdTRUE; \
} \
else \
{ \
/* Request other core to yield if it is not requested before. */ \
if( pxCurrentTCBs[ xCoreID ]->xTaskRunState != taskTASK_SCHEDULED_TO_YIELD ) \
{ \
portYIELD_CORE( xCoreID ); \
pxCurrentTCBs[ xCoreID ]->xTaskRunState = taskTASK_SCHEDULED_TO_YIELD; \
} \
} \
#define prvYieldCore( xCoreID ) \
do { \
if( ( xCoreID ) == ( BaseType_t ) portGET_CORE_ID() ) \
{ \
/* Pending a yield for this core since it is in the critical section. */ \
xYieldPendings[ ( xCoreID ) ] = pdTRUE; \
} \
else \
{ \
/* Request other core to yield if it is not requested before. */ \
if( pxCurrentTCBs[ ( xCoreID ) ]->xTaskRunState != taskTASK_SCHEDULED_TO_YIELD ) \
{ \
portYIELD_CORE( xCoreID ); \
pxCurrentTCBs[ ( xCoreID ) ]->xTaskRunState = taskTASK_SCHEDULED_TO_YIELD; \
} \
} \
} while( 0 )
#endif /* #if ( configNUMBER_OF_CORES > 1 ) */
/*-----------------------------------------------------------*/
Expand Down