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

Function xTimerGenericCommandFromTask

timers.c:379–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377/*-----------------------------------------------------------*/
378
379 BaseType_t xTimerGenericCommandFromTask( TimerHandle_t xTimer,
380 const BaseType_t xCommandID,
381 const TickType_t xOptionalValue,
382 BaseType_t * const pxHigherPriorityTaskWoken,
383 const TickType_t xTicksToWait )
384 {
385 BaseType_t xReturn = pdFAIL;
386 DaemonTaskMessage_t xMessage;
387
388 configASSERT( xTimer );
389
390 /* Send a message to the timer service task to perform a particular action
391 * on a particular timer definition. */
392 if( xTimerQueue != NULL )
393 {
394 /* Send a command to the timer service task to start the xTimer timer. */
395 xMessage.xMessageID = xCommandID;
396 xMessage.u.xTimerParameters.xMessageValue = xOptionalValue;
397 xMessage.u.xTimerParameters.pxTimer = xTimer;
398
399 configASSERT( xCommandID < tmrFIRST_FROM_ISR_COMMAND );
400
401 if( xCommandID < tmrFIRST_FROM_ISR_COMMAND )
402 {
403 if( xTaskGetSchedulerState() == taskSCHEDULER_RUNNING )
404 {
405 xReturn = xQueueSendToBack( xTimerQueue, &xMessage, xTicksToWait );
406 }
407 else
408 {
409 xReturn = xQueueSendToBack( xTimerQueue, &xMessage, tmrNO_DELAY );
410 }
411 }
412
413 traceTIMER_COMMAND_SEND( xTimer, xCommandID, xOptionalValue, xReturn );
414 }
415 else
416 {
417 mtCOVERAGE_TEST_MARKER();
418 }
419
420 return xReturn;
421 }
422/*-----------------------------------------------------------*/
423
424 BaseType_t xTimerGenericCommandFromISR( TimerHandle_t xTimer,

Callers

nothing calls this directly

Calls 1

xTaskGetSchedulerStateFunction · 0.85

Tested by

no test coverage detected