From 1a81905346339242f8bce29df633a1bb27719a69 Mon Sep 17 00:00:00 2001 From: midilab Date: Sat, 26 Jul 2025 08:06:01 -0300 Subject: [PATCH] safely initialize onClockPauseCallback and onClockContinueCallback at constructor --- src/uClock.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/uClock.cpp b/src/uClock.cpp index 7e0ade6..1589e5e 100755 --- a/src/uClock.cpp +++ b/src/uClock.cpp @@ -81,7 +81,6 @@ #include "platforms/software.h" #endif - // // Platform specific timer setup/control // @@ -136,6 +135,8 @@ uClockClass::uClockClass() onStepCallback = nullptr; onClockStartCallback = nullptr; onClockStopCallback = nullptr; + onClockPauseCallback = nullptr; + onClockContinueCallback = nullptr; // initialize reference data calculateReferencedata(); } @@ -301,9 +302,9 @@ void uClockClass::handleExternalClock() { switch (clock_state) { case SYNCING: - // set clock_mode as started and goes on to calculate the first ext_interval + // set clock_mode as started, and goes on to calculate the first ext_interval clock_state = STARTED; - // no break here just go on to calculate our first ext_interval + // no break here, just go on to calculate our first ext_interval case STARTED: uint32_t now_clock_us = micros();