diff --git a/macros/src/codegen/dispatchers.rs b/macros/src/codegen/dispatchers.rs index dc33b1af60..1002c14589 100644 --- a/macros/src/codegen/dispatchers.rs +++ b/macros/src/codegen/dispatchers.rs @@ -59,7 +59,7 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec = rtic::RacyCell::new(#rq_expr); )); let arms = channel @@ -100,7 +100,7 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec>(); stmts.push(quote!( - while let Some((task, index)) = #rq.split().1.dequeue() { + while let Some((task, index)) = #rq.get_mut_unchecked().split().1.dequeue() { match task { #(#arms)* } diff --git a/macros/src/codegen/module.rs b/macros/src/codegen/module.rs index 75435b549e..5a66408320 100644 --- a/macros/src/codegen/module.rs +++ b/macros/src/codegen/module.rs @@ -215,7 +215,7 @@ pub fn codegen( .write(input); rtic::export::interrupt::free(|_| { - #app_path::#rq.enqueue_unchecked((#app_path::#t::#name, index)); + #app_path::#rq.get_mut_unchecked().enqueue_unchecked((#app_path::#t::#name, index)); }); rtic::pend(#device::#enum_::#interrupt); diff --git a/src/lib.rs b/src/lib.rs index 2da2ec9583..72e4939631 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -75,4 +75,5 @@ impl RacyCell { } // The type wrapped need to be Sync for RacyCell to be Sync -unsafe impl Sync for RacyCell where T: Sync {} +//unsafe impl Sync for RacyCell where T: Sync {} +unsafe impl Sync for RacyCell {}