aboutsummaryrefslogtreecommitdiff
path: root/macros/ui/async-local-resouces.rs
diff options
context:
space:
mode:
Diffstat (limited to 'macros/ui/async-local-resouces.rs')
-rw-r--r--macros/ui/async-local-resouces.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/macros/ui/async-local-resouces.rs b/macros/ui/async-local-resouces.rs
new file mode 100644
index 00000000..1ba58652
--- /dev/null
+++ b/macros/ui/async-local-resouces.rs
@@ -0,0 +1,28 @@
+#![no_main]
+
+#[rtic_macros::mock_app(device = mock)]
+mod app {
+ #[shared]
+ struct Shared {
+ #[lock_free]
+ e: u32,
+ }
+
+ #[local]
+ struct Local {}
+
+ #[init]
+ fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}
+
+ // e ok
+ #[task(priority = 1, shared = [e])]
+ fn uart0(cx: uart0::Context) {}
+
+ // e ok
+ #[task(priority = 1, shared = [e])]
+ fn uart1(cx: uart1::Context) {}
+
+ // e not ok
+ #[task(priority = 1, shared = [e])]
+ async fn async_task(cx: async_task::Context) {}
+}