From 5d4035f98f78a4f775bf38d946f384ddb353332a Mon Sep 17 00:00:00 2001 From: Steins7 Date: Sat, 29 Jan 2022 15:54:45 +0100 Subject: [PATCH] Added offset to calibration display + added display of offset value * renamed section to save space --- src/config.rs | 8 ++++---- src/main.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/config.rs b/src/config.rs index 0462d22..4f27f9e 100644 --- a/src/config.rs +++ b/src/config.rs @@ -88,9 +88,9 @@ impl Menu { Entry::new("fan out", EntryValue::FanOut (FanOutput::P1), config), Entry::new("max diff", EntryValue::MaxTempDiff (0.0), config), Entry::new("min diff", EntryValue::MinTempDiff (0.0), config), - Entry::new("ext cal", EntryValue::ExtOffset (CalData::new(0.0)), config), - Entry::new("p1 cal", EntryValue::P1Offset (CalData::new(0.0)), config), - Entry::new("p2 cal", EntryValue::P2Offset (CalData::new(0.0)), config), + Entry::new("ex", EntryValue::ExtOffset (CalData::new(0.0)), config), + Entry::new("s1", EntryValue::P1Offset (CalData::new(0.0)), config), + Entry::new("s2", EntryValue::P2Offset (CalData::new(0.0)), config), ], state: MenuState::Scroll, should_refresh: true, @@ -263,7 +263,7 @@ impl fmt::Display for EntryValue { formatter.write_fmt(format_args!("{:.1}", val)), Self::ExtOffset (data) | Self::P1Offset (data) | Self::P2Offset (data) => { let temp: Temp = data.raw_value.map(|val| val + data.offset).into(); - formatter.write_fmt(format_args!("{}", temp)) + formatter.write_fmt(format_args!("{:.1}({:.1})", data.offset, temp)) }, Self::FanOut (output) => { match output { diff --git a/src/main.rs b/src/main.rs index 1931b84..ec208b9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -306,7 +306,7 @@ fn main() -> ! { let _ = TEMP_FLAG.swap(true, Ordering::Release); // fix some weird bug caused by the debouncing capacitor of the button - for i in 0..10 { + for _ in 0..10 { cortex_m::asm::wfi(); } BUTTON_FLAG.store(false, Ordering::Release);