2022-12-31 14:45:13 +01:00
|
|
|
#![no_main]
|
|
|
|
|
|
|
|
#[rtic_macros::mock_app(device = mock)]
|
|
|
|
mod app {
|
|
|
|
#[shared]
|
|
|
|
struct Shared {}
|
|
|
|
|
|
|
|
#[local]
|
|
|
|
struct Local {
|
|
|
|
l1: u32,
|
|
|
|
l2: u32,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[init]
|
2023-01-08 16:25:46 +01:00
|
|
|
fn init(_: init::Context) -> (Shared, Local) {}
|
2022-12-31 14:45:13 +01:00
|
|
|
|
|
|
|
// l2 ok
|
|
|
|
#[idle(local = [l2])]
|
|
|
|
fn idle(cx: idle::Context) -> ! {}
|
|
|
|
|
|
|
|
// l1 rejected (not local)
|
|
|
|
#[task(priority = 1, local = [l1])]
|
2023-01-08 16:25:46 +01:00
|
|
|
async fn uart0(cx: uart0::Context) {}
|
2022-12-31 14:45:13 +01:00
|
|
|
|
|
|
|
// l1 rejected (not lock_free)
|
|
|
|
#[task(priority = 2, local = [l1])]
|
2023-01-08 16:25:46 +01:00
|
|
|
async fn uart1(cx: uart1::Context) {}
|
2022-12-31 14:45:13 +01:00
|
|
|
}
|