mirror of
https://github.com/TomHarte/CLK.git
synced 2025-08-15 14:27:29 +00:00
Adds a further drift safeguard.
This commit is contained in:
@@ -302,6 +302,10 @@ void Drive::setup_track() {
|
|||||||
offset = track_time_now - time_found;
|
offset = track_time_now - time_found;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reseed cycles_since_index_hole_; 99.99% of the time it'll still be correct as is,
|
||||||
|
// but if the track has rounded one way or the other it may now be very slightly adrift.
|
||||||
|
cycles_since_index_hole_ = (int((time_found + offset) * cycles_per_revolution_)) % cycles_per_revolution_;
|
||||||
|
|
||||||
get_next_event(offset);
|
get_next_event(offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user