mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
display correct launch time
This commit is contained in:
parent
b4015a727a
commit
491ed81e83
3 changed files with 7 additions and 9 deletions
|
|
@ -164,13 +164,13 @@ pub trait UsecPosition<U: TimeUnit> {
|
|||
pub trait LaunchSync<U: TimeUnit> {
|
||||
fn sync (&self) -> U;
|
||||
fn set_sync (&self, sync: U);
|
||||
#[inline] fn next_launch_sample (&self) -> U where U: TimeInteger, Self: PulsePosition<U> {
|
||||
#[inline] fn next_launch_pulse (&self) -> U where U: TimeInteger, Self: PulsePosition<U> {
|
||||
let sync = self.sync();
|
||||
let pulse = self.pulse();
|
||||
if pulse % sync == U::from(0) {
|
||||
pulse
|
||||
} else {
|
||||
(pulse / sync) * sync + U::from(1)
|
||||
(pulse / sync + U::from(1)) * sync
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue