Skip to content

Commit 62a857c

Browse files
committed
fix: xTimerDelete stays a macro unless MPU V2 or CMock parsing
1 parent 77a465b commit 62a857c

3 files changed

Lines changed: 28 additions & 2 deletions

File tree

include/FreeRTOS.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,6 +1562,14 @@
15621562
#define traceRETURN_xTimerCreateStatic( pxNewTimer )
15631563
#endif
15641564

1565+
#ifndef traceENTER_xTimerDelete
1566+
#define traceENTER_xTimerDelete( xTimer, xTicksToWait )
1567+
#endif
1568+
1569+
#ifndef traceRETURN_xTimerDelete
1570+
#define traceRETURN_xTimerDelete( xReturn )
1571+
#endif
1572+
15651573
#ifndef traceENTER_xTimerGenericCommandFromTask
15661574
#define traceENTER_xTimerGenericCommandFromTask( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait )
15671575
#endif

include/timers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,9 +667,9 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ) PRIVILEGED_FUNCTION;
667667
*
668668
* See the xTimerChangePeriod() API function example usage scenario.
669669
*/
670-
#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
670+
#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) ) || defined( CMOCK_PARSING )
671671
BaseType_t xTimerDelete( TimerHandle_t xTimer,
672-
TickType_t xTicksToWait );
672+
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
673673
#else
674674
#define xTimerDelete( xTimer, xTicksToWait ) \
675675
xTimerGenericCommand( ( xTimer ), tmrCOMMAND_DELETE, 0U, NULL, ( xTicksToWait ) )

timers.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,24 @@
445445
}
446446
/*-----------------------------------------------------------*/
447447

448+
#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) ) || defined( CMOCK_PARSING )
449+
450+
BaseType_t xTimerDelete( TimerHandle_t xTimer,
451+
TickType_t xTicksToWait )
452+
{
453+
BaseType_t xReturn;
454+
455+
traceENTER_xTimerDelete( xTimer, xTicksToWait );
456+
457+
xReturn = xTimerGenericCommand( xTimer, tmrCOMMAND_DELETE, 0U, NULL, xTicksToWait );
458+
459+
traceRETURN_xTimerDelete( xReturn );
460+
461+
return xReturn;
462+
}
463+
#endif /* #if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) ) || defined( CMOCK_PARSING ) */
464+
/*-----------------------------------------------------------*/
465+
448466
BaseType_t xTimerGenericCommandFromTask( TimerHandle_t xTimer,
449467
const BaseType_t xCommandID,
450468
const TickType_t xOptionalValue,

0 commit comments

Comments
 (0)