501: Propogate the task attributes to the spawn handles r=AfoHT a=crawford
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`
```
Co-authored-by: Alex Crawford <rtic@code.acrawford.com>
502: book/resources: highlight that `#[lock_free]` includes a compile-time check r=AfoHT a=japaric
for the "same priority requirement"; this prevents data races
Co-authored-by: Jorge Aparicio <jorge.aparicio@ferrous-systems.com>
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`
```
498: book: update the resources chapter r=AfoHT a=japaric
see individual commit messages for details.
what's still left to do is adjust the very last section about `#[task_local]` and `#[lock_free]` but I plan to do that as a follow up. I didn't find an in-tree example for those two attributes (are they field attributes? where do they fit in the syntax?); a quick scan of the rtic-syntax crate seems to indicate that `task_local` has been removed (?) and that `lock_free` still exists.
Co-authored-by: Jorge Aparicio <jorge.aparicio@ferrous-systems.com>
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>