From 3ace49f3eba02bac08699f07a207af4dccc14389 Mon Sep 17 00:00:00 2001 From: Per Lindgren Date: Thu, 11 Mar 2021 12:30:26 +0100 Subject: [PATCH] schedule now works with RacyCell --- macros/src/codegen/module.rs | 3 ++- macros/src/codegen/timer_queue.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/macros/src/codegen/module.rs b/macros/src/codegen/module.rs index 195106d836..c38013325f 100644 --- a/macros/src/codegen/module.rs +++ b/macros/src/codegen/module.rs @@ -304,8 +304,9 @@ pub fn codegen( ) -> Result<(), #ty> { unsafe { let input = #tupled; - if let Some(index) = rtic::export::interrupt::free(|_| #app_path::#fq.dequeue()) { + if let Some(index) = rtic::export::interrupt::free(|_| #app_path::#fq.get_mut_unchecked().dequeue()) { #app_path::#inputs + .get_mut_unchecked() .get_unchecked_mut(usize::from(index)) .as_mut_ptr() .write(input); diff --git a/macros/src/codegen/timer_queue.rs b/macros/src/codegen/timer_queue.rs index 82d0ac981e..f3fb5804f6 100644 --- a/macros/src/codegen/timer_queue.rs +++ b/macros/src/codegen/timer_queue.rs @@ -107,7 +107,7 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec { - rtic::export::interrupt::free(|_| #rq.split().0.enqueue_unchecked((#rqt::#name, index))); + rtic::export::interrupt::free(|_| #rq.get_mut_unchecked().split().0.enqueue_unchecked((#rqt::#name, index))); #pend }