Scan MP3 for header, avoid multiple burst errors (#764)
MP3 comes in chunks of encoded data started by a header sequence. Scan for it in the decoder and only pass in data that starts with this header to avoid the burst errors Avoids a avalanche of `lost synchronization` error reports when there is a file error. Also enable additional sketches on the RP2040/RP2350
This commit is contained in:
1 parent
ae685b19e9
commit
39188b81d6
17 files changed
+126
-113
No files matched your search
@@ -1,16 +1,8 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
#ifdef ESP8266
|
||||||
#if defined(ARDUINO_ARCH_RP2040)
|
|
||||||
#define WIFI_OFF
|
|
||||||
class __x {
|
|
||||||
public: __x() {};
|
|
||||||
void mode() {};
|
|
||||||
};
|
|
||||||
__x WiFi;
|
|
||||||
#elif defined(ESP32)
|
|
||||||
#include <WiFi.h>
|
|
||||||
#else
|
|
||||||
#include <ESP8266WiFi.h>
|
#include <ESP8266WiFi.h>
|
||||||
|
#else
|
||||||
|
#include <WiFi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "AudioFileSourcePROGMEM.h"
|
#include "AudioFileSourcePROGMEM.h"
|
||||||
@@ -79,6 +71,4 @@ void loop() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,7 +19,6 @@ void setup() {
|
|||||||
aac->begin(in, out);
|
aac->begin(in, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
if (aac->isRunning()) {
|
if (aac->isRunning()) {
|
||||||
aac->loop();
|
aac->loop();
|
||||||
@@ -28,4 +27,3 @@ void loop() {
|
|||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,4 +30,3 @@ void loop() {
|
|||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,20 +1,13 @@
|
|||||||
#include <Arduino.h>
|
#if (defined(ESP32) && (__GNUC__ >= 8) && (__XTENSA__))
|
||||||
#ifdef ESP32
|
// GCC compiler bug for the Xtensa ESP32s, no MIDI for you. :(
|
||||||
void setup() {
|
void setup() {}
|
||||||
Serial.begin(115200);
|
|
||||||
Serial.printf("ERROR - ESP32 does not support LittleFS\n");
|
|
||||||
}
|
|
||||||
void loop() {}
|
void loop() {}
|
||||||
#else
|
#else
|
||||||
#if defined(ARDUINO_ARCH_RP2040)
|
#include <Arduino.h>
|
||||||
#define WIFI_OFF
|
#ifdef ESP8266
|
||||||
class __x {
|
|
||||||
public: __x() {};
|
|
||||||
void mode() {};
|
|
||||||
};
|
|
||||||
__x WiFi;
|
|
||||||
#else
|
|
||||||
#include <ESP8266WiFi.h>
|
#include <ESP8266WiFi.h>
|
||||||
|
#else
|
||||||
|
#include <WiFi.h>
|
||||||
#endif
|
#endif
|
||||||
#include <AudioOutputI2S.h>
|
#include <AudioOutputI2S.h>
|
||||||
#include <AudioGeneratorMIDI.h>
|
#include <AudioGeneratorMIDI.h>
|
||||||
|
|||||||
@@ -2,17 +2,11 @@
|
|||||||
#include "AudioFileSourcePROGMEM.h"
|
#include "AudioFileSourcePROGMEM.h"
|
||||||
#include "AudioGeneratorMOD.h"
|
#include "AudioGeneratorMOD.h"
|
||||||
#include "AudioOutputI2S.h"
|
#include "AudioOutputI2S.h"
|
||||||
#if defined(ARDUINO_ARCH_RP2040)
|
|
||||||
#define WIFI_OFF
|
#ifdef ESP8266
|
||||||
class __x {
|
|
||||||
public: __x() {};
|
|
||||||
void mode() {};
|
|
||||||
};
|
|
||||||
__x WiFi;
|
|
||||||
#elif defined(ESP32)
|
|
||||||
#include <WiFi.h>
|
|
||||||
#else
|
|
||||||
#include <ESP8266WiFi.h>
|
#include <ESP8266WiFi.h>
|
||||||
|
#else
|
||||||
|
#include <WiFi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// enigma.mod sample from the mod archive: https://modarchive.org/index.php?request=view_by_moduleid&query=42146
|
// enigma.mod sample from the mod archive: https://modarchive.org/index.php?request=view_by_moduleid&query=42146
|
||||||
@@ -48,4 +42,3 @@ void loop() {
|
|||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4,15 +4,10 @@
|
|||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
#if defined(ARDUINO_ARCH_RP2040)
|
#ifdef ESP8266
|
||||||
void setup() {}
|
|
||||||
void loop() {}
|
|
||||||
#else
|
|
||||||
|
|
||||||
#if defined(ESP32)
|
|
||||||
#include <WiFi.h>
|
|
||||||
#else
|
|
||||||
#include <ESP8266WiFi.h>
|
#include <ESP8266WiFi.h>
|
||||||
|
#else
|
||||||
|
#include <WiFi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@@ -168,7 +163,16 @@ void setup() {
|
|||||||
Serial.println("IP address: ");
|
Serial.println("IP address: ");
|
||||||
Serial.println(WiFi.localIP());
|
Serial.println(WiFi.localIP());
|
||||||
Serial.println("Contacting Time Server");
|
Serial.println("Contacting Time Server");
|
||||||
|
#if defined(ARDUINO_ARCH_RP2040)
|
||||||
|
NTP.begin("pool.ntp.org", "time.nist.gov");
|
||||||
|
Serial.print("Waiting for NTP time sync: ");
|
||||||
|
NTP.waitSet([]() {
|
||||||
|
Serial.print(".");
|
||||||
|
});
|
||||||
|
Serial.println("");
|
||||||
|
#else
|
||||||
configTime(3600 * timezone, daysavetime * 3600, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org");
|
configTime(3600 * timezone, daysavetime * 3600, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org");
|
||||||
|
#endif
|
||||||
struct tm tmstruct ;
|
struct tm tmstruct ;
|
||||||
do {
|
do {
|
||||||
tmstruct.tm_year = 0;
|
tmstruct.tm_year = 0;
|
||||||
@@ -194,4 +198,3 @@ void loop() {
|
|||||||
sayTime(tmstruct.tm_hour, tmstruct.tm_min, talkie);
|
sayTime(tmstruct.tm_hour, tmstruct.tm_min, talkie);
|
||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
@@ -19,24 +19,29 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#if defined(ARDUINO_ARCH_RP2040)
|
|
||||||
void setup() {}
|
|
||||||
void loop() {}
|
|
||||||
#else
|
|
||||||
|
|
||||||
// ESP8266 server.available() is now server.accept()
|
// ESP8266 server.available() is now server.accept()
|
||||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||||
|
|
||||||
#if defined(ESP32)
|
#ifdef ESP8266
|
||||||
#include <WiFi.h>
|
|
||||||
#else
|
|
||||||
#include <ESP8266WiFi.h>
|
#include <ESP8266WiFi.h>
|
||||||
|
#else
|
||||||
|
#include <WiFi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "AudioFileSourceICYStream.h"
|
#include "AudioFileSourceICYStream.h"
|
||||||
#include "AudioFileSourceBuffer.h"
|
#include "AudioFileSourceBuffer.h"
|
||||||
#include "AudioGeneratorMP3.h"
|
#include "AudioGeneratorMP3.h"
|
||||||
#include "AudioGeneratorAAC.h"
|
#include "AudioGeneratorAAC.h"
|
||||||
|
#if defined(ARDUINO_ARCH_RP2040)
|
||||||
|
#include "AudioOutputPWM.h"
|
||||||
|
#define MOBO rp2040
|
||||||
|
AudioOutputPWM *out = NULL;
|
||||||
|
#else
|
||||||
#include "AudioOutputI2S.h"
|
#include "AudioOutputI2S.h"
|
||||||
|
AudioOutputI2S *out = NULL;
|
||||||
|
#define MOBO ESP
|
||||||
|
#endif
|
||||||
#include <EEPROM.h>
|
#include <EEPROM.h>
|
||||||
|
|
||||||
// Custom web server that doesn't need much RAM
|
// Custom web server that doesn't need much RAM
|
||||||
@@ -58,7 +63,6 @@ WiFiServer server(80);
|
|||||||
AudioGenerator *decoder = NULL;
|
AudioGenerator *decoder = NULL;
|
||||||
AudioFileSourceICYStream *file = NULL;
|
AudioFileSourceICYStream *file = NULL;
|
||||||
AudioFileSourceBuffer *buff = NULL;
|
AudioFileSourceBuffer *buff = NULL;
|
||||||
AudioOutputI2S *out = NULL;
|
|
||||||
|
|
||||||
int volume = 100;
|
int volume = 100;
|
||||||
char title[64];
|
char title[64];
|
||||||
@@ -122,17 +126,18 @@ Change URL: <input type="text" name="url">
|
|||||||
</body>)KEWL";
|
</body>)KEWL";
|
||||||
|
|
||||||
void HandleIndex(WiFiClient *client) {
|
void HandleIndex(WiFiClient *client) {
|
||||||
char buff[sizeof(BODY) + sizeof(title) + sizeof(status) + sizeof(url) + 3 * 2];
|
char buff[std::max(sizeof(BODY) + sizeof(title) + sizeof(status) + sizeof(url) + 3 * 2, sizeof(HEAD))];
|
||||||
|
|
||||||
Serial.printf_P(PSTR("Sending INDEX...Free mem=%d\n"), ESP.getFreeHeap());
|
Serial.printf_P(PSTR("Sending INDEX...Free mem=%d\n"), MOBO.getFreeHeap());
|
||||||
WebHeaders(client, NULL);
|
WebHeaders(client, NULL);
|
||||||
WebPrintf(client, DOCTYPE);
|
WebPrintf(client, DOCTYPE);
|
||||||
client->write_P(PSTR("<html>"), 6);
|
client->write("<html>", 6);
|
||||||
client->write_P(HEAD, strlen_P(HEAD));
|
strcpy_P(buff, HEAD);
|
||||||
|
client->write(buff, strlen(buff));
|
||||||
sprintf_P(buff, BODY, title, volume, volume, status, url);
|
sprintf_P(buff, BODY, title, volume, volume, status, url);
|
||||||
client->write(buff, strlen(buff));
|
client->write(buff, strlen(buff));
|
||||||
client->write_P(PSTR("</html>"), 7);
|
client->write("</html>", 7);
|
||||||
Serial.printf_P(PSTR("Sent INDEX...Free mem=%d\n"), ESP.getFreeHeap());
|
Serial.printf_P(PSTR("Sent INDEX...Free mem=%d\n"), MOBO.getFreeHeap());
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleStatus(WiFiClient *client) {
|
void HandleStatus(WiFiClient *client) {
|
||||||
@@ -259,7 +264,10 @@ void setup() {
|
|||||||
|
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
|
|
||||||
delay(1000);
|
delay(3000);
|
||||||
|
#ifndef ESP8266
|
||||||
|
Serial.printf_P(PSTR("Consider using BackgroundAudio instead, it is much faster and stable.\nhttps://github.com/earlephilhower/BackgroundAudio\n"));
|
||||||
|
#endif
|
||||||
Serial.printf_P(PSTR("Connecting to WiFi\n"));
|
Serial.printf_P(PSTR("Connecting to WiFi\n"));
|
||||||
|
|
||||||
WiFi.disconnect();
|
WiFi.disconnect();
|
||||||
@@ -288,7 +296,11 @@ void setup() {
|
|||||||
audioLogger = &Serial;
|
audioLogger = &Serial;
|
||||||
file = NULL;
|
file = NULL;
|
||||||
buff = NULL;
|
buff = NULL;
|
||||||
|
#if defined(ARDUINO_ARCH_RP2040)
|
||||||
|
out = new AudioOutputPWM(44100, 0);
|
||||||
|
#else
|
||||||
out = new AudioOutputI2S();
|
out = new AudioOutputI2S();
|
||||||
|
#endif
|
||||||
decoder = NULL;
|
decoder = NULL;
|
||||||
|
|
||||||
LoadSettings();
|
LoadSettings();
|
||||||
@@ -299,9 +311,9 @@ void StartNewURL() {
|
|||||||
|
|
||||||
newUrl = false;
|
newUrl = false;
|
||||||
// Stop and free existing ones
|
// Stop and free existing ones
|
||||||
Serial.printf_P(PSTR("Before stop...Free mem=%d\n"), ESP.getFreeHeap());
|
Serial.printf_P(PSTR("Before stop...Free mem=%d\n"), MOBO.getFreeHeap());
|
||||||
StopPlaying();
|
StopPlaying();
|
||||||
Serial.printf_P(PSTR("After stop...Free mem=%d\n"), ESP.getFreeHeap());
|
Serial.printf_P(PSTR("After stop...Free mem=%d\n"), MOBO.getFreeHeap());
|
||||||
SaveSettings();
|
SaveSettings();
|
||||||
Serial.printf_P(PSTR("Saved settings\n"));
|
Serial.printf_P(PSTR("Saved settings\n"));
|
||||||
|
|
||||||
@@ -388,7 +400,7 @@ void loop() {
|
|||||||
static int lastms = 0;
|
static int lastms = 0;
|
||||||
if (millis() - lastms > 1000) {
|
if (millis() - lastms > 1000) {
|
||||||
lastms = millis();
|
lastms = millis();
|
||||||
Serial.printf_P(PSTR("Running for %d seconds%c...Free mem=%d\n"), lastms / 1000, !decoder ? ' ' : (decoder->isRunning() ? '*' : ' '), ESP.getFreeHeap());
|
Serial.printf_P(PSTR("Running for %d seconds%c...Free mem=%d\n"), lastms / 1000, !decoder ? ' ' : (decoder->isRunning() ? '*' : ' '), MOBO.getFreeHeap());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (retryms && millis() - retryms > 0) {
|
if (retryms && millis() - retryms > 0) {
|
||||||
@@ -436,5 +448,3 @@ void loop() {
|
|||||||
client.stop();
|
client.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -19,13 +19,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#if defined(ARDUINO_ARCH_RP2040)
|
#ifdef ESP8266
|
||||||
// Nothing here
|
#include <ESP8266WiFi.h>
|
||||||
#else
|
#else
|
||||||
#ifdef ESP32
|
#include <WiFi.h>
|
||||||
#include <WiFi.h>
|
|
||||||
#else
|
|
||||||
#include <ESP8266WiFi.h>
|
|
||||||
#endif
|
#endif
|
||||||
#include "web.h"
|
#include "web.h"
|
||||||
|
|
||||||
@@ -311,4 +308,3 @@ void Read4Int(char *str, byte *p)
|
|||||||
str += ParseInt(str, &i); p[2] = i; if (*str) str++;
|
str += ParseInt(str, &i); p[2] = i; if (*str) str++;
|
||||||
str += ParseInt(str, &i); p[3] = i;
|
str += ParseInt(str, &i); p[3] = i;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
@@ -74,4 +74,3 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -18,8 +18,6 @@
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(ESP32) || defined(ESP8266)
|
|
||||||
|
|
||||||
#include "AudioFileSourceHTTPStream.h"
|
#include "AudioFileSourceHTTPStream.h"
|
||||||
|
|
||||||
AudioFileSourceHTTPStream::AudioFileSourceHTTPStream() {
|
AudioFileSourceHTTPStream::AudioFileSourceHTTPStream() {
|
||||||
@@ -156,5 +154,3 @@ uint32_t AudioFileSourceHTTPStream::getSize() {
|
|||||||
uint32_t AudioFileSourceHTTPStream::getPos() {
|
uint32_t AudioFileSourceHTTPStream::getPos() {
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -18,14 +18,13 @@
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(ESP32) || defined(ESP8266)
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#ifdef ESP32
|
#ifdef ESP8266
|
||||||
#include <HTTPClient.h>
|
|
||||||
#else
|
|
||||||
#include <ESP8266HTTPClient.h>
|
#include <ESP8266HTTPClient.h>
|
||||||
|
#else
|
||||||
|
#include <HTTPClient.h>
|
||||||
#endif
|
#endif
|
||||||
#include "AudioFileSource.h"
|
#include "AudioFileSource.h"
|
||||||
|
|
||||||
@@ -70,7 +69,3 @@ private:
|
|||||||
int reconnectDelayMs;
|
int reconnectDelayMs;
|
||||||
char saveURL[128];
|
char saveURL[128];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -18,8 +18,6 @@
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(ESP32) || defined(ESP8266)
|
|
||||||
|
|
||||||
#ifdef _GNU_SOURCE
|
#ifdef _GNU_SOURCE
|
||||||
#undef _GNU_SOURCE
|
#undef _GNU_SOURCE
|
||||||
#endif
|
#endif
|
||||||
@@ -260,5 +258,3 @@ retry:
|
|||||||
icyByteCount += ret;
|
icyByteCount += ret;
|
||||||
return read;
|
return read;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -18,14 +18,13 @@
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(ESP32) || defined(ESP8266)
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#ifdef ESP32
|
#ifdef ESP8266
|
||||||
#include <HTTPClient.h>
|
|
||||||
#else
|
|
||||||
#include <ESP8266HTTPClient.h>
|
#include <ESP8266HTTPClient.h>
|
||||||
|
#else
|
||||||
|
#include <HTTPClient.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "AudioFileSourceHTTPStream.h"
|
#include "AudioFileSourceHTTPStream.h"
|
||||||
@@ -43,5 +42,3 @@ private:
|
|||||||
int icyMetaInt;
|
int icyMetaInt;
|
||||||
int icyByteCount;
|
int icyByteCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
+41
-12
@@ -136,19 +136,48 @@ enum mad_flow AudioGeneratorMP3::Input() {
|
|||||||
unused = 0;
|
unused = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
lastReadPos = file->getPos() - unused;
|
bool foundHeader = false;
|
||||||
int len = buffLen - unused;
|
do {
|
||||||
len = file->read(buff + unused, len);
|
lastReadPos = file->getPos() - unused;
|
||||||
if ((len == 0) && (unused == 0)) {
|
int len = buffLen - unused;
|
||||||
// Can't read any from the file, and we don't have anything left. It's done....
|
len = file->read(buff + unused, len);
|
||||||
return MAD_FLOW_STOP;
|
if ((len == 0) && (unused == 0)) {
|
||||||
}
|
// Can't read any from the file, and we don't have anything left. It's done....
|
||||||
if (len < 0) {
|
return MAD_FLOW_STOP;
|
||||||
desync();
|
}
|
||||||
unused = 0;
|
if (len < 0) {
|
||||||
}
|
desync();
|
||||||
|
unused = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
lastBuffLen = len + unused;
|
||||||
|
for (int i = 0; i < lastBuffLen; i++) {
|
||||||
|
if ((buff[i] == 0xff) && ((buff[i + 1] & 0xe0) == 0xe0)) {
|
||||||
|
// We have a header!
|
||||||
|
if (i) {
|
||||||
|
memmove(buff, buff + i, lastBuffLen - i);
|
||||||
|
lastBuffLen -= i;
|
||||||
|
}
|
||||||
|
foundHeader = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!foundHeader) {
|
||||||
|
unused = 0;
|
||||||
|
} else {
|
||||||
|
// Try and fill rest of buffer in case there was some shiftage
|
||||||
|
len = file->read(buff + lastBuffLen, buffLen - lastBuffLen);
|
||||||
|
if (len < 0) {
|
||||||
|
desync();
|
||||||
|
unused = 0;
|
||||||
|
}
|
||||||
|
lastBuffLen += len;
|
||||||
|
if (lastBuffLen < 8) {
|
||||||
|
return MAD_FLOW_STOP;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} while (!foundHeader);
|
||||||
|
|
||||||
lastBuffLen = len + unused;
|
|
||||||
mad_stream_buffer(stream, buff, lastBuffLen);
|
mad_stream_buffer(stream, buff, lastBuffLen);
|
||||||
|
|
||||||
return MAD_FLOW_CONTINUE;
|
return MAD_FLOW_CONTINUE;
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ bool AudioOutputPWM::SetOutputModeMono(bool mono) {
|
|||||||
bool AudioOutputPWM::begin() {
|
bool AudioOutputPWM::begin() {
|
||||||
if (!pwmOn) {
|
if (!pwmOn) {
|
||||||
pwm.setPin(doutPin);
|
pwm.setPin(doutPin);
|
||||||
|
pwm.setBuffers(8, 128);
|
||||||
pwm.begin(hertz);
|
pwm.begin(hertz);
|
||||||
}
|
}
|
||||||
pwmOn = true;
|
pwmOn = true;
|
||||||
|
|||||||
+5
-1
@@ -21,7 +21,11 @@ while [ $(echo $sketches | wc -w) -gt 0 ]; do
|
|||||||
mv -f "$outdir"/*.elf .
|
mv -f "$outdir"/*.elf .
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
# Shift out 5
|
# Shift out 5
|
||||||
sketches=$(echo $sketches | cut -f6- -d " ")
|
if [ $(echo $sketches | wc -w) -gt 5 ]; then
|
||||||
|
sketches=$(echo $sketches | cut -f6- -d " ")
|
||||||
|
else
|
||||||
|
sketches=""
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "::group::Final Sizes"
|
echo "::group::Final Sizes"
|
||||||
|
|||||||
@@ -101,7 +101,21 @@ EOL
|
|||||||
echo $(( 1 - $? ))
|
echo $(( 1 - $? ))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ESP8266 CI infra
|
||||||
|
function skip_sketch()
|
||||||
|
{
|
||||||
|
local sketch=$1
|
||||||
|
local sketchname=$2
|
||||||
|
local sketchdir=$3
|
||||||
|
local sketchdirname=$4
|
||||||
|
|
||||||
|
if [[ "${sketchdirname}.ino" != "$sketchname" ]]; then
|
||||||
|
echo "Skipping $sketch (not the main sketch file)"
|
||||||
|
fi
|
||||||
|
if skip_ino "$sketch" || [[ -f "$sketchdir/.test.skip" ]]; then
|
||||||
|
echo "Skipping $sketch"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
if [ "$BUILD_MOD" == "" ]; then
|
if [ "$BUILD_MOD" == "" ]; then
|
||||||
export BUILD_MOD=1
|
export BUILD_MOD=1
|
||||||
|
|||||||
Reference in new issue
Block a user