fix: Add MPU wrapper for xTimerDelete API (#1412)

When using MPU wrappers v2, xTimerDelete needs to be a real function
rather than a macro so that the kernel object pool index can be freed
after the timer is successfully deleted. Without this, deleting a timer
leaks the kernel object pool entry.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
This commit is contained in:
Anubhav Rawal 2026-07-08 17:38:51 -07:00 committed by GitHub
parent ae46383c90
commit a50edad08b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 44 additions and 1 deletions

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 );