diff options
author | 2021-03-11 14:27:07 +0100 | |
---|---|---|
committer | 2021-03-11 14:27:07 +0100 | |
commit | d7f79bf3ce57c793edb9cab45c0fba78cd9b2e36 (patch) | |
tree | a0156a55f0ab74ac87d28037f0712253a4a5ff51 /macros/src/codegen/timer_queue.rs | |
parent | bd4cc1b9f0761479c0c0f2a012c370876b7c690f (diff) | |
download | rtic-d7f79bf3ce57c793edb9cab45c0fba78cd9b2e36.tar.gz rtic-d7f79bf3ce57c793edb9cab45c0fba78cd9b2e36.tar.zst rtic-d7f79bf3ce57c793edb9cab45c0fba78cd9b2e36.zip |
doc comments to source file + timer queue using RacyCell
Diffstat (limited to 'macros/src/codegen/timer_queue.rs')
-rw-r--r-- | macros/src/codegen/timer_queue.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/macros/src/codegen/timer_queue.rs b/macros/src/codegen/timer_queue.rs index f3fb5804..47f45350 100644 --- a/macros/src/codegen/timer_queue.rs +++ b/macros/src/codegen/timer_queue.rs @@ -61,13 +61,13 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec<TokenStrea let n = util::capacity_typenum(cap, false); let tq_ty = quote!(rtic::export::TimerQueue<#mono_type, #t, #n>); + let doc = format!(" RTIC internal: {}:{}", file!(), line!()); items.push(quote!( - #[doc(hidden)] - static mut #tq: #tq_ty = rtic::export::TimerQueue( - rtic::export::BinaryHeap( - rtic::export::iBinaryHeap::new() - ) - ); + #[doc = #doc] + static #tq: rtic::RacyCell<#tq_ty> = + rtic::RacyCell::new(rtic::export::TimerQueue( + rtic::export::BinaryHeap(rtic::export::iBinaryHeap::new()) + )); )); let mono = util::monotonic_ident(&monotonic_name); @@ -129,7 +129,7 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec<TokenStrea while let Some((task, index)) = rtic::export::interrupt::free(|_| if let Some(mono) = #app_path::#m_ident.as_mut() { - #tq.dequeue(|| #disable_isr, mono) + #tq.get_mut_unchecked().dequeue(|| #disable_isr, mono) } else { // We can only use the timer queue if `init` has returned, and it // writes the `Some(monotonic)` we are accessing here. |