Skip to content

Commit

Permalink
ClockManager fix off-by-one
Browse files Browse the repository at this point in the history
sorry, I'm dumb
  • Loading branch information
djphazer committed Dec 21, 2022
1 parent af44a41 commit fa81aaf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion software/o_c_REV/HSClockManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint32_t>(tocks_per_beat[ch]);
tock = (now - beat_tick[ch]) >= count[ch]*ticks_per_tock / static_cast<uint32_t>(tocks_per_beat[ch]);
if (tock) {
if (++count[ch] >= tocks_per_beat[ch]) // multiplier has been met or exceeded
{
Expand Down

0 comments on commit fa81aaf

Please sign in to comment.