From fb61a78cdd99e27914cc355f721c04d901dd3ae4 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Thu, 1 Oct 2020 20:01:25 +0200 Subject: [PATCH 1/4] Added `bare_metal::CriticalSection` to `init::Context` --- Cargo.toml | 1 + macros/src/codegen/module.rs | 8 ++++++++ src/export.rs | 1 + 3 files changed, 10 insertions(+) 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/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..1e64941f3f 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::{ From 86001c46bcae85c9448d63dde534bd218301f0e4 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Thu, 1 Oct 2020 20:16:00 +0200 Subject: [PATCH 2/4] Fixing test errors --- ui/single/locals-cfg.stderr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/single/locals-cfg.stderr b/ui/single/locals-cfg.stderr index bb558fa60e..49695cbf1b 100644 --- a/ui/single/locals-cfg.stderr +++ b/ui/single/locals-cfg.stderr @@ -28,10 +28,10 @@ error[E0425]: cannot find value `FOO` in this scope 44 | FOO; | ^^^ not found in this scope -error: duplicate lang item in crate `panic_halt`: `panic_impl`. +error: duplicate lang item in crate `panic_semihosting`: `panic_impl`. | = note: first defined in crate `std`. -error: duplicate lang item in crate `panic_semihosting`: `panic_impl`. +error: duplicate lang item in crate `panic_halt`: `panic_impl`. | - = note: first defined in crate `panic_halt`. + = note: first defined in crate `panic_semihosting`. From 0cc556a75aaee64a90ecab94854b3fc669cb61ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Thu, 1 Oct 2020 19:12:54 +0000 Subject: [PATCH 3/4] Remove all of heterogeneous and homogeneous from the book --- book/en/src/SUMMARY.md | 2 -- book/en/src/heterogeneous.md | 6 ------ book/en/src/homogeneous.md | 6 ------ 3 files changed, 14 deletions(-) delete mode 100644 book/en/src/heterogeneous.md delete mode 100644 book/en/src/homogeneous.md 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** From 5082f70e5e2d021d16632f6e2c07608f6bd8fc29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Thu, 1 Oct 2020 19:13:22 +0000 Subject: [PATCH 4/4] Remove exports related to heterogeneous multi-core support --- src/export.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/export.rs b/src/export.rs index 1e64941f3f..27f7f5fbf8 100644 --- a/src/export.rs +++ b/src/export.rs @@ -16,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>;