diff options
| author | Dario Nieuwenhuis <[email protected]> | 2021-07-14 22:19:04 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2021-07-14 22:19:04 +0200 |
| commit | f916fe54760b51a12876b8d060531aa773a75e6d (patch) | |
| tree | 82ce6c93cb60973bfd3d140d8bd050b0a608b5b0 | |
| parent | 6444066589d92dd6db11cbb41d26a8ccd4f60cb0 (diff) | |
all hals: reexport PAC if `unstable-pac` feature is set.
| -rw-r--r-- | embassy-nrf/Cargo.toml | 7 | ||||
| -rw-r--r-- | embassy-nrf/src/lib.rs | 4 | ||||
| -rw-r--r-- | embassy-rp/Cargo.toml | 7 | ||||
| -rw-r--r-- | embassy-rp/src/lib.rs | 3 | ||||
| -rw-r--r-- | embassy-stm32/Cargo.toml | 6 | ||||
| -rw-r--r-- | embassy-stm32/src/lib.rs | 3 |
6 files changed, 30 insertions, 0 deletions
diff --git a/embassy-nrf/Cargo.toml b/embassy-nrf/Cargo.toml index 85ded1df4..1fdc83fb3 100644 --- a/embassy-nrf/Cargo.toml +++ b/embassy-nrf/Cargo.toml | |||
| @@ -5,6 +5,13 @@ authors = ["Dario Nieuwenhuis <[email protected]>"] | |||
| 5 | edition = "2018" | 5 | edition = "2018" |
| 6 | 6 | ||
| 7 | [features] | 7 | [features] |
| 8 | |||
| 9 | # Reexport the PAC for the currently enabled chip at `embassy_nrf::pac`. | ||
| 10 | # This is unstable because semver-minor (non-breaking) releases of embassy-nrf may major-bump (breaking) the PAC version. | ||
| 11 | # If this is an issue for you, you're encouraged to directly depend on a fixed version of the PAC. | ||
| 12 | # There are no plans to make this stable. | ||
| 13 | unstable-pac = [] | ||
| 14 | |||
| 8 | defmt-trace = [ ] | 15 | defmt-trace = [ ] |
| 9 | defmt-debug = [ ] | 16 | defmt-debug = [ ] |
| 10 | defmt-info = [ ] | 17 | defmt-info = [ ] |
diff --git a/embassy-nrf/src/lib.rs b/embassy-nrf/src/lib.rs index c2e461cf1..35815f792 100644 --- a/embassy-nrf/src/lib.rs +++ b/embassy-nrf/src/lib.rs | |||
| @@ -65,7 +65,11 @@ mod chip; | |||
| 65 | #[path = "chips/nrf52840.rs"] | 65 | #[path = "chips/nrf52840.rs"] |
| 66 | mod chip; | 66 | mod chip; |
| 67 | 67 | ||
| 68 | #[cfg(feature = "unstable-pac")] | ||
| 69 | pub use chip::pac; | ||
| 70 | #[cfg(not(feature = "unstable-pac"))] | ||
| 68 | pub(crate) use chip::pac; | 71 | pub(crate) use chip::pac; |
| 72 | |||
| 69 | pub use chip::{peripherals, Peripherals}; | 73 | pub use chip::{peripherals, Peripherals}; |
| 70 | 74 | ||
| 71 | pub mod interrupt { | 75 | pub mod interrupt { |
diff --git a/embassy-rp/Cargo.toml b/embassy-rp/Cargo.toml index ba9984a80..c61b8c997 100644 --- a/embassy-rp/Cargo.toml +++ b/embassy-rp/Cargo.toml | |||
| @@ -5,6 +5,13 @@ authors = ["Dario Nieuwenhuis <[email protected]>"] | |||
| 5 | edition = "2018" | 5 | edition = "2018" |
| 6 | 6 | ||
| 7 | [features] | 7 | [features] |
| 8 | |||
| 9 | # Reexport the PAC for the currently enabled chip at `embassy_rp::pac`. | ||
| 10 | # This is unstable because semver-minor (non-breaking) releases of embassy-nrf may major-bump (breaking) the PAC version. | ||
| 11 | # If this is an issue for you, you're encouraged to directly depend on a fixed version of the PAC. | ||
| 12 | # There are no plans to make this stable. | ||
| 13 | unstable-pac = [] | ||
| 14 | |||
| 8 | defmt-trace = [ ] | 15 | defmt-trace = [ ] |
| 9 | defmt-debug = [ ] | 16 | defmt-debug = [ ] |
| 10 | defmt-info = [ ] | 17 | defmt-info = [ ] |
diff --git a/embassy-rp/src/lib.rs b/embassy-rp/src/lib.rs index aefc86c00..c53d2e58d 100644 --- a/embassy-rp/src/lib.rs +++ b/embassy-rp/src/lib.rs | |||
| @@ -5,7 +5,10 @@ | |||
| 5 | #![feature(never_type)] | 5 | #![feature(never_type)] |
| 6 | #![allow(incomplete_features)] | 6 | #![allow(incomplete_features)] |
| 7 | 7 | ||
| 8 | #[cfg(feature = "unstable-pac")] | ||
| 8 | pub use rp2040_pac2 as pac; | 9 | pub use rp2040_pac2 as pac; |
| 10 | #[cfg(not(feature = "unstable-pac"))] | ||
| 11 | pub(crate) use rp2040_pac2 as pac; | ||
| 9 | 12 | ||
| 10 | // This mod MUST go first, so that the others see its macros. | 13 | // This mod MUST go first, so that the others see its macros. |
| 11 | pub(crate) mod fmt; | 14 | pub(crate) mod fmt; |
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index 654bc98ef..4e4d7ff82 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml | |||
| @@ -43,6 +43,12 @@ defmt-error = [ ] | |||
| 43 | sdmmc-rs = ["embedded-sdmmc"] | 43 | sdmmc-rs = ["embedded-sdmmc"] |
| 44 | net = ["embassy-net", "vcell"] | 44 | net = ["embassy-net", "vcell"] |
| 45 | 45 | ||
| 46 | # Reexport stm32-metapac at `embassy_stm32::pac`. | ||
| 47 | # This is unstable because semver-minor (non-breaking) releases of embassy-stm32 may major-bump (breaking) the stm32-metapac version. | ||
| 48 | # If this is an issue for you, you're encouraged to directly depend on a fixed version of the PAC. | ||
| 49 | # There are no plans to make this stable. | ||
| 50 | unstable-pac = [] | ||
| 51 | |||
| 46 | # BEGIN GENERATED FEATURES | 52 | # BEGIN GENERATED FEATURES |
| 47 | # Generated by gen_features.py. DO NOT EDIT. | 53 | # Generated by gen_features.py. DO NOT EDIT. |
| 48 | stm32f030c6 = [ "stm32-metapac/stm32f030c6",] | 54 | stm32f030c6 = [ "stm32-metapac/stm32f030c6",] |
diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs index 4b2826ae8..22999a69e 100644 --- a/embassy-stm32/src/lib.rs +++ b/embassy-stm32/src/lib.rs | |||
| @@ -6,6 +6,9 @@ | |||
| 6 | #![feature(type_alias_impl_trait)] | 6 | #![feature(type_alias_impl_trait)] |
| 7 | #![allow(incomplete_features)] | 7 | #![allow(incomplete_features)] |
| 8 | 8 | ||
| 9 | #[cfg(feature = "unstable-pac")] | ||
| 10 | pub use stm32_metapac as pac; | ||
| 11 | #[cfg(not(feature = "unstable-pac"))] | ||
| 9 | pub(crate) use stm32_metapac as pac; | 12 | pub(crate) use stm32_metapac as pac; |
| 10 | 13 | ||
| 11 | // This must go FIRST so that all the other modules see its macros. | 14 | // This must go FIRST so that all the other modules see its macros. |
