Skip to content
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
6 changes: 3 additions & 3 deletions ci/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ cargo check --all-targets --locked
cargo clippy --all-targets

# stable, std
cargo build --release --features mctp-estack/log
cargo test --features mctp-estack/log
cargo build --release
cargo test

# stable, no_std
NOSTD_CRATES="mctp pldm pldm-fw"
Expand All @@ -44,6 +44,6 @@ cargo build --target thumbv7em-none-eabihf --features defmt --no-default-feature
cargo build --features log
)

cargo doc --features mctp-estack/log
cargo doc

echo success
8 changes: 5 additions & 3 deletions mctp-estack/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ use heapless::FnvIndexMap;

use mctp::{Eid, Error, MsgIC, MsgType, Result, Tag, TagValue};

#[cfg(not(any(feature = "log", feature = "defmt")))]
compile_error!("Either log or defmt feature must be enabled");
#[cfg(all(feature = "log", feature = "defmt"))]
compile_error!("log and defmt features are mutually exclusive");

pub mod control;
pub mod fragment;
pub mod i2c;
Expand Down Expand Up @@ -733,9 +738,6 @@ impl EventStamp {
}
}

#[cfg(not(any(feature = "log", feature = "defmt")))]
compile_error!("Either log or defmt feature must be enabled");

pub(crate) mod fmt {
#[cfg(feature = "defmt")]
pub use defmt::{debug, error, info, trace, warn};
Expand Down
2 changes: 2 additions & 0 deletions mctp-usb-embassy/src/mctpusb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ use log::{debug, error, info, trace, warn};

#[cfg(not(any(feature = "log", feature = "defmt")))]
compile_error!("Either log or defmt feature must be enabled");
#[cfg(all(feature = "log", feature = "defmt"))]
compile_error!("log and defmt features are mutually exclusive");

use core::ops::Range;

Expand Down
5 changes: 5 additions & 0 deletions mctp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@

use core::future::Future;

// Currently there is no defmt::Format implementation for std::io::Error
// (can't be derived). If needed that could be manually implemented.
#[cfg(all(feature = "std", feature = "defmt"))]
compile_error!("std and defmt features are currently mutually exclusive");

/// MCTP endpoint ID
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
Expand Down