From 8ac60ce369d8b4b73bf9018720f04675922c9b06 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sat, 15 Dec 2018 22:40:45 +0100 Subject: [PATCH 1/2] bump cortex-m-rt dep --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 9993001360..82295a3048 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,7 @@ required-features = ["timer-queue"] [dependencies] cortex-m = "0.5.8" -cortex-m-rt = "0.6.5" +cortex-m-rt = "0.6.7" cortex-m-rtfm-macros = { path = "macros", version = "0.4.0-beta.3" } heapless = "0.4.0" owned-singleton = "0.1.0" From 9757c33b0051900fa6c5581be413880d07a237d2 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sun, 16 Dec 2018 01:11:54 +0100 Subject: [PATCH 2/2] use the single core variant of spsc::Queue --- Cargo.toml | 2 +- macros/src/codegen.rs | 4 ++-- src/export.rs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 82295a3048..6b67c2a9e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ required-features = ["timer-queue"] cortex-m = "0.5.8" cortex-m-rt = "0.6.7" cortex-m-rtfm-macros = { path = "macros", version = "0.4.0-beta.3" } -heapless = "0.4.0" +heapless = "0.4.1" owned-singleton = "0.1.0" [dev-dependencies] diff --git a/macros/src/codegen.rs b/macros/src/codegen.rs index 6b8e159416..71c6090723 100644 --- a/macros/src/codegen.rs +++ b/macros/src/codegen.rs @@ -1594,13 +1594,13 @@ fn pre_init(ctxt: &Context, app: &App, analysis: &Analysis) -> proc_macro2::Toke // these are `MaybeUninit` `ReadyQueue`s for dispatcher in ctxt.dispatchers.values() { let rq = &dispatcher.ready_queue; - exprs.push(quote!(#rq.set(rtfm::export::ReadyQueue::new());)) + exprs.push(quote!(#rq.set(rtfm::export::ReadyQueue::new_sc());)) } // these are `MaybeUninit` `FreeQueue`s for task in ctxt.tasks.values() { let fq = &task.free_queue; - exprs.push(quote!(#fq.set(rtfm::export::FreeQueue::new());)) + exprs.push(quote!(#fq.set(rtfm::export::FreeQueue::new_sc());)) } // end-of-FIXME diff --git a/src/export.rs b/src/export.rs index 200c69d95e..c1eeb87bac 100644 --- a/src/export.rs +++ b/src/export.rs @@ -12,13 +12,13 @@ pub use cortex_m::{ }; pub use cortex_m_rt::{entry, exception}; pub use heapless::consts; -use heapless::spsc::Queue; +use heapless::spsc::{Queue, SingleCore}; #[cfg(feature = "timer-queue")] pub use crate::tq::{isr as sys_tick, NotReady, TimerQueue}; -pub type FreeQueue = Queue; -pub type ReadyQueue = Queue<(T, u8), N>; +pub type FreeQueue = Queue; +pub type ReadyQueue = Queue<(T, u8), N, usize, SingleCore>; #[cfg(armv7m)] #[inline(always)]