Skip to content

Commit fbd1dba

Browse files
committed
fix(stats): Add license, usage note and C++ guards
1 parent fbdba95 commit fbd1dba

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed

Diff for: cores/esp32/freertos_stats.cpp

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1+
// Copyright 2024 Espressif Systems (Shanghai) PTE LTD
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
#include "freertos_stats.h"
216
#include "sdkconfig.h"
3-
//#undef CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID
4-
//#undef CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS
517

618
#if CONFIG_FREERTOS_USE_TRACE_FACILITY
719
#include "freertos/FreeRTOS.h"
@@ -97,5 +109,7 @@ void printRunningTasks(Print & printer) {
97109
vPortFree( pxTaskStatusArray );
98110
printer.println();
99111
}
112+
#else
113+
printer.println("FreeRTOS trace facility is not enabled.");
100114
#endif /* CONFIG_FREERTOS_USE_TRACE_FACILITY */
101115
}

Diff for: cores/esp32/freertos_stats.h

+24
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
1+
// Copyright 2024 Espressif Systems (Shanghai) PTE LTD
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
#pragma once
16+
17+
#ifdef __cplusplus
18+
219
#include "Print.h"
320

21+
/*
22+
* Executing this function will cause interrupts and
23+
* the scheduler to be blocked for some time.
24+
* Please use only for debugging purposes.
25+
*/
426
void printRunningTasks(Print & printer);
27+
28+
#endif

0 commit comments

Comments
 (0)