Added output of heap to check memory leakage.

This commit is contained in:
Dirk Jahnke 2019-02-03 10:41:48 +01:00
parent c7547144d2
commit 3e2aba52ec
1 changed files with 5 additions and 1 deletions

View File

@ -4,6 +4,9 @@
#include <MD_MAX72xx.h> #include <MD_MAX72xx.h>
#include <SPI.h> #include <SPI.h>
#include "MD_RobotEyes.h" #include "MD_RobotEyes.h"
extern "C" {
#include "user_interface.h"
}
#define DISPLAY_CLK_PIN D5 #define DISPLAY_CLK_PIN D5
#define DISPLAY_DATA_PIN D7 #define DISPLAY_DATA_PIN D7
@ -181,6 +184,7 @@ void Display::loop() {
} }
void Display::reInitializeDisplay() { void Display::reInitializeDisplay() {
uint32_t free = system_get_free_heap_size();
#define REINIT_AFTER_ms 5000 #define REINIT_AFTER_ms 5000
#define AVOID_REINIT_BEFORE_AND_AFTER_FULLMINUTE_FOR_s 3 #define AVOID_REINIT_BEFORE_AND_AFTER_FULLMINUTE_FOR_s 3
@ -190,7 +194,7 @@ void Display::reInitializeDisplay() {
&& currentTime->getSeconds() < 60 - AVOID_REINIT_BEFORE_AND_AFTER_FULLMINUTE_FOR_s && currentTime->getSeconds() < 60 - AVOID_REINIT_BEFORE_AND_AFTER_FULLMINUTE_FOR_s
&& currentTime->getSeconds() > AVOID_REINIT_BEFORE_AND_AFTER_FULLMINUTE_FOR_s) { && currentTime->getSeconds() > AVOID_REINIT_BEFORE_AND_AFTER_FULLMINUTE_FOR_s) {
P.begin(); P.begin();
Serial.println("reinit display"); Serial.print("reinit display, free="); Serial.println(free);
last_reinit_ts = millis(); last_reinit_ts = millis();
} }
} }