diff --git a/.cargo/config.toml b/.cargo/config.toml index 550753e..c0dda4d 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -20,3 +20,6 @@ rustflags = [ "-C", "link-arg=-Tdefmt.x", ] + +[env] +DEFMT_LOG = "info" diff --git a/Cargo.toml b/Cargo.toml index 46470d2..ab07eae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,8 +42,8 @@ embassy-time = { version = "0.1.2", git = "https://github.com/embassy-rs/embassy embassy-usb = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy.git", features = [ "defmt", ] } -defmt = "0.3.5" -defmt-rtt = "0.4" +defmt = "=0.3.2" +defmt-rtt = "0.4.0" embedded-hal = "0.2.6" embedded-io = "0.6.1" panic-probe = { version = "0.3", features = ["print-defmt"] } diff --git a/Embed.toml b/Embed.toml index 994e5bb..5ea1820 100644 --- a/Embed.toml +++ b/Embed.toml @@ -1,6 +1,7 @@ [default.general] chip = "STM32H747XIHx" connect_under_reset = false +log_level = "WARN" [default.probe] protocol = "Swd" @@ -15,4 +16,8 @@ enabled = true halt_afterwards = false [default.rtt] -enabled = true \ No newline at end of file +enabled = true + +channels = [ + { up = 0, down = 0, format = "Defmt" }, +] diff --git a/src/lib.rs b/src/lib.rs index 4c0c579..45f8d32 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,13 +10,13 @@ use embassy_stm32::{ use core::sync::atomic::{AtomicBool, Ordering}; -pub struct Board<'a> { - pub led_red: Output<'a, peripherals::PK5>, - pub led_green: Output<'a, peripherals::PK6>, - pub led_blue: Output<'a, peripherals::PK7>, +pub struct Board { + pub led_red: Output<'static, peripherals::PK5>, + pub led_green: Output<'static, peripherals::PK6>, + pub led_blue: Output<'static, peripherals::PK7>, } -impl<'a> Board<'a> { +impl Board { pub fn take() -> Self { static TAKEN: AtomicBool = AtomicBool::new(false); debug_assert!(!TAKEN.swap(true, Ordering::SeqCst));