mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-30 15:34:33 +01:00
Merge #480
480: book/migration/v5: update init signature, fix example syntax r=korken89 a=tmplt From the comment in #478. The example now migrates from v5 to v6 instead of an incorrect v6 syntax to a another incorrect v6 syntax. Co-authored-by: Viktor Sonesten <v@tmplt.dev>
This commit is contained in:
commit
fecbe85381
1 changed files with 4 additions and 4 deletions
|
@ -71,14 +71,14 @@ From this:
|
||||||
|
|
||||||
``` rust
|
``` rust
|
||||||
#[rtic::app(device = lm3s6965)]
|
#[rtic::app(device = lm3s6965)]
|
||||||
mod app {
|
const APP: () = {
|
||||||
#[init]
|
#[init]
|
||||||
fn init(_: init::Context) {
|
fn init(_: init::Context) {
|
||||||
rtic::pend(Interrupt::UART0);
|
rtic::pend(Interrupt::UART0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// [more code]
|
// [more code]
|
||||||
}
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
to this:
|
to this:
|
||||||
|
@ -87,10 +87,10 @@ to this:
|
||||||
#[rtic::app(device = lm3s6965)]
|
#[rtic::app(device = lm3s6965)]
|
||||||
mod app {
|
mod app {
|
||||||
#[init]
|
#[init]
|
||||||
fn init(_: init::Context) -> init::LateResources {
|
fn init(_: init::Context) -> (init::LateResources, init::Monotonics) {
|
||||||
rtic::pend(Interrupt::UART0);
|
rtic::pend(Interrupt::UART0);
|
||||||
|
|
||||||
init::LateResources {}
|
(init::LateResources {}, init::Monotonics())
|
||||||
}
|
}
|
||||||
|
|
||||||
// [more code]
|
// [more code]
|
||||||
|
|
Loading…
Reference in a new issue