Added output of heap to check memory leakage.
This commit is contained in:
parent
c7547144d2
commit
3e2aba52ec
|
@ -4,6 +4,9 @@
|
|||
#include <MD_MAX72xx.h>
|
||||
#include <SPI.h>
|
||||
#include "MD_RobotEyes.h"
|
||||
extern "C" {
|
||||
#include "user_interface.h"
|
||||
}
|
||||
|
||||
#define DISPLAY_CLK_PIN D5
|
||||
#define DISPLAY_DATA_PIN D7
|
||||
|
@ -181,6 +184,7 @@ void Display::loop() {
|
|||
}
|
||||
|
||||
void Display::reInitializeDisplay() {
|
||||
uint32_t free = system_get_free_heap_size();
|
||||
#define REINIT_AFTER_ms 5000
|
||||
#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() > AVOID_REINIT_BEFORE_AND_AFTER_FULLMINUTE_FOR_s) {
|
||||
P.begin();
|
||||
Serial.println("reinit display");
|
||||
Serial.print("reinit display, free="); Serial.println(free);
|
||||
last_reinit_ts = millis();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue