From f5bbdc0bb90060053eddad5425cf47705abb1e8b Mon Sep 17 00:00:00 2001 From: Yorick de Wid Date: Fri, 2 Feb 2024 11:27:56 +0100 Subject: [PATCH] Remove unused dependency and import --- Cargo.lock | 1 - hcu/Cargo.toml | 1 - hcu/src/main.rs | 13 +++++++------ vecraft/src/lib.rs | 1 + 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b3357ac..e278057 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -197,7 +197,6 @@ name = "hcu" version = "0.5.1" dependencies = [ "cortex-m-rtic", - "fdcan", "panic-halt", "stm32h7xx-hal", "systick-monotonic", diff --git a/hcu/Cargo.toml b/hcu/Cargo.toml index fd9e5cb..84406be 100644 --- a/hcu/Cargo.toml +++ b/hcu/Cargo.toml @@ -8,7 +8,6 @@ panic-halt = "0.2.0" systick-monotonic = "1.0" cortex-m-rtic = { version = "1.1.4" } stm32h7xx-hal = { version = "0.15.1", features = ["stm32h743v", "rt", "can"] } -fdcan = { version = "0.2.0", features = ["fdcan_h7"] } vecraft = { version = "0.2.0", path = "../vecraft" } [[bin]] diff --git a/hcu/src/main.rs b/hcu/src/main.rs index 3597a1a..500468b 100644 --- a/hcu/src/main.rs +++ b/hcu/src/main.rs @@ -40,6 +40,7 @@ mod app { use stm32h7xx_hal::system_watchdog::{Event::EarlyWakeup, SystemWindowWatchdog}; use systick_monotonic::Systick; + use vecraft::fdcan; use vecraft::j1939::{protocol, FrameBuilder, IdBuilder, NameBuilder, PGN}; /// 100 Hz / 10 ms granularity @@ -265,9 +266,9 @@ mod app { .vehicle_system(9) .build(); - let frame = protocol::address_claimed(crate::NET_ADDRESS, name); - - ctx.shared.canbus1.lock(|canbus1| canbus1.send(frame)); + ctx.shared + .canbus1 + .lock(|canbus1| canbus1.send(protocol::address_claimed(crate::NET_ADDRESS, name))); #[cfg(debug_assertions)] ctx.shared.console.lock(|console| { @@ -406,9 +407,9 @@ mod app { ctx.shared.canbus1.lock(|canbus1| canbus1.send(frame)); } else { - let frame = protocol::acknowledgement(crate::NET_ADDRESS, pgn); - - ctx.shared.canbus1.lock(|canbus1| canbus1.send(frame)); + ctx.shared.canbus1.lock(|canbus1| { + canbus1.send(protocol::acknowledgement(crate::NET_ADDRESS, pgn)) + }); } } PGN::ProprietarilyConfigurableMessage1 => { diff --git a/vecraft/src/lib.rs b/vecraft/src/lib.rs index f4dbb15..db1baaf 100644 --- a/vecraft/src/lib.rs +++ b/vecraft/src/lib.rs @@ -3,6 +3,7 @@ #![no_main] #![no_std] +pub use fdcan; pub use j1939; pub mod can;