Add configUSE_EVENT_GROUPS macro in MPU wrapper files

This commit is contained in:
kar-rahul-aws 2024-02-14 16:33:42 +05:30
parent 8ec3080230
commit 77202446cd
2 changed files with 327 additions and 279 deletions

View file

@ -1952,7 +1952,7 @@
#endif /* if ( configUSE_TIMERS == 1 ) */
/*-----------------------------------------------------------*/
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
#if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configUSE_EVENT_GROUPS == 1 ) )
EventGroupHandle_t MPU_xEventGroupCreate( void ) /* FREERTOS_SYSTEM_CALL */
{
EventGroupHandle_t xReturn;
@ -1975,10 +1975,10 @@
return xReturn;
}
#endif /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */
#endif /* #if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configUSE_EVENT_GROUPS == 1 ) ) */
/*-----------------------------------------------------------*/
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configUSE_EVENT_GROUPS == 1 ) )
EventGroupHandle_t MPU_xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer ) /* FREERTOS_SYSTEM_CALL */
{
EventGroupHandle_t xReturn;
@ -2001,9 +2001,10 @@
return xReturn;
}
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
#endif /* #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configUSE_EVENT_GROUPS == 1 ) ) */
/*-----------------------------------------------------------*/
#if ( configUSE_EVENT_GROUPS == 1 )
EventBits_t MPU_xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToWaitFor,
const BaseType_t xClearOnExit,
@ -2030,8 +2031,10 @@
return xReturn;
}
#endif /* #if ( configUSE_EVENT_GROUPS == 1 ) */
/*-----------------------------------------------------------*/
#if ( configUSE_EVENT_GROUPS == 1 )
EventBits_t MPU_xEventGroupClearBits( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToClear ) /* FREERTOS_SYSTEM_CALL */
{
@ -2055,8 +2058,10 @@
return xReturn;
}
#endif /* #if ( configUSE_EVENT_GROUPS == 1 ) */
/*-----------------------------------------------------------*/
#if ( configUSE_EVENT_GROUPS == 1 )
EventBits_t MPU_xEventGroupSetBits( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToSet ) /* FREERTOS_SYSTEM_CALL */
{
@ -2080,8 +2085,10 @@
return xReturn;
}
#endif /* #if ( configUSE_EVENT_GROUPS == 1 ) */
/*-----------------------------------------------------------*/
#if ( configUSE_EVENT_GROUPS == 1 )
EventBits_t MPU_xEventGroupSync( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToSet,
const EventBits_t uxBitsToWaitFor,
@ -2107,8 +2114,10 @@
return xReturn;
}
#endif /* #if ( configUSE_EVENT_GROUPS == 1 ) */
/*-----------------------------------------------------------*/
#if ( configUSE_EVENT_GROUPS == 1 )
void MPU_vEventGroupDelete( EventGroupHandle_t xEventGroup ) /* FREERTOS_SYSTEM_CALL */
{
if( portIS_PRIVILEGED() == pdFALSE )
@ -2127,6 +2136,7 @@
vEventGroupDelete( xEventGroup );
}
}
#endif /* #if ( configUSE_EVENT_GROUPS == 1 ) */
/*-----------------------------------------------------------*/
size_t MPU_xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,

View file

