From fa81aaf1ff6afdc6e0aba20aeed5aa95cde44cd2 Mon Sep 17 00:00:00 2001 From: "Nicholas J. Michalek" Date: Wed, 21 Dec 2022 07:37:30 -0500 Subject: [PATCH] ClockManager fix off-by-one sorry, I'm dumb --- software/o_c_REV/HSClockManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/software/o_c_REV/HSClockManager.h b/software/o_c_REV/HSClockManager.h index c9dce20b1..6d40aac3a 100644 --- a/software/o_c_REV/HSClockManager.h +++ b/software/o_c_REV/HSClockManager.h @@ -123,7 +123,7 @@ class ClockManager { if (now == last_tock_check[ch] || beat_tick[ch] > now) return false; // cancel redundant check last_tock_check[ch] = now; - tock = (now - beat_tick[ch]) >= (count[ch]+1)*ticks_per_tock / static_cast(tocks_per_beat[ch]); + tock = (now - beat_tick[ch]) >= count[ch]*ticks_per_tock / static_cast(tocks_per_beat[ch]); if (tock) { if (++count[ch] >= tocks_per_beat[ch]) // multiplier has been met or exceeded {