Merge branch 'main' into main

This commit is contained in:
wanghengZzz 2026-07-09 09:40:01 +08:00 committed by GitHub
commit f3b5b90625
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 44 additions and 1 deletions

View file

@ -369,6 +369,9 @@ BaseType_t MPU_xTimerGenericCommandFromISR( TimerHandle_t xTimer,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
BaseType_t MPU_xTimerDelete( TimerHandle_t xTimer,
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
/* MPU versions of event_group.h API functions. */
EventBits_t MPU_xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToWaitFor,

View file

@ -190,6 +190,7 @@
#define xTimerCreateStatic MPU_xTimerCreateStatic
#define xTimerGetStaticBuffer MPU_xTimerGetStaticBuffer
#define xTimerGenericCommandFromISR MPU_xTimerGenericCommandFromISR
#define xTimerDelete MPU_xTimerDelete
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
/* Map standard event_group.h API functions to the MPU equivalents. */

View file

@ -667,8 +667,13 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ) PRIVILEGED_FUNCTION;
*
* See the xTimerChangePeriod() API function example usage scenario.
*/
#define xTimerDelete( xTimer, xTicksToWait ) \
#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
BaseType_t xTimerDelete( TimerHandle_t xTimer,
TickType_t xTicksToWait );
#else
#define xTimerDelete( xTimer, xTicksToWait ) \
xTimerGenericCommand( ( xTimer ), tmrCOMMAND_DELETE, 0U, NULL, ( xTicksToWait ) )
#endif
/**
* BaseType_t xTimerReset( TimerHandle_t xTimer, TickType_t xTicksToWait );

View file

@ -3890,6 +3890,40 @@
#endif /* if ( configUSE_TIMERS == 1 ) */
/*-----------------------------------------------------------*/
#if ( configUSE_TIMERS == 1 )
BaseType_t MPU_xTimerDelete( TimerHandle_t xTimer, TickType_t xTicksToWait ) /* PRIVILEGED_FUNCTION */
{
BaseType_t xReturn = pdFALSE;
TimerHandle_t xInternalTimerHandle = NULL;
int32_t lIndex;
lIndex = ( int32_t ) xTimer;
if( IS_EXTERNAL_INDEX_VALID( lIndex ) != pdFALSE )
{
xInternalTimerHandle = MPU_GetTimerHandleAtIndex( CONVERT_TO_INTERNAL_INDEX( lIndex ) );
if( xInternalTimerHandle != NULL )
{
xReturn = xTimerGenericCommandFromTask( xInternalTimerHandle,
tmrCOMMAND_DELETE,
0U, /* xOptionalValue */
NULL, /* pxHigherPriorityTaskWoken */
xTicksToWait );
if( xReturn != pdFALSE )
{
MPU_SetIndexFreeInKernelObjectPool( CONVERT_TO_INTERNAL_INDEX( lIndex ) );
}
}
}
return xReturn;
}
#endif /* if ( configUSE_TIMERS == 1 ) */
/*-----------------------------------------------------------*/
/*-----------------------------------------------------------*/
/* MPU wrappers for event group APIs. */
/*-----------------------------------------------------------*/