Reorganized file structure to allow building Arduino project

This commit is contained in:
Dejvino
2026-02-28 21:49:17 +01:00
parent ef69701878
commit aaeaa9986e
10 changed files with 391 additions and 224 deletions
+45
View File
@@ -0,0 +1,45 @@
#include "SharedState.h"
#include "UIThread.h"
#include "AudioThread.h"
void setup() {
Serial.begin(115200);
delay(2000); // Wait for serial monitor
Serial.println(F("Starting NoiceSynth..."));
setupUI();
setupAudio();
Serial.println(F("Started."));
// Enable Watchdog
lastLoop0Time = millis();
lastLoop1Time = millis();
watchdogActive = true;
}
void loop1() {
if (!watchdogActive) {
delay(100);
return;
}
unsigned long now = millis();
lastLoop1Time = now;
if (watchdogActive && (now - lastLoop0Time > 1000)) {
Serial.println(F("Core 0 Freeze detected! Rebooting..."));
rp2040.reboot();
}
loopAudio();
}
void loop() {
unsigned long now = millis();
lastLoop0Time = now;
if (watchdogActive && (now - lastLoop1Time > 1000)) {
Serial.println(F("Core 1 Freeze detected! Rebooting..."));
rp2040.reboot();
}
loopUI();
}