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:
1 parent
62dd23a74a
commit
f9e72dbb21
434 files changed
+94604
-93082
No files matched your search
@@ -3,13 +3,16 @@
|
||||
#include "AudioGeneratorMOD.h"
|
||||
#include "AudioOutputI2S.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
|
||||
|
||||
// enigma.mod sample from the mod archive: https://modarchive.org/index.php?request=view_by_moduleid&query=42146
|
||||
@@ -19,27 +22,27 @@ AudioGeneratorMOD *mod;
|
||||
AudioFileSourcePROGMEM *file;
|
||||
AudioOutputI2S *out;
|
||||
|
||||
void setup()
|
||||
{
|
||||
void setup() {
|
||||
WiFi.mode(WIFI_OFF); //WiFi.forceSleepBegin();
|
||||
Serial.begin(115200);
|
||||
delay(1000);
|
||||
|
||||
audioLogger = &Serial;
|
||||
file = new AudioFileSourcePROGMEM( enigma_mod, sizeof(enigma_mod) );
|
||||
file = new AudioFileSourcePROGMEM(enigma_mod, sizeof(enigma_mod));
|
||||
// out = new AudioOutputI2S(0, 1); Uncomment this line, comment the next one to use the internal DAC channel 1 (pin25) on ESP32
|
||||
out = new AudioOutputI2S();
|
||||
mod = new AudioGeneratorMOD();
|
||||
mod->SetBufferSize(3*1024);
|
||||
mod->SetBufferSize(3 * 1024);
|
||||
mod->SetSampleRate(44100);
|
||||
mod->SetStereoSeparation(32);
|
||||
mod->begin(file, out);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
void loop() {
|
||||
if (mod->isRunning()) {
|
||||
if (!mod->loop()) mod->stop();
|
||||
if (!mod->loop()) {
|
||||
mod->stop();
|
||||
}
|
||||
} else {
|
||||
Serial.printf("MOD done\n");
|
||||
delay(1000);
|
||||
|
||||
Reference in new issue
Block a user