From 78a6d8442012c4066c2e2baf1810594b7b16f376 Mon Sep 17 00:00:00 2001 From: Per Lindgren Date: Thu, 11 Mar 2021 14:47:06 +0100 Subject: [PATCH] wip --- macros/src/codegen/module.rs | 4 ++-- macros/src/codegen/timer_queue.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/macros/src/codegen/module.rs b/macros/src/codegen/module.rs index afda26cf0c..22e08b9d46 100644 --- a/macros/src/codegen/module.rs +++ b/macros/src/codegen/module.rs @@ -290,7 +290,7 @@ pub fn codegen( D::T: Into<<#app_path::#mono_type as rtic::time::Clock>::T>, { - let instant = if rtic::export::interrupt::free(|_| unsafe { #app_path::#m_ident.is_none() }) { + let instant = if rtic::export::interrupt::free(|_| unsafe { #app_path::#m_ident.get_mut_unchecked().is_none() }) { rtic::time::Instant::new(0) } else { #app_path::#m::now() @@ -327,7 +327,7 @@ pub fn codegen( }; rtic::export::interrupt::free(|_| - if let Some(mono) = #app_path::#m_ident.as_mut() { + if let Some(mono) = #app_path::#m_ident.get_mut_unchecked().as_mut() { #app_path::#tq.get_mut_unchecked().enqueue_unchecked( nr, || #enable_interrupt, diff --git a/macros/src/codegen/timer_queue.rs b/macros/src/codegen/timer_queue.rs index 47f45350e6..1d2a678e0d 100644 --- a/macros/src/codegen/timer_queue.rs +++ b/macros/src/codegen/timer_queue.rs @@ -76,7 +76,7 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec = None; + static #mono: rtic::RacyCell> = rtic::RacyCell::new(None); )); } @@ -128,7 +128,7 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec Vec