Add functions to get the buffers of statically created objects (#641)
Added various ...GetStaticBuffer() functions to get the buffers of statically created objects. --------- Co-authored-by: Paul Bartell <pbartell@amazon.com> Co-authored-by: Nikhil Kamath <110539926+amazonKamath@users.noreply.github.com> Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
This commit is contained in:
24
timers.c
24
timers.c
@ -510,6 +510,30 @@
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
BaseType_t xTimerGetStaticBuffer( TimerHandle_t xTimer,
|
||||
StaticTimer_t ** ppxTimerBuffer )
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
Timer_t * pxTimer = xTimer;
|
||||
|
||||
configASSERT( ppxTimerBuffer != NULL );
|
||||
|
||||
if( ( pxTimer->ucStatus & tmrSTATUS_IS_STATICALLY_ALLOCATED ) != 0 )
|
||||
{
|
||||
*ppxTimerBuffer = ( StaticTimer_t * ) pxTimer;
|
||||
xReturn = pdTRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
xReturn = pdFALSE;
|
||||
}
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
const char * pcTimerGetName( TimerHandle_t xTimer ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||
{
|
||||
Timer_t * pxTimer = xTimer;
|
||||
|
Reference in New Issue
Block a user