aboutsummaryrefslogtreecommitdiff
path: root/macros/ui/async-local-resouces.rs
blob: 1ba58652dace16d0ed13624160f705b01a1773ad (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#![no_main]

#[rtic_macros::mock_app(device = mock)]
mod app {
    #[shared]
    struct Shared {
        #[lock_free]
        e: u32,
    }

    #[local]
    struct Local {}

    #[init]
    fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {}

    // e ok
    #[task(priority = 1, shared = [e])]
    fn uart0(cx: uart0::Context) {}

    // e ok
    #[task(priority = 1, shared = [e])]
    fn uart1(cx: uart1::Context) {}

    // e not ok
    #[task(priority = 1, shared = [e])]
    async fn async_task(cx: async_task::Context) {}
}