mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-18 05:45:19 +01:00
Async tasks can now take arguments at spawn again
This commit is contained in:
parent
cd790a9428
commit
d6d58b0eb8
17 changed files with 153 additions and 80 deletions
|
|
@ -27,6 +27,7 @@ mod app {
|
|||
hprintln!("init");
|
||||
|
||||
async_task::spawn().unwrap();
|
||||
async_task_args::spawn(1, 2).unwrap();
|
||||
async_task2::spawn().unwrap();
|
||||
|
||||
(Shared { a: 0 }, Local {})
|
||||
|
|
@ -53,6 +54,11 @@ mod app {
|
|||
hprintln!("hello from async");
|
||||
}
|
||||
|
||||
#[task]
|
||||
async fn async_task_args(_cx: async_task_args::Context, a: u32, b: i32) {
|
||||
hprintln!("hello from async with args a: {}, b: {}", a, b);
|
||||
}
|
||||
|
||||
#[task(priority = 2, shared = [a])]
|
||||
async fn async_task2(cx: async_task2::Context) {
|
||||
let async_task2::SharedResources { a: _, .. } = cx.shared;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue