Fixes for recorder and tests.

This commit is contained in:
Fabian Schlenz 2019-10-02 06:21:10 +02:00
parent 54d357e6df
commit 97dd6de280
2 changed files with 5 additions and 2 deletions

View File

@ -36,7 +36,7 @@ Recorder::Recorder() {
LOGln("Recorder * Sending data to port %d", _client_port);
}
} else if (*(char*)data == 'E') {
String effect = String(((char*)(data+1)));
String effect = String((char*)data+1);
LOGln("Recorder * Setting effect %s", effect.c_str());
Window::getFullWindow()->clear();
change_current_effect(effect);

View File

@ -11,15 +11,18 @@ namespace tests {
int i=0;
Effect* effect;
int32_t diffs[3] = {0, 0, 0};
String effect_name;
while (1) {
for (int j=0; j<3; j++) {
int free_at_start = ESP.getFreeHeap();
effect = select_effect(i);
effect->loop(1);
if (effect == NULL) return;
effect_name = effect->get_name();
delete effect;
diffs[i] = ESP.getFreeHeap() - free_at_start;
}
LOGln("Tests * Memory leakage of effect #%d: %d, %d, %d", i, diffs[0], diffs[1], diffs[2]);
LOGln("Tests * Memory leakage of effect %s: %d, %d, %d", effect_name.c_str(), diffs[0], diffs[1], diffs[2]);
i++;
}
}