Skip to content

Commit

Permalink
fix forgotten debug output
Browse files Browse the repository at this point in the history
this was accidentally committed - doesn't hurt, but the code should only be active with WLED_DEBUG
  • Loading branch information
softhack007 committed Dec 19, 2024
1 parent 7b3b6b4 commit dc0b6bc
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions wled00/wled00.ino
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ unsigned long lastMillis = 0; //WLEDMM
unsigned long loopCounter = 0; //WLEDMM

unsigned long lps = 0; // loops per second
unsigned long lps2 = 0; // lps without "show"

unsigned long long showtime = 0; // time spent in "show" (micros)
//unsigned long lps2 = 0; // lps without "show"
//unsigned long long showtime = 0; // time spent in "show" (micros)

void setup() __attribute__((used)); // needed for -flto
void setup() {
Expand All @@ -77,24 +76,24 @@ void setup() {
void loop() __attribute__((used)); // needed for -flto
void loop() {
//WLEDMM show loops per second
#ifdef WLED_DEBUG
loopCounter++;
//if (millis() - lastMillis >= 10000) {
if (millis() - lastMillis >= 8000) {
long delta = millis() - lastMillis;
if (delta > 0) {
lps = (loopCounter*1000U) / delta;
//USER_PRINTF("%lu lps\n",(loopCounter*1000U) / delta);
if (delta > (showtime / 1000)) lps2 = (loopCounter*1000U) / (delta - (showtime / 1000));
//if (delta > (showtime / 1000)) lps2 = (loopCounter*1000U) / (delta - (showtime / 1000));
USER_PRINTF("%lu lps\t", lps);
USER_PRINTF("%u fps\t", strip.getFps());
USER_PRINTF("%lu lps without show\t\t", lps2);
//USER_PRINTF("%lu lps without show\t\t", lps2);
USER_PRINTF("frametime %d\t", int(strip.getFrameTime()));
USER_PRINTF("targetFPS %d\n", int(strip.getTargetFps()));
}
lastMillis = millis();
loopCounter = 0;
showtime = 0;
//showtime = 0;
}

#endif
WLED::instance().loop();
}

0 comments on commit dc0b6bc

Please sign in to comment.