MCPcopy Create free account
hub / github.com/FreeRTOS/FreeRTOS-Kernel / prvCheckForValidListAndQueue

Function prvCheckForValidListAndQueue

timers.c:991–1039  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

989/*-----------------------------------------------------------*/
990
991 static void prvCheckForValidListAndQueue( void )
992 {
993 /* Check that the list from which active timers are referenced, and the
994 * queue used to communicate with the timer service, have been
995 * initialised. */
996 taskENTER_CRITICAL();
997 {
998 if( xTimerQueue == NULL )
999 {
1000 vListInitialise( &xActiveTimerList1 );
1001 vListInitialise( &xActiveTimerList2 );
1002 pxCurrentTimerList = &xActiveTimerList1;
1003 pxOverflowTimerList = &xActiveTimerList2;
1004
1005 #if ( configSUPPORT_STATIC_ALLOCATION == 1 )
1006 {
1007 /* The timer queue is allocated statically in case
1008 * configSUPPORT_DYNAMIC_ALLOCATION is 0. */
1009 PRIVILEGED_DATA static StaticQueue_t xStaticTimerQueue; /*lint !e956 Ok to declare in this manner to prevent additional conditional compilation guards in other locations. */
1010 PRIVILEGED_DATA static uint8_t ucStaticTimerQueueStorage[ ( size_t ) configTIMER_QUEUE_LENGTH * sizeof( DaemonTaskMessage_t ) ]; /*lint !e956 Ok to declare in this manner to prevent additional conditional compilation guards in other locations. */
1011
1012 xTimerQueue = xQueueCreateStatic( ( UBaseType_t ) configTIMER_QUEUE_LENGTH, ( UBaseType_t ) sizeof( DaemonTaskMessage_t ), &( ucStaticTimerQueueStorage[ 0 ] ), &xStaticTimerQueue );
1013 }
1014 #else
1015 {
1016 xTimerQueue = xQueueCreate( ( UBaseType_t ) configTIMER_QUEUE_LENGTH, sizeof( DaemonTaskMessage_t ) );
1017 }
1018 #endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
1019
1020 #if ( configQUEUE_REGISTRY_SIZE > 0 )
1021 {
1022 if( xTimerQueue != NULL )
1023 {
1024 vQueueAddToRegistry( xTimerQueue, "TmrQ" );
1025 }
1026 else
1027 {
1028 mtCOVERAGE_TEST_MARKER();
1029 }
1030 }
1031 #endif /* configQUEUE_REGISTRY_SIZE */
1032 }
1033 else
1034 {
1035 mtCOVERAGE_TEST_MARKER();
1036 }
1037 }
1038 taskEXIT_CRITICAL();
1039 }
1040/*-----------------------------------------------------------*/
1041
1042 BaseType_t xTimerIsTimerActive( TimerHandle_t xTimer )

Callers 2

xTimerCreateTimerTaskFunction · 0.85
prvInitialiseNewTimerFunction · 0.85

Calls 2

vListInitialiseFunction · 0.85
vQueueAddToRegistryFunction · 0.85

Tested by

no test coverage detected