Skip to content

Commit f191206

Browse files
authored
Merge branch 'main' into picolibc
2 parents 3791677 + 48ad473 commit f191206

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

include/FreeRTOS.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@
293293
#endif
294294

295295
#ifndef INCLUDE_xTaskGetCurrentTaskHandle
296-
#define INCLUDE_xTaskGetCurrentTaskHandle 0
296+
#define INCLUDE_xTaskGetCurrentTaskHandle 1
297297
#endif
298298

299299
#if configUSE_CO_ROUTINES != 0
@@ -1000,6 +1000,16 @@
10001000
#define configSUPPORT_DYNAMIC_ALLOCATION 1
10011001
#endif
10021002

1003+
#if ( ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION != 1 ) )
1004+
#error configUSE_STATS_FORMATTING_FUNCTIONS cannot be used without dynamic allocation, but configSUPPORT_DYNAMIC_ALLOCATION is not set to 1.
1005+
#endif
1006+
1007+
#if ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 )
1008+
#if ( ( configUSE_TRACE_FACILITY != 1 ) && ( configGENERATE_RUN_TIME_STATS != 1 ) )
1009+
#error configUSE_STATS_FORMATTING_FUNCTIONS is 1 but the functions it enables are not used because neither configUSE_TRACE_FACILITY or configGENERATE_RUN_TIME_STATS are 1. Set configUSE_STATS_FORMATTING_FUNCTIONS to 0 in FreeRTOSConfig.h.
1010+
#endif
1011+
#endif
1012+
10031013
#ifndef configSTACK_DEPTH_TYPE
10041014

10051015
/* Defaults to uint16_t for backward compatibility, but can be overridden

portable/GCC/ARM_CA9/port.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
/* Standard includes. */
3030
#include <stdlib.h>
31+
#include <string.h>
3132

3233
/* Scheduler includes. */
3334
#include "FreeRTOS.h"

tasks.c

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,7 @@ static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait,
516516
*/
517517
static void prvResetNextTaskUnblockTime( void ) PRIVILEGED_FUNCTION;
518518

519-
#if ( ( ( configUSE_TRACE_FACILITY == 1 ) || ( configGENERATE_RUN_TIME_STATS == 1 ) ) && \
520-
( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && \
521-
( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
519+
#if ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 )
522520

523521
/*
524522
* Helper function used to pad task names with spaces when printing out
@@ -4392,9 +4390,7 @@ static void prvResetNextTaskUnblockTime( void )
43924390
#endif /* portCRITICAL_NESTING_IN_TCB */
43934391
/*-----------------------------------------------------------*/
43944392

4395-
#if ( ( ( configUSE_TRACE_FACILITY == 1 ) || ( configGENERATE_RUN_TIME_STATS == 1 ) ) && \
4396-
( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && \
4397-
( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
4393+
#if ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 )
43984394

43994395
static char * prvWriteNameToBuffer( char * pcBuffer,
44004396
const char * pcTaskName )
@@ -4418,10 +4414,10 @@ static void prvResetNextTaskUnblockTime( void )
44184414
return &( pcBuffer[ x ] );
44194415
}
44204416

4421-
#endif /* ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) */
4417+
#endif /* ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) */
44224418
/*-----------------------------------------------------------*/
44234419

4424-
#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
4420+
#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) )
44254421

44264422
void vTaskList( char * pcWriteBuffer )
44274423
{
@@ -4524,23 +4520,17 @@ static void prvResetNextTaskUnblockTime( void )
45244520
}
45254521
}
45264522

4527-
#endif /* ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) */
4523+
#endif /* ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) ) */
45284524
/*----------------------------------------------------------*/
45294525

4530-
#if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
4526+
#if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configUSE_TRACE_FACILITY == 1 ) )
45314527

45324528
void vTaskGetRunTimeStats( char * pcWriteBuffer )
45334529
{
45344530
TaskStatus_t * pxTaskStatusArray;
45354531
UBaseType_t uxArraySize, x;
45364532
configRUN_TIME_COUNTER_TYPE ulTotalTime, ulStatsAsPercentage;
45374533

4538-
#if ( configUSE_TRACE_FACILITY != 1 )
4539-
{
4540-
#error configUSE_TRACE_FACILITY must also be set to 1 in FreeRTOSConfig.h to use vTaskGetRunTimeStats().
4541-
}
4542-
#endif
4543-
45444534
/*
45454535
* PLEASE NOTE:
45464536
*
@@ -4651,7 +4641,7 @@ static void prvResetNextTaskUnblockTime( void )
46514641
}
46524642
}
46534643

4654-
#endif /* ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) ) */
4644+
#endif /* ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 ) ) */
46554645
/*-----------------------------------------------------------*/
46564646

46574647
TickType_t uxTaskResetEventItemValue( void )

0 commit comments

Comments
 (0)