lockin: redundant new

This commit is contained in:
Robert Jördens 2021-02-14 17:55:01 +01:00
parent 16c986ab1b
commit b581a016ce
3 changed files with 2 additions and 14 deletions

View File

@ -7,14 +7,6 @@ pub struct Lockin {
} }
impl Lockin { impl Lockin {
/// Create a new Lockin with given IIR coefficients.
pub fn new() -> Self {
let lp = Lowpass::default();
Self {
state: [lp.clone(), lp],
}
}
/// Update the lockin with a sample taken at a given phase. /// Update the lockin with a sample taken at a given phase.
/// The lowpass has a gain of `1 << k`. /// The lowpass has a gain of `1 << k`.
pub fn update(&mut self, sample: i16, phase: i32, k: u8) -> Complex<i32> { pub fn update(&mut self, sample: i16, phase: i32, k: u8) -> Complex<i32> {

View File

@ -34,8 +34,6 @@ const APP: () = {
+ design_parameters::SAMPLE_BUFFER_SIZE_LOG2, + design_parameters::SAMPLE_BUFFER_SIZE_LOG2,
); );
let lockin = Lockin::new();
// Enable ADC/DAC events // Enable ADC/DAC events
stabilizer.adcs.0.start(); stabilizer.adcs.0.start();
stabilizer.adcs.1.start(); stabilizer.adcs.1.start();
@ -59,7 +57,7 @@ const APP: () = {
timestamper: stabilizer.timestamper, timestamper: stabilizer.timestamper,
pll, pll,
lockin, lockin: Lockin::default(),
} }
} }

View File

@ -28,8 +28,6 @@ const APP: () = {
// Configure the microcontroller // Configure the microcontroller
let (mut stabilizer, _pounder) = hardware::setup(c.core, c.device); let (mut stabilizer, _pounder) = hardware::setup(c.core, c.device);
let lockin = Lockin::new();
// Enable ADC/DAC events // Enable ADC/DAC events
stabilizer.adcs.1.start(); stabilizer.adcs.1.start();
stabilizer.dacs.0.start(); stabilizer.dacs.0.start();
@ -39,7 +37,7 @@ const APP: () = {
stabilizer.adc_dac_timer.start(); stabilizer.adc_dac_timer.start();
init::LateResources { init::LateResources {
lockin, lockin: Lockin::default(),
afes: stabilizer.afes, afes: stabilizer.afes,
adc: stabilizer.adcs.1, adc: stabilizer.adcs.1,
dacs: stabilizer.dacs, dacs: stabilizer.dacs,