diff --git a/Cargo.toml b/Cargo.toml index d4ad4ef05e..6fe5fce38f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,6 +60,7 @@ cortex-m-rtic-macros = { path = "macros", version = "0.5.2" } rtic-core = "0.3.0" cortex-m-rt = "0.6.9" heapless = "0.5.0" +bare-metal = "1.0.0" [build-dependencies] version_check = "0.9" diff --git a/book/en/src/SUMMARY.md b/book/en/src/SUMMARY.md index 25aef811b9..a573cbb55a 100644 --- a/book/en/src/SUMMARY.md +++ b/book/en/src/SUMMARY.md @@ -21,5 +21,3 @@ - [Ceiling analysis](./internals/ceilings.md) - [Software tasks](./internals/tasks.md) - [Timer queue](./internals/timer-queue.md) -- [Homogeneous multi-core support](./homogeneous.md) -- [Heterogeneous multi-core support](./heterogeneous.md) diff --git a/book/en/src/heterogeneous.md b/book/en/src/heterogeneous.md deleted file mode 100644 index d2c3d6c548..0000000000 --- a/book/en/src/heterogeneous.md +++ /dev/null @@ -1,6 +0,0 @@ -# Heterogeneous multi-core support - -This section covers the *experimental* heterogeneous multi-core support provided -by RTIC behind the `heterogeneous` Cargo feature. - -**Content coming soon** diff --git a/book/en/src/homogeneous.md b/book/en/src/homogeneous.md deleted file mode 100644 index bcf6d2bef9..0000000000 --- a/book/en/src/homogeneous.md +++ /dev/null @@ -1,6 +0,0 @@ -# Homogeneous multi-core support - -This section covers the *experimental* homogeneous multi-core support provided -by RTIC behind the `homogeneous` Cargo feature. - -**Content coming soon** diff --git a/macros/src/codegen/module.rs b/macros/src/codegen/module.rs index 863f6c5b73..359c1cce4e 100644 --- a/macros/src/codegen/module.rs +++ b/macros/src/codegen/module.rs @@ -47,6 +47,14 @@ pub fn codegen(ctxt: Context, resources_tick: bool, app: &App, extra: &Extra) -> values.push(quote!(device: #device::Peripherals::steal())); } + lt = Some(quote!('a)); + fields.push(quote!( + /// Critical section token for init + pub cs: rtic::export::CriticalSection<#lt> + )); + + values.push(quote!(cs: rtic::export::CriticalSection::new())); + values.push(quote!(core)); } diff --git a/src/export.rs b/src/export.rs index 8a5d4e3e56..27f7f5fbf8 100644 --- a/src/export.rs +++ b/src/export.rs @@ -4,6 +4,7 @@ use core::{ }; pub use crate::tq::{NotReady, TimerQueue}; +pub use bare_metal::CriticalSection; #[cfg(armv7m)] pub use cortex_m::register::basepri; pub use cortex_m::{ @@ -15,8 +16,6 @@ pub use cortex_m::{ use heapless::spsc::SingleCore; pub use heapless::{consts, i::Queue as iQueue, spsc::Queue}; pub use heapless::{i::BinaryHeap as iBinaryHeap, BinaryHeap}; -#[cfg(feature = "heterogeneous")] -pub use microamp::shared; pub type SCFQ = Queue; pub type SCRQ = Queue<(T, u8), N, u8, SingleCore>; diff --git a/ui/single/locals-cfg.stderr b/ui/single/locals-cfg.stderr index 39d56df2ae..1b46cea719 100644 --- a/ui/single/locals-cfg.stderr +++ b/ui/single/locals-cfg.stderr @@ -34,8 +34,8 @@ error: duplicate lang item in crate `panic_halt` (which `$CRATE` depends on): `p = note: first definition in `std` loaded from /usr/share/rust/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-cf0f33af3a901778.rlib = note: second definition in `panic_halt` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_halt-ba6f0ab3439cbc7e.rmeta -error: duplicate lang item in crate `panic_semihosting`: `panic_impl`. +error: duplicate lang item in crate `panic_halt`: `panic_impl`. | = note: the lang item is first defined in crate `panic_halt` (which `$CRATE` depends on) = note: first definition in `panic_halt` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_halt-ba6f0ab3439cbc7e.rmeta - = note: second definition in `panic_semihosting` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_semihosting-805015f4a2d05965.rmeta + = note: second definition in `panic_semihosting` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_semihosting-805015f4a2d05965.rmeta \ No newline at end of file