install and use a global audioLogger instead of Serial (#198)

* use of global audioLogger-> instead of Serial.

* default to silence

* initialize logger in examples
This commit is contained in:
david gauchard authored and Earle F. Philhower, III committed 2019-07-24 10:02:21 -07:00
1 parent 598163dd59
commit 4fed6a230f
25 files changed
+74 -31

No files matched your search

+3 -3
View File
@@ -73,7 +73,7 @@ void AudioGeneratorMIDI::midi_error(const char *msg, int curpos)
cb.st(curpos, msg);
#if 0
int ptr;
Serial.printf("---> MIDI file error at position %04X (%d): %s\n", (uint16_t) curpos, (uint16_t) curpos, msg);
audioLogger->printf("---> MIDI file error at position %04X (%d): %s\n", (uint16_t) curpos, (uint16_t) curpos, msg);
/* print some bytes surrounding the error */
ptr = curpos - 16;
if (ptr < 0) ptr = 0;
@@ -81,9 +81,9 @@ void AudioGeneratorMIDI::midi_error(const char *msg, int curpos)
for (int i = 0; i < 32; i++) {
char c;
buffer.read (buffer.data, &c, 1);
Serial.printf((ptr + i) == curpos ? " [%02X] " : "%02X ", (int) c & 0xff);
audioLogger->printf((ptr + i) == curpos ? " [%02X] " : "%02X ", (int) c & 0xff);
}
Serial.printf("\n");
audioLogger->printf("\n");
#endif
running = false;
}