rtic/rtic-macros/ui/spawn-local-from-init.rs
Albin Hedman 8fbf8a9f0e Add test for spawning a local task from init
This ensures that there is no method in the globaly
available module with the same name as the local task.
2025-10-19 13:35:31 +02:00

21 lines
393 B
Rust

#![no_main]
#[rtic_macros::mock_app(device = mock, dispatchers = [EXTI0])]
mod app {
use super::*;
#[shared]
struct Shared {}
#[local]
struct Local {}
#[init]
fn init(_cx: init::Context) -> (Shared, Local) {
foo::spawn().ok();
(Shared {}, Local {})
}
#[task(priority = 1, is_local_task = true)]
async fn foo(_cx: foo::Context) {}
}