Merge branch 'master' into feature/lockin-app-refactor

This commit is contained in:
Ryan Summers 2021-01-20 12:36:20 +01:00
commit a715680482
4 changed files with 17 additions and 12 deletions

View File

@ -6,6 +6,9 @@ use crate::ADC_SAMPLE_TICKS;
#[cfg(feature = "pounder_v1_1")] #[cfg(feature = "pounder_v1_1")]
use crate::SAMPLE_BUFFER_SIZE; use crate::SAMPLE_BUFFER_SIZE;
#[cfg(feature = "pounder_v1_1")]
use core::convert::TryInto;
use smoltcp::{iface::Routes, wire::Ipv4Address}; use smoltcp::{iface::Routes, wire::Ipv4Address};
use stm32h7xx_hal::{ use stm32h7xx_hal::{
@ -541,16 +544,6 @@ pub fn setup(
fp_led_2.set_low().unwrap(); fp_led_2.set_low().unwrap();
fp_led_3.set_low().unwrap(); fp_led_3.set_low().unwrap();
let stabilizer = StabilizerDevices {
afes,
adcs,
dacs,
timestamper: input_stamper,
net: network_devices,
adc_dac_timer: sampling_timer,
timestamp_timer,
};
// Measure the Pounder PGOOD output to detect if pounder is present on Stabilizer. // Measure the Pounder PGOOD output to detect if pounder is present on Stabilizer.
let pounder_pgood = gpiob.pb13.into_pull_down_input(); let pounder_pgood = gpiob.pb13.into_pull_down_input();
delay.delay_ms(2u8); delay.delay_ms(2u8);
@ -805,6 +798,16 @@ pub fn setup(
None None
}; };
let stabilizer = StabilizerDevices {
afes,
adcs,
dacs,
timestamper: input_stamper,
net: network_devices,
adc_dac_timer: sampling_timer,
timestamp_timer,
};
// info!("Version {} {}", build_info::PKG_VERSION, build_info::GIT_VERSION.unwrap()); // info!("Version {} {}", build_info::PKG_VERSION, build_info::GIT_VERSION.unwrap());
// info!("Built on {}", build_info::BUILT_TIME_UTC); // info!("Built on {}", build_info::BUILT_TIME_UTC);
// info!("{} {}", build_info::RUSTC_VERSION, build_info::TARGET); // info!("{} {}", build_info::RUSTC_VERSION, build_info::TARGET);

View File

@ -111,12 +111,14 @@ impl Timestamper {
} }
/// Start the DMA transfer for collecting timestamps. /// Start the DMA transfer for collecting timestamps.
#[allow(dead_code)]
pub fn start(&mut self) { pub fn start(&mut self) {
self.transfer self.transfer
.start(|capture_channel| capture_channel.enable()); .start(|capture_channel| capture_channel.enable());
} }
/// Update the period of the underlying timestamp timer. /// Update the period of the underlying timestamp timer.
#[allow(dead_code)]
pub fn update_period(&mut self, period: u16) { pub fn update_period(&mut self, period: u16) {
self.timer.set_period_ticks(period); self.timer.set_period_ticks(period);
} }
@ -125,6 +127,7 @@ impl Timestamper {
/// ///
/// # Returns /// # Returns
/// A reference to the underlying buffer that has been filled with timestamps. /// A reference to the underlying buffer that has been filled with timestamps.
#[allow(dead_code)]
pub fn acquire_buffer(&mut self) -> &[u16; SAMPLE_BUFFER_SIZE] { pub fn acquire_buffer(&mut self) -> &[u16; SAMPLE_BUFFER_SIZE] {
// Wait for the transfer to fully complete before continuing. // Wait for the transfer to fully complete before continuing.
// Note: If a device hangs up, check that this conditional is passing correctly, as there is // Note: If a device hangs up, check that this conditional is passing correctly, as there is

View File

@ -26,8 +26,8 @@ const IIR_CASCADE_LENGTH: usize = 1;
#[macro_use] #[macro_use]
mod server; mod server;
mod hardware; mod hardware;
use hardware::{Adc0Input, Adc1Input, Dac0Output, Dac1Output, AFE0, AFE1};
use dsp::iir; use dsp::iir;
use hardware::{Adc0Input, Adc1Input, Dac0Output, Dac1Output, AFE0, AFE1};
const SCALE: f32 = ((1 << 15) - 1) as f32; const SCALE: f32 = ((1 << 15) - 1) as f32;

View File

@ -62,7 +62,6 @@ macro_rules! route_request {
} }
} }
#[derive(Deserialize, Serialize, Debug)] #[derive(Deserialize, Serialize, Debug)]
pub enum AccessRequest { pub enum AccessRequest {
Read, Read,