From aa0b3fc7a03569d3a44ac6b3b08affce1c328e89 Mon Sep 17 00:00:00 2001 From: Gabe Venberg Date: Thu, 3 Jul 2025 02:22:36 +0200 Subject: [PATCH] fixed rust-analyzer trying to check the top workspace without cross-compiling. --- .cargo/config.toml | 11 +++++++++++ hardware_main/src/main.rs | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..ff8b44d --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,11 @@ +[target.'cfg(all(target_arch = "arm", target_os = "none"))'] +rustflags = [ + "-C", "link-arg=-Tlink.x", + "-C", "link-arg=-Tdefmt.x", +] + +[build] +target = "thumbv7em-none-eabihf" + +[env] +DEFMT_LOG = "debug" diff --git a/hardware_main/src/main.rs b/hardware_main/src/main.rs index 66882d5..8da839d 100644 --- a/hardware_main/src/main.rs +++ b/hardware_main/src/main.rs @@ -58,7 +58,7 @@ async fn temp_task(mut temp: Temp<'static>) { let value: u16 = temp.read().await.to_num(); info!("{} C", value); let delay = Duration::from_millis(delay_ms); - if let Some(v) = SIGNAL.wait().with_timeout(delay).await.ok() { + if let Ok(v) = SIGNAL.wait().with_timeout(delay).await { delay_ms = match v { Button::A => max(INTERVAL_MS, delay_ms.saturating_sub(INTERVAL_MS)), Button::B => delay_ms + INTERVAL_MS,