From b71df58f2fb4ed85d4c8cf806d5837ce63c73f31 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Wed, 22 Sep 2021 13:22:45 +0200 Subject: The great docs update --- examples/spawn.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'examples/spawn.rs') diff --git a/examples/spawn.rs b/examples/spawn.rs index 435cdf5..2db1ab8 100644 --- a/examples/spawn.rs +++ b/examples/spawn.rs @@ -19,17 +19,16 @@ mod app { #[init] fn init(_: init::Context) -> (Shared, Local, init::Monotonics) { - foo::spawn(1, 2).unwrap(); + hprintln!("init").unwrap(); + foo::spawn().unwrap(); (Shared {}, Local {}, init::Monotonics()) } - #[task()] - fn foo(_c: foo::Context, x: i32, y: u32) { - hprintln!("foo {}, {}", x, y).unwrap(); - if x == 2 { - debug::exit(debug::EXIT_SUCCESS); - } - foo::spawn(2, 3).unwrap(); + #[task] + fn foo(_: foo::Context) { + hprintln!("foo").unwrap(); + + debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator } } -- cgit v1.2.3