Commit graph

1165 commits

Author SHA1 Message Date
bors[bot]
13dc3992e6
Merge #492
492: Fix syntax error in migration guide r=korken89 a=newAM

Minor problem with a minor fix.

Co-authored-by: Alex Martens <alexmgit@protonmail.com>
2021-07-02 05:13:09 +00:00
Alex Martens
1beeebd797 Fix syntax error in migration guide 2021-07-01 17:09:07 -07:00
bors[bot]
f0273d1c0f
Merge #491
491: Fix small typo in readme r=korken89 a=vladinator1000



Co-authored-by: Vlady Veselinov <vladkodmc@gmail.com>
2021-06-28 19:20:33 +00:00
Vlady Veselinov
f21af4607f
Fix small typo in readme 2021-06-28 18:38:33 +01:00
bors[bot]
9bea30b5a8
Merge #489
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>
2021-06-07 21:28:02 +00:00
James Hillyerd
87c958da3b assert empty 2021-06-06 15:00:52 -07:00
James Hillyerd
064ff239f3 Allow zero sized LinkedList 2021-06-06 14:56:00 -07:00
bors[bot]
3fd3eea941
Merge #486
486: Fixed changelog r=korken89 a=korken89



Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
2021-05-28 09:03:54 +00:00
Emil Fresk
e8676daeb9 Fixed changelog 2021-05-28 09:07:21 +02:00
bors[bot]
0b0bb1bfa9
Merge #485
485: New codegen structure to eliminate issues with paths r=korken89 a=korken89



Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
2021-05-27 16:18:46 +00:00
Emil Fresk
c17348d290 Prepare release alpha.4 2021-05-27 18:10:24 +02:00
Emil Fresk
6155f1366a Minor cleanup 2021-05-23 14:11:51 +02:00
Emil Fresk
b4509bdbfe Flattened the _ out of it 2021-05-06 19:40:37 +02:00
bors[bot]
aad8f81991
Merge #469
469: Goodbye static mut r=AfoHT a=korken89

Squashed and updated version of @perlindgren branch.

In release there are 0 bytes difference for all examples 🎉 
For debug we see a bloat of ~1-2% worst case, commonly less.

Complete diff of sizes for all examples (first is goodbye static mut, second is master):

