Commit graph

738 commits

Author SHA1 Message Date
Per Lindgren
72f78ce4db now with codegen 2020-10-27 01:54:47 +01:00
Per Lindgren
b163e3ec27 library src 2020-10-26 22:06:26 +01:00
Per Lindgren
1e26a536cd now uses the async_await syntax 2020-10-26 20:13:20 +01:00
Per Lindgren
36c17931e9 now uses the async_await syntax 2020-10-26 17:47:55 +01:00
Per Lindgren
5b1c0dbb0a async_util 2020-10-26 17:16:51 +01:00
Per Lindgren
5df1f59f47 queue, async_systic2 2020-10-26 15:56:25 +01:00
Per Lindgren
28490f5caa queue, async_systic2 2020-10-26 15:50:10 +01:00
Per Lindgren
809d3ba269 wip, async_systic2 2020-10-26 14:39:38 +01:00
Per Lindgren
0751161648 timer as future 2020-10-26 11:01:47 +01:00
Per Lindgren
d7ca3efd03 timer as future 2020-10-26 10:58:17 +01:00
Per Lindgren
22d7957485 wip 2020-10-25 23:50:37 +01:00
Per Lindgren
0b29e6da87 transmute fix 2020-10-25 22:50:38 +01:00
Per Lindgren
41b84b9166 broken 2020-10-25 22:32:51 +01:00
Per Lindgren
524c2574f2 fix typo 2020-10-25 16:16:17 +01:00
Per Lindgren
6f67d3a933 ci fix 2020-10-24 20:21:52 +02:00
Per Lindgren
12d2fa5fd3 updated docs and examples 2020-10-24 20:05:15 +02:00
Per Lindgren
c7e6385234 extern examples added 2020-10-24 19:47:38 +02:00
Per Lindgren
0f8e173614 extern examples added 2020-10-24 19:38:49 +02:00
bors[bot]
d11b2ddd35
Merge #401
401: Updating the changelog r=perlindgren a=AfoHT

Better late than never...

Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
2020-10-23 22:38:18 +00:00
Henrik Tjäder
1b99ca6b10 Updating the changelog 2020-10-23 22:19:12 +00:00
bors[bot]
4f4c95be40
Merge #400
400: codegen and examples r=AfoHT a=perlindgren

just a test

Co-authored-by: Per Lindgren <per.lindgren@ltu.se>
2020-10-23 22:03:08 +00:00
Per Lindgren
1c244a995d move dispatchers to app argument 2020-10-23 23:58:09 +02:00
bors[bot]
bbcae14e37
Merge #399
399: Now all locks are symmetric r=AfoHT a=korken89



Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
2020-10-23 20:52:58 +00:00
Emil Fresk
e8eca4be37 Now all locks are symmetric
Test fixes

Fix test

Fix comment
2020-10-23 08:38:18 +02:00
bors[bot]
b3aa9e99a9
Merge #398
398: Add the cfgs on a task to the module for that task r=korken89 a=AfoHT

Applying a `#[cfg(never)]` on a task:

before:

```
#[allow(non_snake_case)]
#[doc = "Software task"]
pub mod foo2 {
    #[doc(inline)]
    pub use super::foo2Resources as Resources;
    #[doc = r" Execution context"]
    pub struct Context<'a> {
        #[doc = r" Resources this task has access to"]
        pub resources: Resources<'a>,
    }
    impl<'a> Context<'a> {
        #[inline(always)]
        pub unsafe fn new(priority: &'a rtic::export::Priority) -> Self {
            Context {
                resources: Resources::new(priority),
            }
        }
    }
      <...>
```

After:

```
#[allow(non_snake_case)]
#[cfg(never)]
#[doc = "Software task"]
pub mod foo2 {
    #[doc(inline)]
    pub use super::foo2Resources as Resources;
    #[doc = r" Execution context"]
    pub struct Context<'a> {
        #[doc = r" Resources this task has access to"]
        pub resources: Resources<'a>,
    }
    impl<'a> Context<'a> {
        #[inline(always)]
        pub unsafe fn new(priority: &'a rtic::export::Priority) -> Self {
            Context {
                resources: Resources::new(priority),
            }
        }
    }
    <...>
```


Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
2020-10-22 17:11:21 +00:00
Henrik Tjäder
86699039e9 Add the cfgs on a task to the module for that task 2020-10-22 17:04:34 +00:00
bors[bot]
9fb5a223cb
Merge #396
396: Fix namespaces r=AfoHT a=korken89



Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
2020-10-22 16:48:56 +00:00
Emil Fresk
17e976ab49 Fix UI tests
Fix
2020-10-22 17:45:06 +02:00
Emil Fresk
d2ac641c3f Hide lock type better to not collide with user types 2020-10-21 20:25:22 +02:00
Emil Fresk
f076b33bb9 Namespace cleanup 2020-10-21 20:25:13 +02:00
Emil Fresk
f96b25fdf2 Updated examples
More work
2020-10-21 20:25:05 +02:00
bors[bot]
6de4f1a797
Merge #397
397: Use latest GHA mdBook action r=korken89 a=AfoHT



Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
2020-10-15 18:00:24 +00:00
Henrik Tjäder
484fce9329 Use latest GHA mdBook action 2020-10-15 17:15:06 +00:00
bors[bot]
8b53b9d10c
Merge #393
393: Implement all clippy suggestions r=korken89 a=AfoHT



Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
2020-10-15 17:13:37 +00:00
Henrik Tjäder
21253297e4 Implement all clippy suggestions 2020-10-15 17:09:27 +00:00
bors[bot]
355cb82d06
Merge #390
390: Spawn and schedule from anywhere r=AfoHT a=korken89

