From 9e445b3583c15c7701f3167eaa8dfe4afd541691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Sat, 4 Feb 2023 16:47:17 +0100 Subject: Move rtic macros to repo root, tune xtask --- rtic-macros/ui/local-shared.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 rtic-macros/ui/local-shared.rs (limited to 'rtic-macros/ui/local-shared.rs') 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) {} +} -- cgit v1.2.3