Commit graph

1679 commits

Author SHA1 Message Date
Henrik Tjäder
95a020c8af Fixup app/new 2020-11-12 17:45:12 +00:00
Emil Fresk
d25017a59c Fixed spawn and timer queue docs 2020-11-12 18:42:07 +01:00
bors[bot]
5b8b2383e1
Merge #405 #406
405: Updated migration guide with symmetric locks and new spawn r=AfoHT a=korken89



406: book.toml/by-example/app r=korken89 a=perlindgren

Book update

Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
Co-authored-by: Per Lindgren <per.lindgren@ltu.se>
2020-11-12 17:24:44 +00:00
bors[bot]
b4ca29f69c
Merge #404
404: Fixup app/tips r=korken89 a=AfoHT



Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
2020-11-12 17:20:36 +00:00
Per Lindgren
91ea1e428b book.toml/by-example/app 2020-11-12 18:20:16 +01:00
Emil Fresk
5e3bbada63 Updated migration guide with symmetric locks and new spawn 2020-11-12 18:19:00 +01:00
Henrik Tjäder
1709d1c9c6 Fixup app/tips 2020-11-12 17:15:33 +00:00
bors[bot]
ad50b54530
Merge #402
402: Extern task r=AfoHT a=perlindgren

Allows hardware and software task to be externally declared.

CI test, don't merge yet (squash needed).

Co-authored-by: Per Lindgren <per.lindgren@ltu.se>
2020-10-29 18:34:35 +00:00
Per Lindgren
96cd625223 extern task 2020-10-29 19:29:46 +01: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
bors[bot]
ee0885063d
Merge #394
394: Detect if the rt flag is defined in the PAC/HAL r=AfoHT a=korken89

This stops RTIC applications from compiling if one has forgotten to set the `rt` flag in the PAC/HAL.

The error:

```
error[E0433]: failed to resolve: could not find `interrupt` in `you_must_enable_the_rt_feature_for_the_pac_in_your_cargo_toml`
 --> src/main.rs:8:1
  |
8 | #[rtic::app(device = stm32l4xx_hal::pac)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ could not find `interrupt` in `you_must_enable_the_rt_feature_for_the_pac_in_your_cargo_toml`
  |
  = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
```

Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
2020-10-15 14:15:35 +00:00
Emil Fresk
48abc26e85 Detect if the rt flag is defined in the PAC/HAL
Better error message

Improved error string

Update UI tests
2020-10-15 16:06:30 +02:00
bors[bot]
1db5faad62
Merge #392
392: device path must be absolute; clarify r=AfoHT a=dcarosone

feel free to nitpick path terminology

Co-authored-by: Daniel Carosone <Daniel.Carosone@gmail.com>
2020-10-13 13:14:03 +00:00
Daniel Carosone
efe6b516fb device path must be absolute; clarify 2020-10-13 10:45:03 +11:00
bors[bot]
b8665a2f31
Merge #388
388: Now core contains the same `Peripherals` type based on monotonic r=AfoHT a=korken89



Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
2020-10-12 08:31:18 +00:00
Emil Fresk
1fb42536cf UI fix 2020-10-12 10:25:02 +02:00
Emil Fresk
5b8e6a22ab Fixing examples and tests, modules now import user imports correctly
Fmt

Correct syntax crate

UI test fix

Fix build script

Cleanup

More cleanup
2020-10-11 20:35:50 +02:00
Emil Fresk
524273c96a Now with spawn/schedule from anywhere 2020-10-11 18:38:38 +02:00
Emil Fresk
c83b15b643 Merge branch 'master' into spawn_experiment 2020-10-08 17:33:42 +02:00