fixed bug where play button was not working after changing modes
This commit is contained in:
@ -293,6 +293,8 @@ void resetClocks() {
|
|||||||
channelPulseCount[i] = 0;
|
channelPulseCount[i] = 0;
|
||||||
digitalWrite(outsPins[i], LOW); //to avoid stuck leds
|
digitalWrite(outsPins[i], LOW); //to avoid stuck leds
|
||||||
}
|
}
|
||||||
|
pulseCount = 0;
|
||||||
|
tickCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void saveState() {
|
void saveState() {
|
||||||
@ -337,6 +339,10 @@ void checkInputs() {
|
|||||||
masterClockMode++;
|
masterClockMode++;
|
||||||
} else {
|
} else {
|
||||||
masterClockMode = 0;
|
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();
|
updateScreen();
|
||||||
}
|
}
|
||||||
@ -391,7 +397,7 @@ void checkInputs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//play button
|
//play button
|
||||||
if (!digitalRead(START_STOP_BTN_PIN) && !playBtnPushed) {
|
if (!digitalRead(START_STOP_BTN_PIN) && !playBtnPushed && masterClockMode == 0) {
|
||||||
resetClocks();
|
resetClocks();
|
||||||
isPlaying = !isPlaying;
|
isPlaying = !isPlaying;
|
||||||
playBtnPushed = true;
|
playBtnPushed = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user