Commit graph

1195 commits

Author SHA1 Message Date
Viktor Sonesten
cfc97488db book: detail import resolving for 0.6 migration 2021-04-21 15:25:58 +02:00
bors[bot]
426662b198
Merge #478
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>
2021-04-21 13:18:25 +00:00
Viktor Sonesten
374a1c2add book: update outdated required init signature 2021-04-21 15:00:53 +02:00
bors[bot]
99a53c7ca7
Merge #477
477: Fix for default monotonic, `monotonics::now()` now properly works r=AfoHT a=korken89



Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
2021-04-20 17:06:08 +00:00
bors[bot]
f586c3c5a8
Merge #476
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>
2021-04-20 13:58:22 +00:00
Emil Fresk
fbcf2aabb0 Fix for default monotonic, monotonics::now() now properly works 2021-04-20 10:34:26 +02:00
Conor Patrick
bc10fe266d reclaim stack space used in init 2021-04-18 14:35:11 -07:00
bors[bot]
b8b13573ae
Merge #471
471: Force push to gh-pages branch r=korken89 a=AfoHT

As suggested in https://github.com/rtic-rs/rfcs/pull/48#issuecomment-815730654

Co-authored-by: Henrik Tjäder <henrik@grepit.se>
2021-04-13 17:30:52 +00:00
Henrik Tjäder
dc68c5f4a4 Force push to gh-pages branch 2021-04-13 19:28:55 +02:00
Emil Fresk
6aa0fb450f Goodbye static mut 2021-04-08 19:58:20 +02:00
bors[bot]
43c5ad79c2
Merge #465
465: update russian translation of the book r=korken89 a=burrbull



Co-authored-by: Andrey Zgarbul <zgarbul.andrey@gmail.com>
2021-04-08 10:58:53 +00:00
bors[bot]
82212085b3
Merge #468
468: Tiny fix of README-link r=korken89 a=AfoHT

Want to try GH-pages rebuild by GHA

Co-authored-by: Henrik Tjäder <henrik@grepit.se>
2021-04-08 10:31:41 +00:00
Henrik Tjäder
45d15d4b26 Tiny fix of README-link
Want to try GH-pages rebuild by GHA
2021-04-08 12:19:13 +02:00
bors[bot]
5346a16d09
Merge #467
467: 0.6.0-alpha.2 release r=AfoHT a=korken89



Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
2021-04-08 09:24:29 +00:00
Andrey Zgarbul
05bda2b1bd update russian translation of the book 2021-04-08 12:22:43 +03:00
Emil Fresk
cfd0c6ca26 0.6.0-alpha.2 release 2021-04-08 10:33:40 +02:00
bors[bot]
83cdf00eec
Merge #466
466: Fix for type aliases in `mod app`, UB in `spawn_at`, and `#[cfg]` in hardware tasks r=AfoHT a=korken89

Type aliases such as the following did not work in `0.6-alpha`:

```rust
use rtic::app;

#[app(device = lm3s6965, dispatchers = [SSI0])]
mod app {
    type Test = u32;

    #[task]
    fn t1(_: t1::Context, _val: Test) {}
}
```

Plus that accessing associated constants of monotonic timers was not working as it should dues to the syntax and codegen transforming:

```rust
    #[monotonic(binds = SysTick, default = true)]
    type MyMono = DwtSystick<8_000_000>; // 8 MHz
```

into

```rust
    mod MyMono {
        // ...
    }
```

causing the original `type MyMono` to not exist anymore.

This PR fixes this and adds test to check for this by doing the following expansion instead:

 ```rust
    #[monotonic(binds = SysTick, default = true)]
    type MyMono = DwtSystick<8_000_000>; // 8 MHz
```

into

```rust
    type MyMono = DwtSystick<8_000_000>;

    mod monotonics {
        mod MyMono {
            // ...
        }

        // And other monotonics go here as well
    }
```

**Breaking change**

This causes a breaking change in accessing the `MyMono::now()` method which now exists under `monotonics::MyMono::now()`.

---

Moreover a UB issue was found and fixed in `spawn_at` and hardware tasks properly propagate `#[cfg]`s.

Closes #460
Closes #462
Closes #463

Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
2021-04-08 08:15:05 +00:00
Emil Fresk
51500a1d70 Fixed UB in spawn_at 2021-04-08 10:14:14 +02:00
Emil Fresk
2068eae928 Type aliases now work in the app module 2021-04-08 09:15:38 +02:00
bors[bot]
6c8257bb73
Merge #456
456: Cancel/reschedule support for monotonics r=AfoHT a=korken89

