diff --git a/book/en/src/migration/migration_v5.md b/book/en/src/migration/migration_v5.md index 5cf818c516..013adb79d9 100644 --- a/book/en/src/migration/migration_v5.md +++ b/book/en/src/migration/migration_v5.md @@ -36,7 +36,6 @@ mod app { This works also for ram functions, see examples/ramfunc.rs - ## Module instead of Const With the support of attributes on modules the `const APP` workaround is not needed. @@ -125,3 +124,13 @@ struct whateveryouwant { ``` would work equally well. + +--- + +## Additions + +## Extern tasks + +Both software and hardware tasks can now be defined external to the `mod app`. Previously this was possible only by implementing a trampoline calling out the task implementation. + +See examples `examples/extern_binds.rs` and `examples/extern_spawn.rs`. \ No newline at end of file diff --git a/examples/extern_binds.rs b/examples/extern_binds.rs index 5a43b341ee..c3e5f73b33 100644 --- a/examples/extern_binds.rs +++ b/examples/extern_binds.rs @@ -8,11 +8,11 @@ use cortex_m_semihosting::hprintln; use panic_semihosting as _; +// Free function implementing the interrupt bound task `foo`. fn foo(_: app::foo::Context) { hprintln!("foo called").ok(); } -// `examples/interrupt.rs` rewritten to use `binds` #[rtic::app(device = lm3s6965)] mod app { use crate::foo; diff --git a/examples/extern_spawn.rs b/examples/extern_spawn.rs index 7dbac2e8df..cd90d19158 100644 --- a/examples/extern_spawn.rs +++ b/examples/extern_spawn.rs @@ -8,6 +8,7 @@ use cortex_m_semihosting::{debug, hprintln}; use panic_semihosting as _; +// Free function implementing the spawnable task `foo`. fn foo(_c: app::foo::Context, x: i32, y: u32) { hprintln!("foo {}, {}", x, y).unwrap(); if x == 2 {