Warning and static removal

Clean up compiler warnings and make static variables in class functions
into class variables where they belong.
This commit is contained in:
Earle F. Philhower, III committed 2017-08-15 20:58:16 -07:00
1 parent 64ceb33a31
commit 0a453a077a
9 files changed
+43 -63

No files matched your search

+6 -3
View File
@@ -20,12 +20,15 @@
#include "AudioOutputSerialWAV.h"
bool AudioOutputSerialWAV::begin()
{
static uint8_t wavHeader[] = { // Hardcoded simple WAV header with 0xffffffff lengths all around
static const uint8_t wavHeaderTemplate[] PROGMEM = { // Hardcoded simple WAV header with 0xffffffff lengths all around
0x52, 0x49, 0x46, 0x46, 0xff, 0xff, 0xff, 0xff, 0x57, 0x41, 0x56, 0x45,
0x66, 0x6d, 0x74, 0x20, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x22, 0x56, 0x00, 0x00, 0x88, 0x58, 0x01, 0x00, 0x04, 0x00, 0x10, 0x00,
0x64, 0x61, 0x74, 0x61, 0xff, 0xff, 0xff, 0xff };
bool AudioOutputSerialWAV::begin()
{
uint8_t wavHeader[sizeof(wavHeaderTemplate)];
memcpy_P(wavHeader, wavHeaderTemplate, sizeof(wavHeaderTemplate));
wavHeader[22] = channels & 0xff;
wavHeader[23] = 0;
wavHeader[24] = hertz & 0xff;