Skip to content

Commit 857d971

Browse files
author
Geoffroy Arenou
committed
Add some comment to Task
1 parent 128e0f1 commit 857d971

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

include/TaskThread.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class TaskThread
2222
* @param pcName The name of the thread
2323
* @param usStackDepth Length of stack
2424
* @param uxPriority Priority, from High (20) to Low (0)
25-
* @param xCoreID Core affinity, setup and loop are on core 1
25+
* @param xCoreID Core affinity, setup and loop are on core ARDUINO_RUNNING_CORE = 1
2626
*/
2727
TaskThread(TaskFunction_t pvTaskCode, const char *const pcName, const uint32_t usStackDepth = 10000,
2828
UBaseType_t uxPriority = 5, const BaseType_t xCoreID = 0) : _pvTaskCode(pvTaskCode), _pcName(pcName)
@@ -42,6 +42,10 @@ class TaskThread
4242
/* pin task to core x */
4343
xTaskCreatePinnedToCore(pvTaskCode, pcName, usStackDepth, this, uxPriority, &_task, xCoreID);
4444
}
45+
// optimum stack size = the original stack size - (highwatermakrk + 2000 bytes)
46+
// get stack size for task : unsigned int stackSize = uxTaskGetStackHighWaterMark(nullptr);
47+
// uint stackSize = uxTaskGetStackHighWaterMark(nullptr);
48+
// print("Stack Size: %u", stackSize);
4549

4650
~TaskThread()
4751
{

src/ESP32_Helper.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,16 @@ namespace ESP32_Helper
150150
Wifi_Helper::HandleCommand(cmdTmp);
151151
else if (cmdTmp.cmd == "ChronoPrint" && cmdTmp.size == 1)
152152
{
153+
// ChronoPrint:1
153154
if (cmdTmp.data[0] == 1)
154155
{
155156
Chrono::print = true;
156157
Chrono::teleplot = false;
157158
println("Enable Chrono Print, Disable Teleplot");
158-
}
159+
}/*
159160
else if (cmdTmp.data[0] == 2)
160161
{
162+
//ChronoPrint:2
161163
Chrono::print = false;
162164
Chrono::teleplot = true;
163165
println("Disable Chrono Print, Enable Teleplot");
@@ -167,7 +169,7 @@ namespace ESP32_Helper
167169
Chrono::print = true;
168170
Chrono::teleplot = true;
169171
println("Enable Chrono Print & Teleplot");
170-
}
172+
}*/
171173
else
172174
{
173175
Chrono::print = false;

src/Printer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,7 @@ Format Specifier
233233
{
234234
String name = "Chrono["+chrono.name+"]";
235235
int time = (int)(chrono.elapsedTime/chrono.loopNbr);
236-
if(Chrono::print)
237-
println("Chrono [%s]: %d µs", chrono.name.c_str(), time);
236+
print("Chrono [%s]: %d µs", chrono.name.c_str(), time);
238237
}
239238
//if(Chrono::teleplot)
240239
// teleplot(name,time);

0 commit comments

Comments
 (0)