aboutsummaryrefslogtreecommitdiff
path: root/rtic-macros/ui/task-init.rs
diff options
context:
space:
mode:
authorGravatar Henrik Tjäder <henrik@tjaders.com> 2023-02-04 16:47:17 +0100
committerGravatar Henrik Tjäder <henrik@tjaders.com> 2023-03-01 00:35:13 +0100
commit9e445b3583c15c7701f3167eaa8dfe4afd541691 (patch)
tree167565d51598f42c0454d60b34e1170589ae1056 /rtic-macros/ui/task-init.rs
parent4124fbdd61ff823c6217a2a16ebb4d813146116c (diff)
downloadrtic-9e445b3583c15c7701f3167eaa8dfe4afd541691.tar.gz
rtic-9e445b3583c15c7701f3167eaa8dfe4afd541691.tar.zst
rtic-9e445b3583c15c7701f3167eaa8dfe4afd541691.zip
Move rtic macros to repo root, tune xtask
Diffstat (limited to 'rtic-macros/ui/task-init.rs')
-rw-r--r--rtic-macros/ui/task-init.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/rtic-macros/ui/task-init.rs b/rtic-macros/ui/task-init.rs
new file mode 100644
index 00000000..e58fdceb
--- /dev/null
+++ b/rtic-macros/ui/task-init.rs
@@ -0,0 +1,17 @@
+#![no_main]
+
+#[rtic_macros::mock_app(device = mock)]
+mod app {
+ #[shared]
+ struct Shared {}
+
+ #[local]
+ struct Local {}
+
+ #[init]
+ fn foo(_: foo::Context) -> (Shared, Local) {}
+
+ // name collides with `#[idle]` function
+ #[task]
+ async fn foo(_: foo::Context) {}
+}