This allows tasks to be gated by `cfg` attributes when also using
monotonics. For example:
```rust
#[cfg(feature = "logging")]
#[task(shared = [logger])]
fn logger_init(mut cx: logger_init::Context) {
/* ... */
}
```
Without this change, the reschedule_at() implementation is
unconditionally included even though it references the SpawnHandle from
its task module, which is _conditionally_ included. This resulted in
compiler errors like the following:
```
error[E0433]: failed to resolve: use of undeclared crate or module `logger_init`
--> src/main.rs:243:8
|
243 | fn logger_init(mut cx: logger_init::Context) {
| ^^^^^^^^^^^ use of undeclared crate or module `logger_init`
```
496: update the 0.5.x -> 0.6.0 migration guide r=AfoHT a=japaric
to use the new resources syntax
I also reordered the sections to cover all the resource API first before covering the spawn API
I've also added a section about the old `static mut` variable transform
Co-authored-by: Jorge Aparicio <jorge.aparicio@ferrous-systems.com>
to use the new resources syntax
I also reordered the sections to cover all the resource API first before covering the spawn API
I've also added a section about the old `static mut` variable transform
489: Allow zero sized LinkedList r=korken89 a=jhillyerd
If one configures a monotonic in alpha4, but doesn't use it, TimerQueue attempts to create a zero-sized LinkedList, which causes an underflow.
This PR allows for zero-sized linked lists.
Co-authored-by: James Hillyerd <james@hillyerd.com>
479: book: detail import resolving for 0.6 migration r=korken89 a=tmplt
That is, answering the question of why imports are no longer resolving during compilation.
Co-authored-by: Viktor Sonesten <v@tmplt.dev>
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>
478: book: update outdated required init signature r=korken89 a=tmplt
As per the title. The required signature of `#[init]` in the flowing text has not yet been updated for v0.6.0.
Co-authored-by: Viktor Sonesten <v@tmplt.dev>
476: reclaim stack space used in late init r=korken89 a=conorpp
Fixes#474.
Tested that there is no longer any stack overhead leftover from moving init resources.
(made mistake force pushing with last PR when trying to fix lint)
The expansion for an example with 2 buffers as resources changes from:
```rust
let (late, mut monotonics) = crate::APP::init(init::Context::new(core.into()));
__rtic_internal_mybuffer.as_mut_ptr().write(late.mybuffer);
__rtic_internal_mybuffer2.as_mut_ptr().write(late.mybuffer2);
rtic::export::interrupt::enable();
crate::APP::idle(idle::Context::new(&rtic::export::Priority::new(0)))
```
to:
```rust
#[inline(never)]
fn __rtic_init_resources<F>(f: F)
where
F: FnOnce(),
{
f();
}
__rtic_init_resources(|| {
let (late, mut monotonics) = crate::APP::init(init::Context::new(core.into()));
__rtic_internal_mybuffer.as_mut_ptr().write(late.mybuffer);
__rtic_internal_mybuffer2.as_mut_ptr().write(late.mybuffer2);
rtic::export::interrupt::enable();
});
crate::APP::idle(idle::Context::new(&rtic::export::Priority::new(0)))
```
Co-authored-by: Conor Patrick <conorpp94@gmail.com>