From 971bc1109d7e78aa65c5744dfe0c36c437a35bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Thu, 3 Jun 2021 15:33:09 +0000 Subject: [PATCH] pll: add advance() --- dsp/src/pll.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dsp/src/pll.rs b/dsp/src/pll.rs index 8df750f..989facd 100644 --- a/dsp/src/pll.rs +++ b/dsp/src/pll.rs @@ -78,6 +78,13 @@ impl PLL { self.y = self.y.wrapping_add(f); (self.y, f) } + + /// Advance the PLL without providing a new timestamp. + pub fn advance(&mut self) -> (i32, i32) { + self.x = self.x.wrapping_add(self.f); + self.y = self.y.wrapping_add(self.f); + (self.y, self.f) + } } #[cfg(test)]