Fix deadlock in loading + configurable steps count

This commit is contained in:
Dejvino
2026-02-19 13:34:06 +01:00
parent 617251ffc2
commit 46ecc57cde
9 changed files with 72 additions and 20 deletions
+9 -1
View File
@@ -58,15 +58,19 @@ void setup() {
// 5. Init Sequence
randomSeed(micros());
Serial.println(F("Loading sequence."));
EEPROM.begin(512);
if (!loadSequence()) {
generateRandomScale();
Serial.println(F("Starting fresh instead."));
numSteps = NUM_STEPS;
for(int i=0; i<NUM_TRACKS; i++) {
midiChannels[i] = i + 1;
melodySeeds[i] = random(10000);
currentStrategyIndices[i] = 0;
trackMute[i] = false;
}
generateRandomScale();
generateTheme(1);
}
isPlaying = false; // Don't start playing on boot
@@ -80,6 +84,10 @@ void setup() {
}
void loop1() {
if (!watchdogActive) {
delay(100);
return;
}
unsigned long now = millis();
lastLoop1Time = now;
if (watchdogActive && (now - lastLoop0Time > 1000)) {