aboutsummaryrefslogtreecommitdiff
path: root/rtic-macros/ui
diff options
context:
space:
mode:
Diffstat (limited to 'rtic-macros/ui')
-rw-r--r--rtic-macros/ui/task-no-prio.rs19
-rw-r--r--rtic-macros/ui/task-no-prio.stderr5
2 files changed, 24 insertions, 0 deletions
diff --git a/rtic-macros/ui/task-no-prio.rs b/rtic-macros/ui/task-no-prio.rs
new file mode 100644
index 0000000..8327777
--- /dev/null
+++ b/rtic-macros/ui/task-no-prio.rs
@@ -0,0 +1,19 @@
+#![no_main]
+
+#[rtic_macros::mock_app(device = mock)]
+mod app {
+ #[shared]
+ struct Shared {}
+
+ #[local]
+ struct Local {}
+
+ #[init]
+ fn init(_: init::Context) -> (Shared, Local) {}
+
+ #[idle]
+ fn idle(_: idle::Context) -> ! {}
+
+ #[task]
+ async fn task1(_: task1::Context) {}
+}
diff --git a/rtic-macros/ui/task-no-prio.stderr b/rtic-macros/ui/task-no-prio.stderr
new file mode 100644
index 0000000..4ff97ec
--- /dev/null
+++ b/rtic-macros/ui/task-no-prio.stderr
@@ -0,0 +1,5 @@
+error: Async task "task1" has priority 0, but `#[idle]` is defined. 0-priority async tasks are only allowed if there is no `#[idle]`.
+ --> ui/task-no-prio.rs:18:14
+ |
+18 | async fn task1(_: task1::Context) {}
+ | ^^^^^