@ -215,6 +215,7 @@
#define MPU_GetTaskHandleAtIndex( lIndex ) ( TaskHandle_t ) MPU_GetHandleAtIndex( ( lIndex ), KERNEL_OBJECT_TYPE_TASK )
#define MPU_GetIndexForTaskHandle( xHandle ) MPU_GetIndexForHandle( ( OpaqueObjectHandle_t ) ( xHandle ), KERNEL_OBJECT_TYPE_TASK )
#if ( configUSE_EVENT_GROUPS == 1 )
/*
* Wrappers to keep all the casting in one place for Event Group APIs.
*/
@ -222,6 +223,8 @@
#define MPU_GetEventGroupHandleAtIndex( lIndex ) ( EventGroupHandle_t ) MPU_GetHandleAtIndex( ( lIndex ), KERNEL_OBJECT_TYPE_EVENT_GROUP )
#define MPU_GetIndexForEventGroupHandle( xHandle ) MPU_GetIndexForHandle( ( OpaqueObjectHandle_t ) ( xHandle ), KERNEL_OBJECT_TYPE_EVENT_GROUP )
#endif /* #if ( configUSE_EVENT_GROUPS == 1 ) */
/*
* Wrappers to keep all the casting in one place for Stream Buffer APIs.
*/
@ -230,7 +233,6 @@
#define MPU_GetIndexForStreamBufferHandle( xHandle ) MPU_GetIndexForHandle( ( OpaqueObjectHandle_t ) ( xHandle ), KERNEL_OBJECT_TYPE_STREAM_BUFFER )
#if ( configUSE_TIMERS == 1 )
/*
* Wrappers to keep all the casting in one place for Timer APIs.
*/
@ -3867,6 +3869,8 @@
/* MPU wrappers for event group APIs. */
/*-----------------------------------------------------------*/
#if ( configUSE_EVENT_GROUPS == 1 )
EventBits_t MPU_xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToWaitFor,
const BaseType_t xClearOnExit,
@ -3938,8 +3942,12 @@
return xReturn;
}
#endif /* #if ( configUSE_EVENT_GROUPS == 1 ) */
/*-----------------------------------------------------------*/
#if ( configUSE_EVENT_GROUPS == 1 )
EventBits_t MPU_xEventGroupClearBitsImpl( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToClear ) PRIVILEGED_FUNCTION;
@ -3973,8 +3981,12 @@
return xReturn;
}
#endif /* #if ( configUSE_EVENT_GROUPS == 1 ) */
/*-----------------------------------------------------------*/
#if ( configUSE_EVENT_GROUPS == 1 )
EventBits_t MPU_xEventGroupSetBitsImpl( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToSet ) PRIVILEGED_FUNCTION;
@ -4008,8 +4020,12 @@
return xReturn;
}
#endif /* #if ( configUSE_EVENT_GROUPS == 1 ) */
/*-----------------------------------------------------------*/
#if ( configUSE_EVENT_GROUPS == 1 )
EventBits_t MPU_xEventGroupSyncImpl( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToSet,
const EventBits_t uxBitsToWaitFor,
@ -4052,9 +4068,11 @@
return xReturn;
}
#endif /* #if ( configUSE_EVENT_GROUPS == 1 ) */
/*-----------------------------------------------------------*/
#if ( configUSE_TRACE_FACILITY == 1 )
#if ( ( configUSE_EVENT_GROUPS == 1 ) && ( configUSE_TRACE_FACILITY == 1 ) )
UBaseType_t MPU_uxEventGroupGetNumberImpl( void * xEventGroup ) PRIVILEGED_FUNCTION;
@ -4085,10 +4103,10 @@
return xReturn;
}
#endif /*( configUSE_TRACE_FACILITY == 1 )*/
#endif /* #if ( ( configUSE_EVENT_GROUPS == 1 ) && ( configUSE_TRACE_FACILITY == 1 ) ) */
/*-----------------------------------------------------------*/
#if ( configUSE_TRACE_FACILITY == 1 )
#if ( ( configUSE_EVENT_GROUPS == 1 ) && ( configUSE_TRACE_FACILITY == 1 ) )
void MPU_vEventGroupSetNumberImpl( void * xEventGroup,
UBaseType_t uxEventGroupNumber ) PRIVILEGED_FUNCTION;
@ -4118,7 +4136,7 @@
}
}
#endif /*( configUSE_TRACE_FACILITY == 1 )*/
#endif /* #if ( ( configUSE_EVENT_GROUPS == 1 ) && ( configUSE_TRACE_FACILITY == 1 ) ) */
/*-----------------------------------------------------------*/
/* Privileged only wrappers for Event Group APIs. These are needed so that
@ -4126,7 +4144,7 @@
* with all the APIs. */
/*-----------------------------------------------------------*/
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
#if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configUSE_EVENT_GROUPS == 1 ) )
EventGroupHandle_t MPU_xEventGroupCreate( void ) /* PRIVILEGED_FUNCTION */
{
@ -4154,10 +4172,10 @@
return xExternalEventGroupHandle;
}
#endif /* if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) */
#endif /* #if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configUSE_EVENT_GROUPS == 1 ) ) */
/*-----------------------------------------------------------*/
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configUSE_EVENT_GROUPS == 1 ) )
EventGroupHandle_t MPU_xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer ) /* PRIVILEGED_FUNCTION */
{
@ -4185,9 +4203,11 @@
return xExternalEventGroupHandle;
}
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
#endif /* #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configUSE_EVENT_GROUPS == 1 ) ) */
/*-----------------------------------------------------------*/
#if ( configUSE_EVENT_GROUPS == 1 )
void MPU_vEventGroupDelete( EventGroupHandle_t xEventGroup ) /* PRIVILEGED_FUNCTION */
{
EventGroupHandle_t xInternalEventGroupHandle = NULL;
@ -4206,9 +4226,11 @@
}
}
}
#endif /* #if ( configUSE_EVENT_GROUPS == 1 ) */
/*-----------------------------------------------------------*/
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configUSE_EVENT_GROUPS == 1 ) )
BaseType_t MPU_xEventGroupGetStaticBuffer( EventGroupHandle_t xEventGroup,
StaticEventGroup_t ** ppxEventGroupBuffer ) /* PRIVILEGED_FUNCTION */
@ -4232,10 +4254,10 @@
return xReturn;
}
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
#endif /* #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configUSE_EVENT_GROUPS == 1 ) ) */
/*-----------------------------------------------------------*/
#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) )
#if ( ( configUSE_EVENT_GROUPS == 1 ) && ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) )
BaseType_t MPU_xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToClear ) /* PRIVILEGED_FUNCTION */
@ -4259,10 +4281,10 @@
return xReturn;
}
#endif /* #if ( ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) ) */
#endif /* #if ( ( configUSE_EVENT_GROUPS == 1 ) && ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) ) */
/*-----------------------------------------------------------*/
#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) )
#if ( ( configUSE_EVENT_GROUPS == 1 ) && ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) )
BaseType_t MPU_xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToSet,
@ -4287,9 +4309,11 @@
return xReturn;
}
#endif /* #if ( ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) ) */
#endif /* #if ( ( configUSE_EVENT_GROUPS == 1 ) && ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) ) */
/*-----------------------------------------------------------*/
#if ( configUSE_EVENT_GROUPS == 1 )
EventBits_t MPU_xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup ) /* PRIVILEGED_FUNCTION */
{
EventBits_t xReturn = 0;
@ -4310,6 +4334,8 @@
return xReturn;
}
#endif /* #if ( configUSE_EVENT_GROUPS == 1 ) */
/*-----------------------------------------------------------*/
/*-----------------------------------------------------------*/
@ -4909,7 +4935,11 @@
( UBaseType_t ) 0, /* SYSTEM_CALL_xTimerGenericCommandFromTask. */
#endif
#if ( configUSE_EVENT_GROUPS == 1 )
( UBaseType_t ) MPU_xEventGroupWaitBitsImpl, /* SYSTEM_CALL_xEventGroupWaitBits. */
#else
( UBaseType_t ) 0, /* SYSTEM_CALL_xEventGroupWaitBits. */
#endif
/* The system calls above this line take 5 parameters. */
@ -5104,6 +5134,7 @@
( UBaseType_t ) 0, /* SYSTEM_CALL_xTimerGetExpiryTime. */
#endif
#if ( configUSE_EVENT_GROUPS == 1 )
( UBaseType_t ) MPU_xEventGroupClearBitsImpl, /* SYSTEM_CALL_xEventGroupClearBits. */
( UBaseType_t ) MPU_xEventGroupSetBitsImpl, /* SYSTEM_CALL_xEventGroupSetBits. */
( UBaseType_t ) MPU_xEventGroupSyncImpl, /* SYSTEM_CALL_xEventGroupSync. */
@ -5115,6 +5146,13 @@
( UBaseType_t ) 0, /* SYSTEM_CALL_uxEventGroupGetNumber. */
( UBaseType_t ) 0, /* SYSTEM_CALL_vEventGroupSetNumber. */
#endif
#else
( UBaseType_t ) 0, /* SYSTEM_CALL_xEventGroupClearBits. */
( UBaseType_t ) 0, /* SYSTEM_CALL_xEventGroupSetBits. */
( UBaseType_t ) 0, /* SYSTEM_CALL_xEventGroupSync. */
( UBaseType_t ) 0, /* SYSTEM_CALL_uxEventGroupGetNumber. */
( UBaseType_t ) 0, /* SYSTEM_CALL_vEventGroupSetNumber. */
#endif
( UBaseType_t ) MPU_xStreamBufferSendImpl, /* SYSTEM_CALL_xStreamBufferSend. */
( UBaseType_t ) MPU_xStreamBufferReceiveImpl, /* SYSTEM_CALL_xStreamBufferReceive. */