adding SYNCING clock_state for external sync

pull/51/head
midilab 1 day ago
parent aa943fb711
commit 07e291ec9d
  1. 7
      src/uClock.cpp
  2. 1
      src/uClock.h

@ -304,10 +304,15 @@ void uClockClass::handleExternalClock()
break;
case STARTING:
clock_state = STARTED;
clock_state = SYNCING;
ext_clock_us = micros();
break;
case SYNCING:
// set clock_mode as start and goes on to calculate the first ext_interval
clock_state = STARTED;
// no break here just go on to calculate our first ext_interval
case STARTED:
uint32_t now_clock_us = micros();
last_interval = clock_diff(ext_clock_us, now_clock_us);

@ -66,6 +66,7 @@ class uClockClass {
enum ClockState {
PAUSED = 0,
STARTING,
SYNCING,
STARTED
};

Loading…
Cancel
Save