diff options
| author | Emil Fresk <emil.fresk@gmail.com> | 2020-12-12 23:31:05 +0100 |
|---|---|---|
| committer | Emil Fresk <emil.fresk@gmail.com> | 2020-12-12 23:35:47 +0100 |
| commit | 1c8de78f6f6e9e265d9d894d2ebde622bf16d44e (patch) | |
| tree | 0ce6ed85be7c80e6204adb8bea8467db29a8f9f2 /macros | |
| parent | 8e8ec9b7b879adae8d4de6cb2320b9b19290a7e0 (diff) | |
Cleanup
Diffstat (limited to 'macros')
| -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 03bac84..1219e14 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 db3ab3a..4a1d749 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 329a7dd..a201dfe 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 { |
