aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Emil Fresk <emil.fresk@gmail.com> 2020-12-12 23:31:05 +0100
committerGravatar Emil Fresk <emil.fresk@gmail.com> 2020-12-12 23:35:47 +0100
commit1c8de78f6f6e9e265d9d894d2ebde622bf16d44e (patch)
tree0ce6ed85be7c80e6204adb8bea8467db29a8f9f2
parent8e8ec9b7b879adae8d4de6cb2320b9b19290a7e0 (diff)
downloadrtic-1c8de78f6f6e9e265d9d894d2ebde622bf16d44e.tar.gz
rtic-1c8de78f6f6e9e265d9d894d2ebde622bf16d44e.tar.zst
rtic-1c8de78f6f6e9e265d9d894d2ebde622bf16d44e.zip
Cleanup
-rw-r--r--examples/test_new_monotonic.rs4
-rw-r--r--macros/src/codegen.rs14
-rw-r--r--macros/src/codegen/hardware_tasks.rs14
-rw-r--r--macros/src/codegen/util.rs5
4 files changed, 15 insertions, 22 deletions
diff --git a/examples/test_new_monotonic.rs b/examples/test_new_monotonic.rs
index d2530c66..3323c09b 100644
--- a/examples/test_new_monotonic.rs
+++ b/examples/test_new_monotonic.rs
@@ -15,8 +15,7 @@ mod app {
type MyMono2 = hal::Mono2;
#[init]
- fn init(cx: init::Context) -> (init::LateResources, init::Monotonics) {
- }
+ fn init(cx: init::Context) -> (init::LateResources, init::Monotonics) {}
#[task]
fn task1(_: task1::Context) {}
@@ -24,4 +23,3 @@ mod app {
#[task]
fn task2(_: task2::Context) {}
}
-
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 {