- Abstract the memory stats into its own class.

- Fix a bug with debug mqtt
- nrf52 needs more love, there's a strange error while linking. Help appreciated
This commit is contained in:
Thomas Göttgens
2023-02-17 12:31:51 +01:00
parent e2f5e9206d
commit 4967a16abe
8 changed files with 91 additions and 25 deletions

View File

@@ -1,5 +1,6 @@
#include "OSThread.h"
#include "configuration.h"
#include "memGet.h"
#include <assert.h>
namespace concurrency
@@ -75,12 +76,12 @@ bool OSThread::shouldRun(unsigned long time)
void OSThread::run()
{
#ifdef DEBUG_HEAP
auto heap = ESP.getFreeHeap();
auto heap = memGet.getFreeHeap();
#endif
currentThread = this;
auto newDelay = runOnce();
#ifdef DEBUG_HEAP
auto newHeap = ESP.getFreeHeap();
auto newHeap = memGet.getFreeHeap();
if (newHeap < heap)
LOG_DEBUG("------ Thread %s leaked heap %d -> %d (%d) ------\n", ThreadName.c_str(), heap, newHeap, newHeap - heap);
if (heap < newHeap)