aboutsummaryrefslogtreecommitdiff
path: root/rtic-macros/ui/local-shared.rs
blob: 4e8f9f4802c7a3b2e66555169d2dd2b55f278245 (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 {}

    #[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) {}
}