summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Nieuwenhuis <dirbaio@dirbaio.net>2021-07-14 22:19:04 +0200
committerDario Nieuwenhuis <dirbaio@dirbaio.net>2021-07-14 22:19:04 +0200
commitf916fe54760b51a12876b8d060531aa773a75e6d (patch)
tree82ce6c93cb60973bfd3d140d8bd050b0a608b5b0
parent6444066589d92dd6db11cbb41d26a8ccd4f60cb0 (diff)
downloadembassy-f916fe54760b51a12876b8d060531aa773a75e6d.zip
all hals: reexport PAC if `unstable-pac` feature is set.
-rw-r--r--embassy-nrf/Cargo.toml7
-rw-r--r--embassy-nrf/src/lib.rs4
-rw-r--r--embassy-rp/Cargo.toml7
-rw-r--r--embassy-rp/src/lib.rs3
-rw-r--r--embassy-stm32/Cargo.toml6
-rw-r--r--embassy-stm32/src/lib.rs3
6 files changed, 30 insertions, 0 deletions
diff --git a/embassy-nrf/Cargo.toml b/embassy-nrf/Cargo.toml
index 85ded1df..1fdc83fb 100644
--- a/embassy-nrf/Cargo.toml
+++ b/embassy-nrf/Cargo.toml
@@ -5,6 +5,13 @@ authors = ["Dario Nieuwenhuis <dirbaio@dirbaio.net>"]
edition = "2018"
[features]
+
+# Reexport the PAC for the currently enabled chip at `embassy_nrf::pac`.
+# This is unstable because semver-minor (non-breaking) releases of embassy-nrf may major-bump (breaking) the PAC version.
+# If this is an issue for you, you're encouraged to directly depend on a fixed version of the PAC.
+# There are no plans to make this stable.
+unstable-pac = []
+
defmt-trace = [ ]
defmt-debug = [ ]
defmt-info = [ ]
diff --git a/embassy-nrf/src/lib.rs b/embassy-nrf/src/lib.rs
index c2e461cf..35815f79 100644
--- a/embassy-nrf/src/lib.rs
+++ b/embassy-nrf/src/lib.rs
@@ -65,7 +65,11 @@ mod chip;
#[path = "chips/nrf52840.rs"]
mod chip;
+#[cfg(feature = "unstable-pac")]
+pub use chip::pac;
+#[cfg(not(feature = "unstable-pac"))]
pub(crate) use chip::pac;
+
pub use chip::{peripherals, Peripherals};
pub mod interrupt {
diff --git a/embassy-rp/Cargo.toml b/embassy-rp/Cargo.toml
index ba9984a8..c61b8c99 100644
--- a/embassy-rp/Cargo.toml
+++ b/embassy-rp/Cargo.toml
@@ -5,6 +5,13 @@ authors = ["Dario Nieuwenhuis <dirbaio@dirbaio.net>"]
edition = "2018"
[features]
+
+# Reexport the PAC for the currently enabled chip at `embassy_rp::pac`.
+# This is unstable because semver-minor (non-breaking) releases of embassy-nrf may major-bump (breaking) the PAC version.
+# If this is an issue for you, you're encouraged to directly depend on a fixed version of the PAC.
+# There are no plans to make this stable.
+unstable-pac = []
+
defmt-trace = [ ]
defmt-debug = [ ]
defmt-info = [ ]
diff --git a/embassy-rp/src/lib.rs b/embassy-rp/src/lib.rs
index aefc86c0..c53d2e58 100644
--- a/embassy-rp/src/lib.rs
+++ b/embassy-rp/src/lib.rs
@@ -5,7 +5,10 @@
#![feature(never_type)]
#![allow(incomplete_features)]
+#[cfg(feature = "unstable-pac")]
pub use rp2040_pac2 as pac;
+#[cfg(not(feature = "unstable-pac"))]
+pub(crate) use rp2040_pac2 as pac;
// This mod MUST go first, so that the others see its macros.
pub(crate) mod fmt;
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml
index 654bc98e..4e4d7ff8 100644
--- a/embassy-stm32/Cargo.toml
+++ b/embassy-stm32/Cargo.toml
@@ -43,6 +43,12 @@ defmt-error = [ ]
sdmmc-rs = ["embedded-sdmmc"]
net = ["embassy-net", "vcell"]
+# Reexport stm32-metapac at `embassy_stm32::pac`.
+# This is unstable because semver-minor (non-breaking) releases of embassy-stm32 may major-bump (breaking) the stm32-metapac version.
+# If this is an issue for you, you're encouraged to directly depend on a fixed version of the PAC.
+# There are no plans to make this stable.
+unstable-pac = []
+
# BEGIN GENERATED FEATURES
# Generated by gen_features.py. DO NOT EDIT.
stm32f030c6 = [ "stm32-metapac/stm32f030c6",]
diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs
index 4b2826ae..22999a69 100644
--- a/embassy-stm32/src/lib.rs
+++ b/embassy-stm32/src/lib.rs
@@ -6,6 +6,9 @@
#![feature(type_alias_impl_trait)]
#![allow(incomplete_features)]
+#[cfg(feature = "unstable-pac")]
+pub use stm32_metapac as pac;
+#[cfg(not(feature = "unstable-pac"))]
pub(crate) use stm32_metapac as pac;
// This must go FIRST so that all the other modules see its macros.