From 67d5ade4fdbb2fb4a1c13715e4829412f4007d75 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Wed, 10 May 2023 14:24:32 +0200 Subject: Fix zero prio tasks when all async tasks have default (no) arguments --- rtic-macros/ui/task-no-prio.rs | 19 +++++++++++++++++++ rtic-macros/ui/task-no-prio.stderr | 5 +++++ 2 files changed, 24 insertions(+) create mode 100644 rtic-macros/ui/task-no-prio.rs create mode 100644 rtic-macros/ui/task-no-prio.stderr (limited to 'rtic-macros/ui') 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) {} + | ^^^^^ -- cgit v1.2.3