Skip to content

Commit

Permalink
Fix log and clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
gdobato committed Nov 5, 2023
1 parent 94fe5ce commit d84dd75
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ rustflags = [
"-C",
"link-arg=-Tdefmt.x",
]

[env]
DEFMT_LOG = "info"
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
7 changes: 6 additions & 1 deletion Embed.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[default.general]
chip = "STM32H747XIHx"
connect_under_reset = false
log_level = "WARN"

[default.probe]
protocol = "Swd"
Expand All @@ -15,4 +16,8 @@ enabled = true
halt_afterwards = false

[default.rtt]
enabled = true
enabled = true

channels = [
{ up = 0, down = 0, format = "Defmt" },
]
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit d84dd75

Please sign in to comment.