mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2026-10-09 23:53:04 -04:00
Merge 78455b3f32 into 8be86d4a24
This commit is contained in:
commit
7f4eaf1e88
2 changed files with 33 additions and 0 deletions
|
|
@ -82,6 +82,15 @@ typedef struct tmrTimerControl * TimerHandle_t;
|
|||
*/
|
||||
typedef void (* TimerCallbackFunction_t)( TimerHandle_t xTimer );
|
||||
|
||||
/*
|
||||
* Defines the prototype for a callback invoked by the timer daemon when it
|
||||
* processes a timer delete command. The timer remains valid for the duration
|
||||
* of this callback.
|
||||
*/
|
||||
typedef void (* TimerDeleteCallbackFunction_t)( TimerHandle_t xTimer,
|
||||
TimerCallbackFunction_t pxCallbackFunction,
|
||||
void * pvTimerID );
|
||||
|
||||
/*
|
||||
* Defines the prototype to which functions used with the
|
||||
* xTimerPendFunctionCallFromISR() function must conform.
|
||||
|
|
@ -1293,6 +1302,14 @@ void vTimerSetReloadMode( TimerHandle_t xTimer,
|
|||
*/
|
||||
BaseType_t xTimerGetReloadMode( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/**
|
||||
* Registers a callback that is invoked by the timer daemon immediately before
|
||||
* it releases a deleted timer's control block.
|
||||
*
|
||||
* @param pxDeleteCallback The callback to invoke, or NULL to unregister it.
|
||||
*/
|
||||
void vTimerDeleteCallbackRegister( TimerDeleteCallbackFunction_t pxDeleteCallback ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/**
|
||||
* UBaseType_t uxTimerGetReloadMode( TimerHandle_t xTimer );
|
||||
*
|
||||
|
|
|
|||
16
timers.c
16
timers.c
|
|
@ -148,6 +148,7 @@
|
|||
/* A queue that is used to send commands to the timer service task. */
|
||||
PRIVILEGED_DATA static QueueHandle_t xTimerQueue = NULL;
|
||||
PRIVILEGED_DATA static TaskHandle_t xTimerTaskHandle = NULL;
|
||||
PRIVILEGED_DATA static TimerDeleteCallbackFunction_t pxTimerDeleteCallback = NULL;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
@ -1049,6 +1050,15 @@
|
|||
break;
|
||||
|
||||
case tmrCOMMAND_DELETE:
|
||||
/* Notify wrappers while the timer control block and
|
||||
* its callback context are still valid. */
|
||||
if( pxTimerDeleteCallback != NULL )
|
||||
{
|
||||
pxTimerDeleteCallback( ( TimerHandle_t ) pxTimer,
|
||||
pxTimer->pxCallbackFunction,
|
||||
pxTimer->pvTimerID );
|
||||
}
|
||||
|
||||
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
||||
{
|
||||
/* The timer has already been removed from the active list,
|
||||
|
|
@ -1193,6 +1203,12 @@
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vTimerDeleteCallbackRegister( TimerDeleteCallbackFunction_t pxDeleteCallback )
|
||||
{
|
||||
pxTimerDeleteCallback = pxDeleteCallback;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void * pvTimerGetTimerID( const TimerHandle_t xTimer )
|
||||
{
|
||||
Timer_t * const pxTimer = xTimer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue