Skip to content

Commit

Permalink
fix clock.sync(div) could cause excess events with fractional values
Browse files Browse the repository at this point in the history
  • Loading branch information
trentgill committed Jun 30, 2023
1 parent 16cbc91 commit 1bdcd36
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ bool clock_schedule_resume_sync( int coro_id, float beats ){
awaken += dbeats;

// check we haven't already passed it in the sub-beat & add another step if we have
if(awaken <= precise_beat_now){
// we have to loop because fractional beats values may occur >2 times within a beat
while(awaken <= precise_beat_now){
awaken += dbeats;
}

Expand Down

1 comment on commit 1bdcd36

@eethann
Copy link

@eethann eethann commented on 1bdcd36 Jul 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, interesting! Excited to test this out!

Please sign in to comment.