diff --git a/ad9959/src/lib.rs b/ad9959/src/lib.rs index 0e377a2..d12041c 100644 --- a/ad9959/src/lib.rs +++ b/ad9959/src/lib.rs @@ -120,9 +120,9 @@ where RST: OutputPin, { let mut ad9959 = Ad9959 { - interface: interface, - io_update: io_update, - delay: delay, + interface, + io_update, + delay, reference_clock_frequency: clock_frequency, system_clock_multiplier: 1, }; diff --git a/src/afe.rs b/src/afe.rs index e80653c..5dd725a 100644 --- a/src/afe.rs +++ b/src/afe.rs @@ -1,4 +1,3 @@ -use embedded_hal; use serde::{Deserialize, Serialize}; use core::convert::TryFrom; @@ -45,7 +44,7 @@ where /// * `a0` - An output connected to the A0 input of the amplifier. /// * `a1` - An output connected to the A1 input of the amplifier. pub fn new(a0: A0, a1: A1) -> Self { - let mut afe = Self { a0: a0, a1: a1 }; + let mut afe = Self { a0, a1 }; afe.set_gain(Gain::G1); diff --git a/src/main.rs b/src/main.rs index ef5ae8c..722f554 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,8 +28,6 @@ extern crate panic_halt; extern crate log; // use core::sync::atomic::{AtomicU32, AtomicBool, Ordering}; -use asm_delay; -use cortex_m; use cortex_m_rt::exception; use rtic::cyccnt::{Instant, U32Ext}; use stm32h7xx_hal as hal; @@ -331,13 +329,12 @@ const APP: () = { .frame_size(16) .swap_mosi_miso(); - let spi = dp.SPI4.spi( + dp.SPI4.spi( (spi_sck, spi_miso, hal::spi::NoMosi), config, 50.mhz(), &clocks, - ); - spi + ) }; let dac2_spi = { @@ -361,14 +358,12 @@ const APP: () = { .frame_size(16) .swap_mosi_miso(); - let spi = dp.SPI5.spi( + dp.SPI5.spi( (spi_sck, spi_miso, hal::spi::NoMosi), config, 50.mhz(), &clocks, - ); - - spi + ) }; let mut fp_led_0 = gpiod.pd5.into_push_pull_output(); @@ -635,16 +630,16 @@ const APP: () = { dac1: dac1_spi, adc2: adc2_spi, dac2: dac2_spi, - afe1: afe1, - afe2: afe2, + afe1, + afe2, timer: timer2, pounder: pounder_devices, - eeprom_i2c: eeprom_i2c, + eeprom_i2c, net_interface: network_interface, - eth_mac: eth_mac, - mac_addr: mac_addr, + eth_mac, + mac_addr, } } diff --git a/src/pounder/mod.rs b/src/pounder/mod.rs index 1d4e355..c89c6cc 100644 --- a/src/pounder/mod.rs +++ b/src/pounder/mod.rs @@ -1,6 +1,3 @@ -use ad9959; -use mcp23017; - use serde::{Deserialize, Serialize}; mod attenuators; @@ -106,7 +103,7 @@ impl QspiInterface { qspi.configure_mode(hal::qspi::QspiMode::FourBit) .map_err(|_| Error::Qspi)?; Ok(Self { - qspi: qspi, + qspi, mode: ad9959::Mode::SingleBitTwoWire, }) } @@ -396,8 +393,8 @@ where let power = self.measure_power(channel)?; Ok(InputChannelState { - attenuation: attenuation, - power: power, + attenuation, + power, mixer: channel_state, }) } @@ -458,7 +455,7 @@ where let attenuation = self.get_attenuation(channel)?; Ok(OutputChannelState { - attenuation: attenuation, + attenuation, channel: channel_state, }) } diff --git a/src/server.rs b/src/server.rs index d5aec95..3184426 100644 --- a/src/server.rs +++ b/src/server.rs @@ -125,7 +125,7 @@ impl Response { /// * `message` - The message denoting the status. pub fn custom<'a>(code: i32, message: &'a str) -> Self { let mut res = Self { - code: code, + code, attribute: String::from(""), value: String::from(message), };