```

<   27220	      0	     28	  27248	   6a70	spawn
---
>   27092	      0	     28	  27120	   69f0	spawn

<   16916	      0	     44	  16960	   4240	late
---
>   16836	      0	     44	  16880	   41f0	late

<   15952	      0	     12	  15964	   3e5c	type-usage
---
>   15872	      0	     12	  15884	   3e0c	type-usage

<   22068	      0	     44	  22112	   5660	cfg
---
>   21812	      0	     44	  21856	   5560	cfg

<   34784	      0	     40	  34824	   8808	periodic
---
>   34496	      0	     40	  34536	   86e8	periodic

<   22308	      0	     32	  22340	   5744	task
---
>   21972	      0	     32	  22004	   55f4	task

<   15076	      8	     24	  15108	   3b04	task-local
---
>   14980	      8	     24	  15012	   3aa4	task-local

<   12884	      0	     24	  12908	   326c	destructure
---
>   12820	      0	     24	  12844	   322c	destructure

<   10128	      0	     16	  10144	   27a0	init
---
>   10112	      0	     16	  10128	   2790	init

<   19044	      0	     20	  19064	   4a78	task_named_main
---
>   18916	      0	     20	  18936	   49f8	task_named_main

<   27252	      0	     28	  27280	   6a90	extern_spawn
---
>   27124	      0	     28	  27152	   6a10	extern_spawn

<   10176	      0	     16	  10192	   27d0	idle
---
>   10160	      0	     16	  10176	   27c0	idle

<   13972	      0	     16	  13988	   36a4	resource
---
>   13940	      0	     16	  13956	   3684	resource

<   16228	      0	     24	  16252	   3f7c	multilock
---
>   16116	      0	     24	  16140	   3f0c	multilock

<   14660	      0	     16	  14676	   3954	lock
---
>   14628	      0	     16	  14644	   3934	lock

<   10416	      0	     16	  10432	   28c0	task-local-minimal
---
>   10400	      0	     16	  10416	   28b0	task-local-minimal

<   14164	      0	     24	  14188	   376c	generics
---
>   14148	      0	     24	  14172	   375c	generics

<   30644	      0	     48	  30692	   77e4	message
---
>   30308	      0	     48	  30356	   7694	message

<   28964	      0	     36	  29000	   7148	spawn2
---
>   28724	      0	     36	  28760	   7058	spawn2

<   15952	      0	      8	  15960	   3e58	t-schedule-core-stable
---
>   15872	      0	      8	  15880	   3e08	t-schedule-core-stable

<   17408	      0	     20	  17428	   4414	t-cfg
---
>   17248	      0	     20	  17268	   4374	t-cfg

<   12948	      0	     16	  12964	   32a4	hardware
---
>   12932	      0	     16	  12948	   3294	hardware

<   54640	      0	    104	  54744	   d5d8	t-schedule
---
>   53696	      0	    104	  53800	   d228	t-schedule

<   26132	      0	    548	  26680	   6838	pool
---
>   25876	      0	    548	  26424	   6738	pool

<   22372	      0	     56	  22428	   579c	cfg-whole-task
---
>   22100	      0	     56	  22156	   568c	cfg-whole-task

<   38292	      0	     76	  38368	   95e0	schedule
---
>   37828	      0	     76	  37904	   9410	schedule

<   21216	      0	     32	  21248	   5300	t-spawn
---
>   20880	      0	     32	  20912	   51b0	t-spawn

<   22820	      0	     56	  22876	   595c	capacity
---
>   22580	      0	     56	  22636	   586c	capacity

<   17060	      0	     48	  17108	   42d4	static
---
>   16980	      0	     48	  17028	   4284	static

<   20288	      0	     24	  20312	   4f58	ramfunc
---
>   20096	      0	     24	  20120	   4e98	ramfunc

<   11760	      0	     20	  11780	   2e04	t-resource
---
>   11664	      0	     20	  11684	   2da4	t-resource

<   13028	      0	     16	  13044	   32f4	only-shared-access
---
>   13012	      0	     16	  13028	   32e4	only-shared-access

<   16576	      0	     16	  16592	   40d0	not-sync
---
>   16432	      0	     16	  16448	   4040	not-sync

<   13892	      0	     16	  13908	   3654	resource-user-struct
---
>   13860	      0	     16	  13876	   3634	resource-user-struct

<   37472	      0	     64	  37536	   92a0	double_schedule
---
>   36960	      0	     64	  37024	   90a0	double_schedule

<   17648	      0	      8	  17656	   44f8	t-stask-main
---
>   17520	      0	      8	  17528	   4478	t-stask-main

<    8816	      0	      4	   8820	   2274	t-late-not-send
---
>    8800	      0	      4	   8804	   2264	t-late-not-send

<   23280	      0	     32	  23312	   5b10	types
---
>   23120	      0	     32	  23152	   5a70	types
```

Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
2021-04-22 16:42:45 +00:00
Emil Fresk
50f26e78ed Keep comments 2021-04-22 18:38:42 +02:00
bors[bot]
a320cacb29
Merge #481
481: use super::xx now works with monotonics r=AfoHT a=korken89



Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
2021-04-22 15:54:17 +00:00
Emil Fresk
6fc7b96474 use super::xx now works with monotonics 2021-04-22 17:39:07 +02:00
bors[bot]
e6a22aa48e
Merge #479
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>
2021-04-22 13:05:43 +00:00
bors[bot]
fecbe85381
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>
2021-04-22 12:57:54 +00:00
Viktor Sonesten
1d5f129544 book/migration/v5: update init signature, fix example syntax
The example now migrates from v5 to v6 instead of an incorrect v6 syntax
to a another incorrect v6 syntax.
2021-04-21 15:38:00 +02:00
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