aboutsummaryrefslogtreecommitdiff
path: root/rtic-macros/ui/local-shared.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2023-03-04 21:10:24 +0000
committerGitHub <noreply@github.com>2023-03-04 21:10:24 +0000
commit7c7d6558f6d9c50fbb4d2487c98c9a5be15f2f7b (patch)
tree80a47f0dc40059014e9448c4c2eb34c54dff45fe /rtic-macros/ui/local-shared.rs
parent1c5db277e4161470136dbd2a11e914ff1d383581 (diff)
parent98c5490d94950608d31cd5ad9dd260f2f853735c (diff)
Merge #694
694: RTIC 2 r=AfoHT a=korken89 Co-authored-by: Emil Fresk <emil.fresk@gmail.com> Co-authored-by: Per Lindgren <per.lindgren@ltu.se>
Diffstat (limited to 'rtic-macros/ui/local-shared.rs')
-rw-r--r--rtic-macros/ui/local-shared.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/rtic-macros/ui/local-shared.rs b/rtic-macros/ui/local-shared.rs
new file mode 100644
index 0000000..4e8f9f4
--- /dev/null
+++ b/rtic-macros/ui/local-shared.rs
@@ -0,0 +1,28 @@
+#![no_main]
+
+#[rtic_macros::mock_app(device = mock)]
+mod app {
+ #[shared]
+ struct Shared {}
+
+ #[local]
+ struct Local {
+ l1: u32,
+ l2: u32,
+ }
+
+ #[init]
+ fn init(_: init::Context) -> (Shared, Local) {}
+
+ // l2 ok
+ #[idle(local = [l2])]
+ fn idle(cx: idle::Context) -> ! {}
+
+ // l1 rejected (not local)
+ #[task(priority = 1, local = [l1])]
+ async fn uart0(cx: uart0::Context) {}
+
+ // l1 rejected (not lock_free)
+ #[task(priority = 2, local = [l1])]
+ async fn uart1(cx: uart1::Context) {}
+}