Skip to content

Commit 40a9681

Browse files
committed
Add exit to example
1 parent 4f15e40 commit 40a9681

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Hello from task1!
2+
Hello from task2!

examples/lm3s6965/examples/spawn_local.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use panic_semihosting as _;
55

66
#[rtic::app(device = lm3s6965, dispatchers = [SSI0])]
77
mod app {
8-
use cortex_m_semihosting::hprintln;
8+
use cortex_m_semihosting::{debug, hprintln};
99
use super::*;
1010

1111
#[shared]
@@ -25,18 +25,12 @@ mod app {
2525
async fn task1(cx: task1::Context) {
2626
hprintln!("Hello from task1!");
2727
cx.local_spawner.task2(Default::default()).unwrap();
28-
cx.local_spawner.task3(Default::default()).unwrap();
2928
}
3029

3130
#[task(priority = 1, local_task = true)]
3231
async fn task2(_cx: task2::Context, _nsns: NotSendNotSync) {
3332
hprintln!("Hello from task2!");
34-
}
35-
36-
// The value of `local_task` may be omitted and is in that case interpreted as `true`
37-
#[task(priority = 1, local_task)]
38-
async fn task3(_cx: task3::Context, _nsns: NotSendNotSync) {
39-
hprintln!("Hello from task3!");
33+
debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator
4034
}
4135
}
4236

0 commit comments

Comments
 (0)