fixed bug where play button was not working after changing modes

This commit is contained in:
--global
2023-05-12 21:13:24 +03:00
parent cf0bf0f188
commit 343422c1b5

View File

@ -293,6 +293,8 @@ void resetClocks() {
channelPulseCount[i] = 0;
digitalWrite(outsPins[i], LOW); //to avoid stuck leds
}
pulseCount = 0;
tickCount = 0;
}
void saveState() {
@ -337,6 +339,10 @@ void checkInputs() {
masterClockMode++;
} else {
masterClockMode = 0;
isPlaying = false; // These don't seem to help with play btn not working after switching modes
resetClocks(); // so maybe remove them
calculateBPMTiming(); //
calculateCycles(); //
}
updateScreen();
}
@ -391,7 +397,7 @@ void checkInputs() {
}
//play button
if (!digitalRead(START_STOP_BTN_PIN) && !playBtnPushed) {
if (!digitalRead(START_STOP_BTN_PIN) && !playBtnPushed && masterClockMode == 0) {
resetClocks();
isPlaying = !isPlaying;
playBtnPushed = true;