aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/type-usage.rs2
-rw-r--r--macros/Cargo.toml4
-rw-r--r--macros/src/codegen/module.rs16
-rw-r--r--src/tq.rs6
4 files changed, 11 insertions, 17 deletions
diff --git a/examples/type-usage.rs b/examples/type-usage.rs
index a7a0d411..9bb7eb8d 100644
--- a/examples/type-usage.rs
+++ b/examples/type-usage.rs
@@ -1,4 +1,4 @@
-//! examples/smallest.rs
+//! examples/type-usage.rs
#![no_main]
#![no_std]
diff --git a/macros/Cargo.toml b/macros/Cargo.toml
index 8607ce55..203a2bb1 100644
--- a/macros/Cargo.toml
+++ b/macros/Cargo.toml
@@ -22,6 +22,4 @@ proc-macro2 = "1"
proc-macro-error = "1"
quote = "1"
syn = "1"
-# rtic-syntax = "0.5.0-alpha.2"
-rtic-syntax = { path = "../../rtic-syntax", version = "0.5.0-alpha.2" }
-
+rtic-syntax = "0.5.0-alpha.2"
diff --git a/macros/src/codegen/module.rs b/macros/src/codegen/module.rs
index ac69a803..50146c02 100644
--- a/macros/src/codegen/module.rs
+++ b/macros/src/codegen/module.rs
@@ -414,17 +414,11 @@ pub fn codegen(
let tq = unsafe { &mut *#app_path::#tq.as_mut_ptr() };
- if let Some(mono) = #app_path::#m_ident.as_mut() {
- tq.enqueue_unchecked(
- nr,
- || #enable_interrupt,
- || #pend,
- mono)
- } else {
- // We can only use the timer queue if `init` has returned, and it
- // writes the `Some(monotonic)` we are accessing here.
- core::hint::unreachable_unchecked()
- }
+ tq.enqueue_unchecked(
+ nr,
+ || #enable_interrupt,
+ || #pend,
+ #app_path::#m_ident.as_mut());
Ok(SpawnHandle { marker })
})
diff --git a/src/tq.rs b/src/tq.rs
index 38640259..985e0f88 100644
--- a/src/tq.rs
+++ b/src/tq.rs
@@ -42,7 +42,7 @@ where
nr: NotReady<Mono, Task>,
enable_interrupt: F1,
pend_handler: F2,
- mono: &mut Mono,
+ mono: Option<&mut Mono>,
) where
F1: FnOnce(),
F2: FnOnce(),
@@ -57,7 +57,9 @@ where
if if_heap_max_greater_than_nr {
if Mono::DISABLE_INTERRUPT_ON_EMPTY_QUEUE && self.0.is_empty() {
- mono.enable_timer();
+ if let Some(mono) = mono {
+ mono.enable_timer();
+ }
enable_interrupt();
}