mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-18 22:05:37 +01:00
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.
This commit is contained in:
parent
f10d2b9efd
commit
8fbf8a9f0e
1 changed files with 21 additions and 0 deletions
21
rtic-macros/ui/spawn-local-from-init.rs
Normal file
21
rtic-macros/ui/spawn-local-from-init.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#![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) {}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue