Skip to content

Commit 4258666

Browse files
committed
fix: Add missing macro guards in task.h
- Add missing conditions to prevent unintended access to certain APIs in task.h - The condition is mentioned in the API description but was absent in the code
1 parent fed39c5 commit 4258666

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/task.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,12 +602,12 @@ typedef enum
602602
* \defgroup xTaskCreateRestricted xTaskCreateRestricted
603603
* \ingroup Tasks
604604
*/
605-
#if ( portUSING_MPU_WRAPPERS == 1 )
605+
#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
606606
BaseType_t xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition,
607607
TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
608608
#endif
609609

610-
#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
610+
#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
611611
BaseType_t xTaskCreateRestrictedAffinitySet( const TaskParameters_t * const pxTaskDefinition,
612612
UBaseType_t uxCoreAffinityMask,
613613
TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;

0 commit comments

Comments
 (0)