mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-16 12:55:23 +01:00
fix codegen
This commit is contained in:
parent
37a0692a0f
commit
22d758ddac
3 changed files with 26 additions and 18 deletions
|
|
@ -8,7 +8,7 @@ extern crate lm3s6965;
|
|||
extern crate panic_halt;
|
||||
extern crate rtfm;
|
||||
|
||||
use rtfm::app;
|
||||
use rtfm::{app, Exclusive};
|
||||
|
||||
#[app(device = lm3s6965)]
|
||||
const APP: () = {
|
||||
|
|
@ -59,11 +59,11 @@ const APP: () = {
|
|||
// owned by interrupt == `&mut`
|
||||
let _: &mut u32 = resources.O3;
|
||||
|
||||
// no `Mutex` when access from highest priority task
|
||||
let _: &mut u32 = resources.S1;
|
||||
// no `Mutex` proxy when access from highest priority task
|
||||
let _: Exclusive<u32> = resources.S1;
|
||||
|
||||
// no `Mutex` when co-owned by cooperative (same priority) tasks
|
||||
let _: &mut u32 = resources.S2;
|
||||
// no `Mutex` proxy when co-owned by cooperative (same priority) tasks
|
||||
let _: Exclusive<u32> = resources.S2;
|
||||
|
||||
// `&` if read-only
|
||||
let _: &u32 = resources.S3;
|
||||
|
|
@ -74,7 +74,7 @@ const APP: () = {
|
|||
// owned by interrupt == `&` if read-only
|
||||
let _: &u32 = resources.O5;
|
||||
|
||||
// no `Mutex` when co-owned by cooperative (same priority) tasks
|
||||
let _: &mut u32 = resources.S2;
|
||||
// no `Mutex` proxy when co-owned by cooperative (same priority) tasks
|
||||
let _: Exclusive<u32> = resources.S2;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ extern crate owned_singleton;
|
|||
extern crate panic_halt;
|
||||
extern crate rtfm;
|
||||
|
||||
use rtfm::app;
|
||||
use rtfm::{app, Exclusive};
|
||||
|
||||
#[app(device = lm3s6965)]
|
||||
const APP: () = {
|
||||
|
|
@ -27,7 +27,7 @@ const APP: () = {
|
|||
#[Singleton]
|
||||
static mut S1: u32 = 0;
|
||||
#[Singleton]
|
||||
static mut S2: u32 = 0;
|
||||
static S2: u32 = 0;
|
||||
|
||||
#[init(resources = [O1, O2, O3, O4, O5, O6, S1, S2])]
|
||||
fn init() {
|
||||
|
|
@ -55,13 +55,13 @@ const APP: () = {
|
|||
let _: &mut O3 = resources.O3;
|
||||
let _: &O6 = resources.O6;
|
||||
|
||||
let _: &mut S1 = resources.S1;
|
||||
let _: Exclusive<S1> = resources.S1;
|
||||
let _: &S2 = resources.S2;
|
||||
}
|
||||
|
||||
#[interrupt(resources = [S1, S2])]
|
||||
fn UART1() {
|
||||
let _: &mut S1 = resources.S1;
|
||||
let _: Exclusive<S1> = resources.S1;
|
||||
let _: &S2 = resources.S2;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue