Add clock reset behavior to EXT when internally clocked.
This commit is contained in:
5
clock.h
5
clock.h
@ -145,6 +145,11 @@ class Clock {
|
|||||||
uClock.stop();
|
uClock.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reset all clock counters to 0.
|
||||||
|
void Reset() {
|
||||||
|
uClock.resetCounters();
|
||||||
|
}
|
||||||
|
|
||||||
// Returns true if the clock is not running.
|
// Returns true if the clock is not running.
|
||||||
bool IsPaused() {
|
bool IsPaused() {
|
||||||
return uClock.clock_state == uClock.PAUSED;
|
return uClock.clock_state == uClock.PAUSED;
|
||||||
|
|||||||
@ -35,6 +35,14 @@
|
|||||||
* BTN2:
|
* BTN2:
|
||||||
* Shift - hold and rotate encoder to change current selected output channel.
|
* Shift - hold and rotate encoder to change current selected output channel.
|
||||||
*
|
*
|
||||||
|
* EXT:
|
||||||
|
* External clock input. When Gravity is set to INTERNAL clock mode, this
|
||||||
|
* input is used to reset clocks.
|
||||||
|
*
|
||||||
|
* CV1:
|
||||||
|
* CV2:
|
||||||
|
* External analog input used to provide modulation to any channel parameter.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <gravity.h>
|
#include <gravity.h>
|
||||||
@ -143,11 +151,14 @@ void HandleIntClockTick(uint32_t tick) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void HandleExtClockTick() {
|
void HandleExtClockTick() {
|
||||||
// Ignore tick if not using external source.
|
if (gravity.clock.InternalSource()) {
|
||||||
if (!gravity.clock.ExternalSource()) {
|
// Use EXT as Reset when internally clocked.
|
||||||
return;
|
ResetOutputs();
|
||||||
|
gravity.clock.Reset();
|
||||||
|
} else {
|
||||||
|
// Register clock tick.
|
||||||
|
gravity.clock.Tick();
|
||||||
}
|
}
|
||||||
gravity.clock.Tick();
|
|
||||||
app.refresh_screen = true;
|
app.refresh_screen = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user