Stability fix

This commit is contained in:
Dejvino
2026-02-19 07:24:59 +01:00
parent de6775a7d7
commit 4ec306b8b9
2 changed files with 14 additions and 10 deletions
+2 -5
View File
@@ -15,7 +15,7 @@
#include "UIThread.h"
#include "SharedState.h"
static Step local_sequence[NUM_TRACKS][NUM_STEPS];
static void handleInput();
static void drawUI();
@@ -106,8 +106,7 @@ static void generateSequenceData(int themeType, Step (*target)[NUM_STEPS]) {
}
void generateTheme(int themeType) {
Step local_sequence[NUM_TRACKS][NUM_STEPS];
generateSequenceData(themeType, sequence);
generateSequenceData(themeType, local_sequence);
midi.lock();
memcpy(sequence, local_sequence, sizeof(local_sequence));
@@ -353,7 +352,6 @@ static void drawUI() {
bool local_trackMute[NUM_TRACKS];
int local_midiChannel;
MelodyStrategy* local_strategy;
Step local_sequence[NUM_TRACKS][NUM_STEPS];
int local_playbackStep;
int local_scaleNotes[12];
@@ -401,7 +399,6 @@ static void drawUI() {
static void updateLeds() {
// Make local copies of shared data inside a critical section
// to avoid holding the lock during slow LED update operations.
Step local_sequence[NUM_TRACKS][NUM_STEPS];
int local_playbackStep;
bool local_isPlaying;
UIState local_currentState;