fix name sclashes in esp8266 SAM

This commit is contained in:
gemu2015 2020-08-15 17:17:13 +02:00
parent 34a0650b00
commit 45a464082a
11 changed files with 27 additions and 24 deletions

View File

@ -1,7 +1,7 @@
/*
AudioFileSourceHTTPStream
Connect to a HTTP based streaming service
Copyright (C) 2017 Earle F. Philhower, III
This program is free software: you can redistribute it and/or modify
@ -25,6 +25,7 @@
#ifdef ESP32
#include <HTTPClient.h>
#else
#include <WiFiClient.h>
#include <ESP8266HTTPClient.h>
#endif
#include "AudioFileSource.h"
@ -37,7 +38,7 @@ class AudioFileSourceHTTPStream : public AudioFileSource
AudioFileSourceHTTPStream();
AudioFileSourceHTTPStream(const char *url);
virtual ~AudioFileSourceHTTPStream() override;
virtual bool open(const char *url) override;
virtual uint32_t read(void *data, uint32_t len) override;
virtual uint32_t readNonBlock(void *data, uint32_t len) override;
@ -63,4 +64,3 @@ class AudioFileSourceHTTPStream : public AudioFileSource
#endif

View File

@ -1,7 +1,7 @@
/*
AudioFileSourceHTTPStream
Connect to a HTTP based streaming service
Copyright (C) 2017 Earle F. Philhower, III
This program is free software: you can redistribute it and/or modify
@ -23,9 +23,9 @@
#include <Arduino.h>
#ifdef ESP32
#include <HTTPClient.h>
// #include <HTTPClient.h>
#else
#include <ESP8266HTTPClient.h>
// #include <ESP8266HTTPClient.h>
#endif
#include "AudioFileSourceHTTPStream.h"
@ -36,7 +36,7 @@ class AudioFileSourceICYStream : public AudioFileSourceHTTPStream
AudioFileSourceICYStream();
AudioFileSourceICYStream(const char *url);
virtual ~AudioFileSourceICYStream() override;
virtual bool open(const char *url) override;
private:
@ -47,4 +47,3 @@ class AudioFileSourceICYStream : public AudioFileSourceHTTPStream
#endif

View File

@ -1,7 +1,7 @@
/*
AudioFileSourceSPIFFS
Input SD card "file" to be used by AudioGenerator
Copyright (C) 2017 Earle F. Philhower, III
This program is free software: you can redistribute it and/or modify
@ -22,6 +22,10 @@
#define _AUDIOFILESOURCESD_H
#include "AudioFileSource.h"
#ifdef ESP8266
#include <SdFat.h>
#include <SDFS.h>
#endif
#include <SD.h>
@ -31,7 +35,7 @@ class AudioFileSourceSD : public AudioFileSource
AudioFileSourceSD();
AudioFileSourceSD(const char *filename);
virtual ~AudioFileSourceSD() override;
virtual bool open(const char *filename) override;
virtual uint32_t read(void *data, uint32_t len) override;
virtual bool seek(int32_t pos, int dir) override;
@ -46,4 +50,3 @@ class AudioFileSourceSD : public AudioFileSource
#endif

View File

@ -1,7 +1,7 @@
/*
AudioGeneratorMP3
Wrap libmad MP3 library to play audio
Copyright (C) 2017 Earle F. Philhower, III
This program is free software: you can redistribute it and/or modify
@ -52,7 +52,7 @@ AudioGeneratorMP3::~AudioGeneratorMP3()
free(synth);
free(frame);
free(stream);
}
}
}
@ -153,7 +153,7 @@ bool AudioGeneratorMP3::GetOneSample(int16_t sample[2])
output->SetChannels(synth->pcm.channels);
lastChannels = synth->pcm.channels;
}
// If we're here, we have one decoded frame and sent 0 or more samples out
if (samplePtr < synth->pcm.length) {
sample[AudioOutput::LEFTCHANNEL ] = synth->pcm.samples[0][samplePtr];
@ -161,7 +161,7 @@ bool AudioGeneratorMP3::GetOneSample(int16_t sample[2])
samplePtr++;
} else {
samplePtr = 0;
switch ( mad_synth_frame_onens(synth, frame, nsCount++) ) {
case MAD_FLOW_STOP:
case MAD_FLOW_BREAK: audioLogger->printf_P(PSTR("msf1ns failed\n"));
@ -272,17 +272,19 @@ bool AudioGeneratorMP3::begin(AudioFileSource *source, AudioOutput *output)
stream = NULL;
frame = NULL;
synth = NULL;
uint32_t size = buffLen + sizeof(struct mad_stream) + sizeof(struct mad_frame) + sizeof(struct mad_synth);
audioLogger->printf_P("OOM error in MP3: Want %d bytes\n", size);
return false;
}
}
mad_stream_init(stream);
mad_frame_init(frame);
mad_synth_init(synth);
synth->pcm.length = 0;
mad_stream_options(stream, 0); // TODO - add options support
madInitted = true;
running = true;
return true;
}
@ -349,4 +351,3 @@ extern "C" {
}
#endif
}

View File

@ -2,7 +2,7 @@
#define RENDERTABS_H
#include <pgmspace.h>
#include "debug.h"
#include "samdebug.h"
#if debug
#define PROGMEM
#endif
@ -196,7 +196,7 @@ const unsigned char ampl3data[] PROGMEM =
//tab42240
const signed char sinus[256] PROGMEM = {0,3,6,9,12,16,19,22,25,28,31,34,37,40,43,46,49,51,54,57,60,63,65,68,71,73,76,78,81,83,85,88,90,92,94,96,98,100,102,104,106,107,109,111,112,113,115,116,117,118,120,121,122,122,123,124,125,125,126,126,126,127,127,127,127,127,127,127,126,126,126,125,125,124,123,122,122,121,120,118,117,116,115,113,112,111,109,107,106,104,102,100,98,96,94,92,90,88,85,83,81,78,76,73,71,68,65,63,60,57,54,51,49,46,43,40,37,34,31,28,25,22,19,16,12,9,6,3,0,-3,-6,-9,-12,-16,-19,-22,-25,-28,-31,-34,-37,-40,-43,-46,-49,-51,-54,-57,-60,-63,-65,-68,-71,-73,-76,-78,-81,-83,-85,-88,-90,-92,-94,-96,-98,-100,-102,-104,-106,-107,-109,-111,-112,-113,-115,-116,-117,-118,-120,-121,-122,-122,-123,-124,-125,-125,-126,-126,-126,-127,-127,-127,-127,-127,-127,-127,-126,-126,-126,-125,-125,-124,-123,-122,-122,-121,-120,-118,-117,-116,-115,-113,-112,-111,-109,-107,-106,-104,-102,-100,-98,-96,-94,-92,-90,-88,-85,-83,-81,-78,-76,-73,-71,-68,-65,-63,-60,-57,-54,-51,-49,-46,-43,-40,-37,-34,-31,-28,-25,-22,-19,-16,-12,-9,-6,-3};
const signed char sinus[256] PROGMEM = {0,3,6,9,12,16,19,22,25,28,31,34,37,40,43,46,49,51,54,57,60,63,65,68,71,73,76,78,81,83,85,88,90,92,94,96,98,100,102,104,106,107,109,111,112,113,115,116,117,118,120,121,122,122,123,124,125,125,126,126,126,127,127,127,127,127,127,127,126,126,126,125,125,124,123,122,122,121,120,118,117,116,115,113,112,111,109,107,106,104,102,100,98,96,94,92,90,88,85,83,81,78,76,73,71,68,65,63,60,57,54,51,49,46,43,40,37,34,31,28,25,22,19,16,12,9,6,3,0,-3,-6,-9,-12,-16,-19,-22,-25,-28,-31,-34,-37,-40,-43,-46,-49,-51,-54,-57,-60,-63,-65,-68,-71,-73,-76,-78,-81,-83,-85,-88,-90,-92,-94,-96,-98,-100,-102,-104,-106,-107,-109,-111,-112,-113,-115,-116,-117,-118,-120,-121,-122,-122,-123,-124,-125,-125,-126,-126,-126,-127,-127,-127,-127,-127,-127,-127,-126,-126,-126,-125,-125,-124,-123,-122,-122,-121,-120,-118,-117,-116,-115,-113,-112,-111,-109,-107,-106,-104,-102,-100,-98,-96,-94,-92,-90,-88,-85,-83,-81,-78,-76,-73,-71,-68,-65,-63,-60,-57,-54,-51,-49,-46,-43,-40,-37,-34,-31,-28,-25,-22,-19,-16,-12,-9,-6,-3};
//tab42496
const unsigned char rectangle[] PROGMEM =

View File

@ -2,7 +2,7 @@
#define SAMTABS_H
#include <pgmspace.h>
#include "debug.h"
#include "samdebug.h"
#if debug
#define PROGMEM
#endif

View File

@ -2,7 +2,7 @@
#include <string.h>
#include "reciter.h"
#include "ReciterTabs.h"
#include "debug.h"
#include "samdebug.h"
#include "SamData.h"
unsigned char A, X, Y;

View File

@ -5,7 +5,7 @@
#include "render.h"
#include "RenderTabs.h"
#include "debug.h"
#include "samdebug.h"
//extern int debug;
#include <pgmspace.h>
#include "SamData.h"

View File

@ -32,7 +32,7 @@ default_envs =
; tasmota-BR
; tasmota-CN
; tasmota-CZ
tasmota-DE
; tasmota-DE
; tasmota-ES
; tasmota-FR
; tasmota-GR