Skip to content

Commit

Permalink
new: Free Heap Logger supports ESP32 now as well
Browse files Browse the repository at this point in the history
  • Loading branch information
dniklaus committed Dec 3, 2019
1 parent 0808dc5 commit 0c21c5b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions AppDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
#include <DbgTraceLevel.h>
#include <DbgPrintConsole.h>
#include <DbgTraceOut.h>
#ifdef ESP8266
#if defined(ESP8266)
extern "C"
{
#include "user_interface.h"
}
#elif defined(ESP32)
#include "Esp.h"
#else
#include <RamUtils.h>
#endif
Expand All @@ -43,8 +45,10 @@ class FreeHeapLogTimerAdapter : public TimerAdapter
void timeExpired()
{
int freeHeap = 0;
#ifdef ESP8266
#if defined(ESP8266)
freeHeap = system_get_free_heap_size();
#elif defined(ESP32)
freeHeap = ESP.getFreeHeap();
#else
freeHeap = RamUtils::getFreeRam();
#endif
Expand Down

0 comments on commit 0c21c5b

Please sign in to comment.