debug code updates & fixes

better output when using WLED_DEBUG_HEAP without WLED_DEBUG
This commit is contained in:
Frank
2025-10-25 00:53:25 +02:00
parent 22d142942a
commit 60878305fb
4 changed files with 14 additions and 13 deletions

View File

@@ -76,19 +76,20 @@ void setup() {
void loop() __attribute__((used)); // needed for -flto
void loop() {
//WLEDMM show loops per second
#ifdef WLED_DEBUG
#if defined(WLED_DEBUG) || defined(WLED_DEBUG_HEAP)
loopCounter++;
//if (millis() - lastMillis >= 10000) {
if (millis() - lastMillis >= 8000) {
long delta = millis() - lastMillis;
if (delta > 0) {
if ((delta > 0) && (loopCounter > 0)) {
lps = (loopCounter*1000U) / delta;
//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("%3lu lps %5.1fms \t", lps, float(delta) / float(loopCounter));
USER_PRINTF("%3u fps\t\t", strip.getFps());
//USER_PRINTF("%lu lps without show\t\t", lps2);
USER_PRINTF("target frametime %dms\t", int(strip.getFrameTime()));
USER_PRINTF("target FPS %d\n", int(strip.getTargetFps()));
//USER_PRINTF("target frametime %dms\t", int(strip.getFrameTime()));
//USER_PRINTF("target FPS %d", int(strip.getTargetFps()));
USER_PRINTLN("");
}
lastMillis = millis();
loopCounter = 0;