diff options
author | 2020-12-12 23:31:05 +0100 | |
---|---|---|
committer | 2020-12-12 23:35:47 +0100 | |
commit | 1c8de78f6f6e9e265d9d894d2ebde622bf16d44e (patch) | |
tree | 0ce6ed85be7c80e6204adb8bea8467db29a8f9f2 /macros/src | |
parent | 8e8ec9b7b879adae8d4de6cb2320b9b19290a7e0 (diff) | |
download | rtic-1c8de78f6f6e9e265d9d894d2ebde622bf16d44e.tar.gz rtic-1c8de78f6f6e9e265d9d894d2ebde622bf16d44e.tar.zst rtic-1c8de78f6f6e9e265d9d894d2ebde622bf16d44e.zip |
Cleanup
Diffstat (limited to 'macros/src')
-rw-r--r-- | macros/src/codegen.rs | 14 | ||||
-rw-r--r-- | macros/src/codegen/hardware_tasks.rs | 14 | ||||
-rw-r--r-- | macros/src/codegen/util.rs | 5 |
3 files changed, 14 insertions, 19 deletions
diff --git a/macros/src/codegen.rs b/macros/src/codegen.rs index 03bac849..1219e14f 100644 --- a/macros/src/codegen.rs +++ b/macros/src/codegen.rs @@ -104,11 +104,15 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 { )); } - let monotonic_imports: Vec<_> = app.monotonics.iter().map(|(_, monotonic)| { - let name = &monotonic.ident; - let ty = &monotonic.ty; - quote!(pub type #name = #ty;) - }).collect(); + let monotonic_imports: Vec<_> = app + .monotonics + .iter() + .map(|(_, monotonic)| { + let name = &monotonic.ident; + let ty = &monotonic.ty; + quote!(pub type #name = #ty;) + }) + .collect(); quote!( /// Implementation details diff --git a/macros/src/codegen/hardware_tasks.rs b/macros/src/codegen/hardware_tasks.rs index db3ab3a6..4a1d7492 100644 --- a/macros/src/codegen/hardware_tasks.rs +++ b/macros/src/codegen/hardware_tasks.rs @@ -29,16 +29,6 @@ pub fn codegen( let mut user_tasks = vec![]; for (name, task) in &app.hardware_tasks { - // let (let_instant, instant) = if let Some(ref m) = extra.monotonic { - // ( - // Some(quote!(let instant = <#m as rtic::Monotonic>::now();)), - // Some(quote!(, instant)), - // ) - // } else { - // (None, None) - // }; - let (let_instant, instant) = (quote!(), quote!()); - let locals_new = if task.locals.is_empty() { quote!() } else { @@ -56,12 +46,10 @@ pub fn codegen( unsafe fn #symbol() { const PRIORITY: u8 = #priority; - #let_instant - rtic::export::run(PRIORITY, || { #app_path::#name( #locals_new - #name::Context::new(&rtic::export::Priority::new(PRIORITY) #instant) + #name::Context::new(&rtic::export::Priority::new(PRIORITY)) ) }); } diff --git a/macros/src/codegen/util.rs b/macros/src/codegen/util.rs index 329a7ddf..a201dfe5 100644 --- a/macros/src/codegen/util.rs +++ b/macros/src/codegen/util.rs @@ -78,7 +78,10 @@ pub fn inputs_ident(task: &Ident) -> Ident { /// Generates an identifier for the `INSTANTS` buffer (`schedule` API) pub fn monotonic_instants_ident(task: &Ident, monotonic: &Ident) -> Ident { - Ident::new(&format!("{}_{}_INSTANTS", task, monotonic), Span::call_site()) + Ident::new( + &format!("{}_{}_INSTANTS", task, monotonic), + Span::call_site(), + ) } pub fn interrupt_ident() -> Ident { |