diff --git a/embassy/demos/common/Cargo.toml b/embassy/demos/common/Cargo.toml index 7b680091694236f90ec32fc860db70842874c8df..f17b586497dd9147ed502ead537b8ce7bd24e4d6 100644 --- a/embassy/demos/common/Cargo.toml +++ b/embassy/demos/common/Cargo.toml @@ -22,8 +22,8 @@ menu = "0.3" embedded-io = { version = "0.4", features = ["async"] } defmt = { version = "0.3", optional = true } -log = { version = "0.4", optional = true } +log = "0.4" [features] defmt = ["dep:defmt", "embassy-net/defmt", "embedded-io/defmt"] -log = ["dep:log", "embassy-net/log"] +log = ["embassy-net/log"] diff --git a/embassy/demos/picow/Cargo.toml b/embassy/demos/picow/Cargo.toml index f3656168dce0ccf19f6b995c1f58fa984bfb5515..5fbdf85036d81a80c11011103a61710fe20308bd 100644 --- a/embassy/demos/picow/Cargo.toml +++ b/embassy/demos/picow/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" sunset-embassy = { path = "../../" } sunset = { path = "../../.." } sunset-sshwire-derive = { version = "0.1", path = "../../../sshwire-derive" } -sunset-demo-embassy-common= { path = "../common", features = ["defmt"] } +sunset-demo-embassy-common= { path = "../common" } cyw43 = { git = "https://github.com/embassy-rs/cyw43/", rev = "6b5d9642d583bc034ee35b88c903545e7f423b4e", features = ["defmt"]} cyw43-pio = { git = "https://github.com/embassy-rs/cyw43/", rev = "6b5d9642d583bc034ee35b88c903545e7f423b4e" } @@ -29,9 +29,10 @@ embassy-usb = { version = "0.1.0" } atomic-polyfill = "0.1.5" static_cell = "1.0" -defmt = "0.3" +defmt = { version = "0.3", optional = true } defmt-rtt = "0.3" panic-probe = { version = "0.3", features = ["print-defmt"] } +log = { version = "0.4" } cortex-m = { version = "0.7.6", features = ["critical-section-single-core"]} cortex-m-rt = "0.7.0" @@ -54,7 +55,7 @@ sha2 = { version = "0.10", default-features = false } [features] default = ["defmt", "sunset-demo-embassy-common/defmt", "embassy-usb/defmt"] -defmt = [] +defmt = ["dep:defmt"] # Use cyw43 firmware already on flash. This saves time when developing. # probe-rs-cli download firmware/43439A0.bin --format bin --chip RP2040 --base-address 0x10100000 diff --git a/embassy/demos/picow/src/flashconfig.rs b/embassy/demos/picow/src/flashconfig.rs index 5391ace9fea9886aec6949d7a01dd7d362cb16d4..5cdba048ddf67af7b32c4e82168e0d385a09da37 100644 --- a/embassy/demos/picow/src/flashconfig.rs +++ b/embassy/demos/picow/src/flashconfig.rs @@ -3,7 +3,14 @@ use { sunset::error::{Error, Result, TrapBug}, }; -use defmt::{debug, info, warn, error, trace}; +#[cfg(not(feature = "defmt"))] +pub use { + log::{debug, error, info, log, trace, warn}, +}; + +#[allow(unused_imports)] +#[cfg(feature = "defmt")] +pub use defmt::{debug, info, warn, panic, error, trace}; use embassy_rp::flash::{Flash, ERASE_SIZE, FLASH_BASE}; use embassy_rp::peripherals::FLASH;