mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-18 05:45:19 +01:00
Add exit to example
This commit is contained in:
parent
f5e86943a6
commit
09598ad9e9
1 changed files with 1 additions and 7 deletions
|
|
@ -25,18 +25,12 @@ mod app {
|
||||||
async fn task1(cx: task1::Context) {
|
async fn task1(cx: task1::Context) {
|
||||||
hprintln!("Hello from task1!");
|
hprintln!("Hello from task1!");
|
||||||
cx.local_spawner.task2(Default::default()).unwrap();
|
cx.local_spawner.task2(Default::default()).unwrap();
|
||||||
cx.local_spawner.task3(Default::default()).unwrap();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[task(priority = 1, local_task = true)]
|
#[task(priority = 1, local_task = true)]
|
||||||
async fn task2(_cx: task2::Context, _nsns: NotSendNotSync) {
|
async fn task2(_cx: task2::Context, _nsns: NotSendNotSync) {
|
||||||
hprintln!("Hello from task2!");
|
hprintln!("Hello from task2!");
|
||||||
}
|
debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator
|
||||||
|
|
||||||
// The value of `local_task` may be omitted and is in that case interpreted as `true`
|
|
||||||
#[task(priority = 1, local_task)]
|
|
||||||
async fn task3(_cx: task3::Context, _nsns: NotSendNotSync) {
|
|
||||||
hprintln!("Hello from task3!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue