Skip to content

Commit

Permalink
Don't suggest enabling systimer on esp32
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Nov 16, 2023
1 parent 6814822 commit d9133ee
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions esp-hal-common/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@ macro_rules! assert_unique_features {

// Given some features, assert that AT LEAST one of the features is enabled.
macro_rules! assert_used_features {
( $($all:tt),* ) => {
( $all:tt ) => {
#[cfg(not(feature = $all))]
compile_error!(concat!("The feature flag must be provided: ", $all));
};

( $($all:tt),+ ) => {
#[cfg(not(any($(feature = $all),*)))]
compile_error!(concat!("One of the feature flags must be provided: ", $($all, ", "),*));
}
};
}

// Given some features, assert that EXACTLY one of the features is enabled.
Expand Down Expand Up @@ -113,6 +118,10 @@ fn main() -> Result<(), Box<dyn Error>> {
// is available:
#[cfg(feature = "embassy")]
{
#[cfg(feature = "esp32")]
assert_unique_used_features!("embassy-time-timg0");

#[cfg(not(feature = "esp32"))]
assert_unique_used_features!("embassy-time-systick", "embassy-time-timg0");
}

Expand Down

0 comments on commit d9133ee

Please sign in to comment.