This PR moves RTIC to the spawn and schedule from anywhere syntax.

Notable changes:
 * We do no longer support non-`Send` types.
 * Some extra code is generated as any task may spawn/schedule any task. However Rust/LLVM does a great job optimizing away non used instantiations (no real code-size difference observed).
 * Worst case priority inversion has increased, but it is now predictable.

Upsides:
 * With this we should be able to support async/await.
 * RTIC tasks can now be callbacks (spawned and scheduled).
 * RTIC tasks can be stored.

Needs the following PR to land first: https://github.com/rtic-rs/rtic-syntax/pull/34

The following now works:

```rust
#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)]
mod app {
    #[init]
    fn init(mut cx: init::Context) -> init::LateResources {
        // Init stuff...

        // New spawn syntax
        foo::spawn().unwrap();

        // New schedule syntax
        bar::schedule(now + 4_000_000.cycles()).unwrap();

        init::LateResources {}
    }

    #[task]
    fn foo(_: foo::Context) {}

    #[task]
    fn bar(_: bar::Context) {}

    extern "C" {
        fn SSI0();
    }
}

```

Co-authored-by: Per Lindgren <per.lindgren@ltu.se>
Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
2020-10-15 16:42:30 +00:00
Emil Fresk
6808cc7cdf Merge branch 'master' into spawn_experiment 2020-10-15 18:27:48 +02:00
Emil Fresk
c5b5ea60e8 Use master branch on syntax 2020-10-15 18:12:39 +02:00
Emil Fresk
b5779d834e Fix comments in examples 2020-10-15 18:06:03 +02:00
bors[bot]
f9303cef1c
Merge #395
395: Made relation between priority and number explicit r=korken89 a=diondokter

When quickly reading through the priorities chapter, I couldn't find in which order the priorities were, so I assumed it was the same as in the hardware.
In the cortex-m hardware, interrupts with the **lower** priority number will preempt the other interrupts.
RTIC does the reverse, so I think it's good to be more explicit about it.

Co-authored-by: Dion Dokter <diondokter@gmail.com>
2020-10-15 16:05:45 +00:00
bors[bot]
1cda9eaecc
Merge #371
371: task_local and lock_free r=korken89 a=AfoHT

Getting this going to test with GHA

For further discussion see https://github.com/rtic-rs/rfcs/issues/30

Co-authored-by: Per <Per Lindgren>
Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
2020-10-15 16:01:07 +00:00
Emil Fresk
da76894d75 Updated syntax crate 2020-10-15 17:56:29 +02:00
Henrik Tjäder
37ee3a47af Create Enum containing all tasks 2020-10-15 15:56:20 +00:00
Henrik Tjäder
6c1f4a7b5d Changed branch for rtic-syntax 2020-10-15 15:56:20 +00:00
Henrik Tjäder
e2364aae3e Updated examples and rtic-name 2020-10-15 15:56:20 +00:00
Henrik Tjäder
b29a0c1348 Add example with features on all resources combined with lock_free and task_local 2020-10-15 15:56:20 +00:00
Henrik Tjäder
d4439fe73b Print module name and priority 2020-10-15 15:56:20 +00:00
Per
6eafcf10e9 task_local and lock_free analysis (take 1) 2020-10-15 15:56:20 +00:00
Emil Fresk
5ac16f6aae Merge branch 'master' into spawn_experiment 2020-10-15 17:55:00 +02:00
Dion Dokter
7a57f16860
Made relation between priority and number explicit
When quickly reading through the priorities chapter, I couldn't find in which order the priorities were, so I assumed it was the same as in the hardware.
In the cortex-m hardware, interrupts with the **lower** priority number will preempt the other interrupts.
RTIC does the reverse, so I think it's good to be more explicit about it.
2020-10-15 17:45:34 +02:00