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

Function prvInitialiseNewTimer

timers.c:345–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343/*-----------------------------------------------------------*/
344
345 static void prvInitialiseNewTimer( const char * const pcTimerName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
346 const TickType_t xTimerPeriodInTicks,
347 const UBaseType_t uxAutoReload,
348 void * const pvTimerID,
349 TimerCallbackFunction_t pxCallbackFunction,
350 Timer_t * pxNewTimer )
351 {
352 /* 0 is not a valid value for xTimerPeriodInTicks. */
353 configASSERT( ( xTimerPeriodInTicks > 0 ) );
354
355 if( pxNewTimer != NULL )
356 {
357 /* Ensure the infrastructure used by the timer service task has been
358 * created/initialised. */
359 prvCheckForValidListAndQueue();
360
361 /* Initialise the timer structure members using the function
362 * parameters. */
363 pxNewTimer->pcTimerName = pcTimerName;
364 pxNewTimer->xTimerPeriodInTicks = xTimerPeriodInTicks;
365 pxNewTimer->pvTimerID = pvTimerID;
366 pxNewTimer->pxCallbackFunction = pxCallbackFunction;
367 vListInitialiseItem( &( pxNewTimer->xTimerListItem ) );
368
369 if( uxAutoReload != pdFALSE )
370 {
371 pxNewTimer->ucStatus |= tmrSTATUS_IS_AUTORELOAD;
372 }
373
374 traceTIMER_CREATE( pxNewTimer );
375 }
376 }
377/*-----------------------------------------------------------*/
378
379 BaseType_t xTimerGenericCommandFromTask( TimerHandle_t xTimer,

Callers 2

xTimerCreateFunction · 0.85
xTimerCreateStaticFunction · 0.85

Calls 2

vListInitialiseItemFunction · 0.85

Tested by

no test coverage detected