From bc3eb5c54784c32ccfff404dba58a27d5a47f04e Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Mon, 16 Aug 2021 15:37:39 +0200 Subject: Remove linked list impl - use heapless, linked list init now const fn --- macros/src/codegen/timer_queue.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'macros/src/codegen/timer_queue.rs') diff --git a/macros/src/codegen/timer_queue.rs b/macros/src/codegen/timer_queue.rs index abddbad..bf896ee 100644 --- a/macros/src/codegen/timer_queue.rs +++ b/macros/src/codegen/timer_queue.rs @@ -62,21 +62,20 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec>); + let n = util::capacity_literal(cap); + let tq_ty = quote!(rtic::export::TimerQueue<#mono_type, #t, #n>); // For future use // let doc = format!(" RTIC internal: {}:{}", file!(), line!()); items.push(quote!( #[doc(hidden)] static #tq: rtic::RacyCell<#tq_ty> = - rtic::RacyCell::new(core::mem::MaybeUninit::uninit()); + rtic::RacyCell::new(rtic::export::TimerQueue(rtic::export::SortedLinkedList::new_u16())); )); let mono = util::monotonic_ident(&monotonic_name); @@ -138,7 +137,7 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec Date: Thu, 19 Aug 2021 08:21:18 +0200 Subject: Fixed some lints from Rust Analyzer with experimental proc-macros --- macros/src/codegen/timer_queue.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'macros/src/codegen/timer_queue.rs') diff --git a/macros/src/codegen/timer_queue.rs b/macros/src/codegen/timer_queue.rs index bf896ee..e805292 100644 --- a/macros/src/codegen/timer_queue.rs +++ b/macros/src/codegen/timer_queue.rs @@ -15,6 +15,7 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec = rtic::RacyCell::new(0); )); @@ -74,6 +75,8 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec = rtic::RacyCell::new(rtic::export::TimerQueue(rtic::export::SortedLinkedList::new_u16())); )); @@ -85,6 +88,8 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec> = rtic::RacyCell::new(None); )); } -- cgit v1.2.3 From cdbd8a2cede668e1181030bd7c439592a8f0e980 Mon Sep 17 00:00:00 2001 From: datdenkikniet Date: Thu, 19 Aug 2021 21:32:12 +0200 Subject: Use `mark_internal_name` by default for methods in `util` to make usage of these functions more straightforward. fq_ident is always internal rq_ident is always internal monotonic_ident is always internal inputs_ident is always internal local_resources_ident is always internal shared_resources_ident is always internal monotonic_instants_ident is always internal tq_ident is always internal timer_queue_marker_ident is always internal static_shared_resource_ident is always internal static_local_resource_ident is always internal declared_static_local_resource_ident is always internal Only names, not idents, are now marked as internal Use same rtic internal everywhere --- macros/src/codegen/timer_queue.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'macros/src/codegen/timer_queue.rs') diff --git a/macros/src/codegen/timer_queue.rs b/macros/src/codegen/timer_queue.rs index e805292..fdfa638 100644 --- a/macros/src/codegen/timer_queue.rs +++ b/macros/src/codegen/timer_queue.rs @@ -10,7 +10,7 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec Vec Vec Vec