Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix log and clean up #3

Merged
merged 1 commit into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading