Add style check matching RP2040 core (#740)

Will let us backport the BackgroundAudio patches to libhelix easier and clean
up some ugly formatting we've let develop.
This commit is contained in:
Earle F. Philhower, III authored and GitHub committed 2025-04-11 12:09:49 -07:00
1 parent 62dd23a74a
commit f9e72dbb21
434 files changed
+94604 -93082

No files matched your search

+29 -18
View File
@@ -1,13 +1,16 @@
#include <Arduino.h>
#if defined(ARDUINO_ARCH_RP2040)
#define WIFI_OFF
class __x { public: __x() {}; void mode() {}; };
__x WiFi;
#define WIFI_OFF
class __x {
public: __x() {};
void mode() {};
};
__x WiFi;
#elif defined(ESP32)
#include <WiFi.h>
#include <WiFi.h>
#else
#include <ESP8266WiFi.h>
#include <ESP8266WiFi.h>
#endif
#include "AudioFileSourcePROGMEM.h"
@@ -24,15 +27,14 @@ AudioOutputI2S *out;
AudioOutputMixer *mixer;
AudioOutputMixerStub *stub[2];
void setup()
{
WiFi.mode(WIFI_OFF);
void setup() {
WiFi.mode(WIFI_OFF);
Serial.begin(115200);
delay(1000);
Serial.printf("WAV start\n");
audioLogger = &Serial;
file[0] = new AudioFileSourcePROGMEM( viola, sizeof(viola) );
file[0] = new AudioFileSourcePROGMEM(viola, sizeof(viola));
out = new AudioOutputI2S();
mixer = new AudioOutputMixer(32, out);
stub[0] = mixer->NewInput();
@@ -43,29 +45,38 @@ void setup()
Serial.printf("starting 1\n");
}
void loop()
{
void loop() {
static uint32_t start = 0;
static bool go = false;
if (!start) start = millis();
if (wav[0]->isRunning()) {
if (!wav[0]->loop()) { wav[0]->stop(); stub[0]->stop(); Serial.printf("stopping 1\n"); }
if (!start) {
start = millis();
}
if (millis()-start > 3000) {
if (wav[0]->isRunning()) {
if (!wav[0]->loop()) {
wav[0]->stop();
stub[0]->stop();
Serial.printf("stopping 1\n");
}
}
if (millis() - start > 3000) {
if (!go) {
Serial.printf("starting 2\n");
stub[1] = mixer->NewInput();
stub[1]->SetGain(0.4);
wav[1] = new AudioGeneratorWAV();
file[1] = new AudioFileSourcePROGMEM( viola, sizeof(viola) );
file[1] = new AudioFileSourcePROGMEM(viola, sizeof(viola));
wav[1]->begin(file[1], stub[1]);
go = true;
}
if (wav[1]->isRunning()) {
if (!wav[1]->loop()) { wav[1]->stop(); stub[1]->stop(); Serial.printf("stopping 2\n");}
if (!wav[1]->loop()) {
wav[1]->stop();
stub[1]->stop();
Serial.printf("stopping 2\n");
}
}
}