From f6d36e76aae124c739490bbc1c2d8aae2835bd9e Mon Sep 17 00:00:00 2001 From: midilab Date: Wed, 30 Mar 2022 07:43:59 -0300 Subject: [PATCH] initialize external_clock at slave first start state --- src/uClock.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/uClock.cpp b/src/uClock.cpp index 62640df..a6a11bf 100755 --- a/src/uClock.cpp +++ b/src/uClock.cpp @@ -280,14 +280,12 @@ void uClockClass::handleExternalClock() case STARTING: state = STARTED; + external_clock = micros(); break; case STARTED: uint32_t u_timer = micros(); - if(external_tick == 0) { - external_clock = u_timer; - } last_interval = clock_diff(external_clock, u_timer); external_clock = u_timer;