Design document: https://hackmd.io/lhUCzrKBS-66aadO4KsSzw?view

Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
2021-04-07 12:01:18 +00:00
Emil Fresk
ae691952c3 Updated dwt-systick-monotonic 2021-04-07 11:09:21 +02:00
Emil Fresk
3adda3c766 Updated schedule example with all combinations 2021-03-22 08:24:18 +01:00
Emil Fresk
53c407017f Cancel and reschedule working
Support cfgs in the imports

Account for extern tasks
2021-03-20 08:19:56 +01:00
Emil Fresk
1087f2ee64 Added interface for cancel/reschedule
Use wrapping add for marker

No need to store handle to queue

Remove unnecessary `SpawnHandle::new`

Fix test

Updated interface to follow proposal
2021-03-13 10:50:56 +01:00
Emil Fresk
4bdc187912 Macros version 2021-03-13 10:50:45 +01:00
Emil Fresk
3c86d713a6
Merge pull request #455 from rtic-rs/macros_version
Macros version
2021-03-04 20:48:22 +01:00
Emil Fresk
47f9ffcf5e Macros version 2021-03-04 20:37:15 +01:00
bors[bot]
223f093a0e
Merge #454
454: Add periodic GHA job to run cargo audit r=korken89 a=AfoHT

With the recent generic-array issue affecting heapless it seems wise to stay up to date with the latest advisories.

Co-authored-by: Henrik Tjäder <henrik@grepit.se>
2021-03-04 19:23:17 +00:00
Henrik Tjäder
856d0ccb2f Add periodic GHA job to run cargo audit 2021-03-04 20:22:15 +01:00
bors[bot]
89a5c8004e
Merge #436
436: New monotonic r=AfoHT a=korken89

Design document: https://hackmd.io/vWa9GvssR8qBfUYgMZm0CQ

Closes #433 
Closes #432
Closes #427
Closes #426 
Closes #403
Closes #332
Closes #312 
Closes #309 
Closes #299 
Closes #292
Closes #247
Closes #219

Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
2021-03-04 19:12:35 +00:00
Emil Fresk
2e4a4ffd87 Preparing release 0.6.0-alpha.1 2021-03-04 20:00:03 +01:00
Emil Fresk
4714b8ee54
Merge pull request #450 from AfoHT/testssingleonly
Cleanup of tests, solve duplicate panic handler error
2021-03-03 09:22:45 +01:00
Henrik Tjäder
5e5fbf0ee9 Fix the UI tests, remove panic_halt 2021-03-03 09:11:24 +01:00
Henrik Tjäder
8ec505c495 Update the GHA job to run the tests test 2021-03-03 08:55:38 +01:00
Henrik Tjäder
48613f568b Update the tests file to find the tests 2021-03-03 08:55:23 +01:00
Henrik Tjäder
a5795a8f45 Remove keyword single for all tests 2021-03-03 08:55:19 +01:00
Henrik Tjäder
612efaf0c4 Use panic_semihosting for all examples 2021-03-03 08:53:03 +01:00
Emil Fresk
08a37d6d3d Updated spawn_after docs 2021-03-02 19:31:47 +01:00
Emil Fresk
3a64a3e276 Bump heapless 2021-03-02 16:30:59 +01:00
Emil Fresk
d351f55e1c Documentation generation fixes
Test fixes
2021-02-25 19:16:28 +01:00
Emil Fresk
767d46e05b Review fixes 2021-02-25 17:32:12 +01:00
Emil Fresk
70ea278f86 No need for new rtic-core 2021-02-23 21:20:21 +01:00
Emil Fresk
cd3484cbab GHA update
Fmt fixes

Spawn_after did not work with parameters

Examples working again

Revert "GHA update"

This reverts commit e0a71d4859966a6c5cf2629d3cb27e88acada9c0.

Readd flags

Only add DWT based dep with __v7 flag
2021-02-23 21:03:51 +01:00
Emil Fresk
670cdb92d3 Test output fix 2021-02-23 19:30:54 +01:00
Emil Fresk
210197d079 Remove flags, updates UI tests 2021-02-23 19:29:15 +01:00
Emil Fresk
26870ae12e Use zero time in init for spawn_after to not cause panic 2021-02-22 21:47:59 +01:00
Emil Fresk
56d99c02bd Updated to new interface 2021-02-22 20:59:23 +01:00
Emil Fresk
82d051e8e9 Added enable/disable timer calls 2021-02-22 20:59:03 +01:00
Emil Fresk
e52088bbd8 Of by 1 2021-02-22 20:15:13 +01:00
Emil Fresk
1345f30a69 Properly call on_interrupt 2021-02-21 21:57:18 +01:00