mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-29 15:04:32 +01:00
callback example
This commit is contained in:
parent
e85baee30b
commit
f3cbf61682
1 changed files with 3 additions and 3 deletions
|
@ -12,7 +12,7 @@ use panic_semihosting as _;
|
||||||
mod app {
|
mod app {
|
||||||
use super::*;
|
use super::*;
|
||||||
#[init()]
|
#[init()]
|
||||||
fn init(c: init::Context) -> (init::LateResources, init::Monotonics) {
|
fn init(_: init::Context) -> (init::LateResources, init::Monotonics) {
|
||||||
hprintln!("init").unwrap();
|
hprintln!("init").unwrap();
|
||||||
driver(&bar::spawn);
|
driver(&bar::spawn);
|
||||||
foo::spawn(123).unwrap();
|
foo::spawn(123).unwrap();
|
||||||
|
@ -20,13 +20,13 @@ mod app {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[task()]
|
#[task()]
|
||||||
fn foo(c: foo::Context, data: u32) {
|
fn foo(_: foo::Context, data: u32) {
|
||||||
hprintln!("foo {}", data).unwrap();
|
hprintln!("foo {}", data).unwrap();
|
||||||
bar::spawn().unwrap();
|
bar::spawn().unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[task()]
|
#[task()]
|
||||||
fn bar(_c: bar::Context) {
|
fn bar(_: bar::Context) {
|
||||||
hprintln!("bar").unwrap();
|
hprintln!("bar").unwrap();
|
||||||
|
|
||||||
debug::exit(debug::EXIT_SUCCESS);
|
debug::exit(debug::EXIT_SUCCESS);
|
||||||
|
|
Loading…
Reference in a new issue