From c518797d08587509275404c4b41dfbcbe1b280ec Mon Sep 17 00:00:00 2001 From: Ryan Summers Date: Tue, 17 Nov 2020 10:48:31 +0100 Subject: [PATCH] Removing unused code --- src/main.rs | 18 +++++++++--------- src/pounder/mod.rs | 30 +----------------------------- 2 files changed, 10 insertions(+), 38 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9033895..e73238c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -823,16 +823,16 @@ const APP: () = { let dds_output = &mut c.resources.dds_output; if let Some(pounder) = c.resources.pounder { + let profile = pounder + .ad9959 + .serialize_profile( + pounder::Channel::Out0.into(), + 100_000_000_f32, + 0.0_f32, + *adc0 as f32 / 0xFFFF as f32, + ) + .unwrap(); dds_output.lock(|dds_output| { - let profile = pounder - .ad9959 - .serialize_profile( - pounder::Channel::Out0.into(), - 100_000_000_f32, - 0.0_f32, - *adc0 as f32 / 0xFFFF as f32, - ) - .unwrap(); dds_output.push(profile); }); } diff --git a/src/pounder/mod.rs b/src/pounder/mod.rs index ac37491..d8db728 100644 --- a/src/pounder/mod.rs +++ b/src/pounder/mod.rs @@ -115,7 +115,7 @@ impl QspiInterface { }) } - pub fn start_stream(&mut self) -> Result<(), Error> { + fn start_stream(&mut self) -> Result<(), Error> { if self.qspi.is_busy() { return Err(Error::Qspi); } @@ -136,34 +136,6 @@ impl QspiInterface { Ok(()) } - - pub fn write_profile(&mut self, data: [u32; 4]) -> Result<(), Error> { - if self.streaming == false { - return Err(Error::Qspi); - } - - let qspi_regs = unsafe { &*hal::stm32::QUADSPI::ptr() }; - unsafe { - core::ptr::write_volatile( - &qspi_regs.dr as *const _ as *mut u32, - data[0], - ); - core::ptr::write_volatile( - &qspi_regs.dr as *const _ as *mut u32, - data[1], - ); - core::ptr::write_volatile( - &qspi_regs.dr as *const _ as *mut u32, - data[2], - ); - core::ptr::write_volatile( - &qspi_regs.dr as *const _ as *mut u32, - data[3], - ); - } - - Ok(()) - } } impl ad9959::Interface for QspiInterface {