File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -418,6 +418,7 @@ struct Chrono
418418 String name = " " ;
419419 int32_t loopNbr = 0 ;
420420 static inline bool print = false ;
421+ static inline bool teleplot = false ;
421422 int32_t loopMax = 0 ;
422423 unsigned long startTime = 0 ;
423424 unsigned long elapsedTime = 0 ;
Original file line number Diff line number Diff line change @@ -153,12 +153,26 @@ namespace ESP32_Helper
153153 if (cmdTmp.data [0 ] == 1 )
154154 {
155155 Chrono::print = true ;
156- println (" Enable Chrono Print" );
156+ Chrono::teleplot = false ;
157+ println (" Enable Chrono Print, Disable Teleplot" );
158+ }
159+ else if (cmdTmp.data [0 ] == 2 )
160+ {
161+ Chrono::print = false ;
162+ Chrono::teleplot = true ;
163+ println (" Disable Chrono Print, Enable Teleplot" );
164+ }
165+ else if (cmdTmp.data [0 ] == 3 )
166+ {
167+ Chrono::print = true ;
168+ Chrono::teleplot = true ;
169+ println (" Enable Chrono Print & Teleplot" );
157170 }
158171 else
159172 {
160173 Chrono::print = false ;
161- println (" Disable Chrono Print" );
174+ Chrono::teleplot = false ;
175+ println (" Disable Chrono Print & Teleplot" );
162176 }
163177 }
164178 else if (cmdTmp.cmd .startsWith (" SPIFFS" ))
Original file line number Diff line number Diff line change @@ -229,7 +229,15 @@ Format Specifier
229229
230230 void printChrono (Chrono chrono)
231231 {
232- println (" Chrono [" +chrono.name +" ]: " + String (chrono.elapsedTime ) + " µs" );
232+ if (Chrono::print)
233+ {
234+ String name = " Chrono[" +chrono.name +" ]" ;
235+ int time = (int )(chrono.elapsedTime /chrono.loopNbr );
236+ if (Chrono::print)
237+ println (" Chrono [%s]: %d µs" , chrono.name .c_str (), time);
238+ }
239+ // if(Chrono::teleplot)
240+ // teleplot(name,time);
233241 }
234242
235243 void teleplot (const String &varName, float var)
You can’t perform that action at this time.
0 commit comments