From 949ea9c1b37608dfc3c3146cdfbb4197f63d118a Mon Sep 17 00:00:00 2001 From: Ryan Summers Date: Thu, 6 May 2021 12:35:04 +0200 Subject: [PATCH] Fixing build, formatting --- src/hardware/afe.rs | 2 +- src/hardware/system_timer.rs | 2 +- src/net/miniconf_client.rs | 2 +- src/net/mod.rs | 4 ++-- src/net/telemetry.rs | 5 ++--- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/hardware/afe.rs b/src/hardware/afe.rs index ec633a7..962c417 100644 --- a/src/hardware/afe.rs +++ b/src/hardware/afe.rs @@ -22,7 +22,7 @@ pub struct ProgrammableGainAmplifier { impl Gain { /// Get the AFE gain as a numerical value. - pub fn as_multiplier (self) -> f32 { + pub fn as_multiplier(self) -> f32 { match self { Gain::G1 => 1.0, Gain::G2 => 2.0, diff --git a/src/hardware/system_timer.rs b/src/hardware/system_timer.rs index 34011a1..4b0ba0a 100644 --- a/src/hardware/system_timer.rs +++ b/src/hardware/system_timer.rs @@ -91,7 +91,7 @@ impl rtic::Monotonic for SystemTimer { if regs.sr.read().uif().bit_is_clear() { return (overflows * 65535 + current_value) as i32; } - } + }) } } diff --git a/src/net/miniconf_client.rs b/src/net/miniconf_client.rs index cc802c6..9c6bbf5 100644 --- a/src/net/miniconf_client.rs +++ b/src/net/miniconf_client.rs @@ -12,8 +12,8 @@ ///! guarantee that the requestee will be informed that settings have been applied. use heapless::{consts, String}; -use crate::hardware::design_parameters::MQTT_BROKER; use super::{MqttMessage, NetworkReference, SettingsResponse, UpdateState}; +use crate::hardware::design_parameters::MQTT_BROKER; /// MQTT settings interface. pub struct MiniconfClient diff --git a/src/net/mod.rs b/src/net/mod.rs index 4b5b0d3..fb7d0f3 100644 --- a/src/net/mod.rs +++ b/src/net/mod.rs @@ -13,16 +13,16 @@ use core::fmt::Write; mod messages; mod miniconf_client; -mod shared; mod network_processor; +mod shared; mod telemetry; use crate::hardware::{CycleCounter, EthernetPhy, NetworkStack}; use messages::{MqttMessage, SettingsResponse}; pub use miniconf_client::MiniconfClient; -pub use shared::NetworkManager; pub use network_processor::NetworkProcessor; +pub use shared::NetworkManager; pub use telemetry::{Telemetry, TelemetryBuffer, TelemetryClient}; pub type NetworkReference = shared::NetworkStackProxy<'static, NetworkStack>; diff --git a/src/net/telemetry.rs b/src/net/telemetry.rs index b727e23..57fc192 100644 --- a/src/net/telemetry.rs +++ b/src/net/telemetry.rs @@ -11,11 +11,11 @@ ///! required immediately before transmission. This ensures that any slower computation required ///! for unit conversion can be off-loaded to lower priority tasks. use heapless::{consts, String, Vec}; -use serde::Serialize; use minimq::QoS; +use serde::Serialize; use super::NetworkReference; -use crate::hardware::{AfeGain, design_parameters::MQTT_BROKER}; +use crate::hardware::{design_parameters::MQTT_BROKER, AfeGain}; /// The telemetry client for reporting telemetry data over MQTT. pub struct TelemetryClient { @@ -72,7 +72,6 @@ impl TelemetryBuffer { /// # Returns /// The finalized telemetry structure that can be serialized and reported. pub fn finalize(self, afe0: AfeGain, afe1: AfeGain) -> Telemetry { - // The input voltage is measured by the ADC across a dynamic scale of +/- 4.096 V with a // dynamic range across signed integers. Additionally, the signal is fully differential, so // the differential voltage is measured at the ADC. Thus, the single-ended signal is