more verbose thread debug

This commit is contained in:
Thomas Göttgens 2022-12-30 17:03:48 +01:00
parent e73ae7cdac
commit 8364c2b147

View File

@ -288,7 +288,17 @@ void Power::readPowerStatus()
newStatus.notifyObservers(&powerStatus2);
#ifdef DEBUG_HEAP
if (lastheap != ESP.getFreeHeap()) {
DEBUG_MSG("Heap status: %d/%d bytes free (%d), running %d threads\n", ESP.getFreeHeap(), ESP.getHeapSize(), ESP.getFreeHeap() - lastheap , concurrency::mainController.size(false));
DEBUG_MSG("Threads running:");
int running = 0;
for(int i = 0; i < MAX_THREADS; i++){
auto thread = concurrency::mainController.get(i);
if((thread != nullptr) && (thread->enabled)) {
DEBUG_MSG(" %s", thread->ThreadName.c_str());
running++;
}
}
DEBUG_MSG("\n");
DEBUG_MSG("Heap status: %d/%d bytes free (%d), running %d/%d threads\n", ESP.getFreeHeap(), ESP.getHeapSize(), ESP.getFreeHeap() - lastheap, running, concurrency::mainController.size(false));
lastheap = ESP.getFreeHeap();
}
#endif