358: Fixed so examples do not crash in release mode r=AfoHT a=korken89

Fixes #357 

Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
This commit is contained in:
bors[bot] 2020-09-15 12:16:05 +00:00 committed by GitHub
commit 7ebdc37683
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 39 additions and 13 deletions

View file

@ -27,7 +27,9 @@ const APP: () = {
debug::exit(debug::EXIT_SUCCESS);
loop {}
loop {
cortex_m::asm::nop();
}
}
#[task(binds = UART0)]

View file

@ -28,7 +28,9 @@ const APP: () = {
fn idle(_: idle::Context) -> ! {
debug::exit(debug::EXIT_SUCCESS);
loop {}
loop {
cortex_m::asm::nop();
}
}
#[task(capacity = 2, resources = [count], spawn = [log])]

View file

@ -30,7 +30,9 @@ const APP: () = {
debug::exit(debug::EXIT_SUCCESS);
loop {}
loop {
cortex_m::asm::nop();
}
}
#[task(binds = UART0)]

View file

@ -26,6 +26,8 @@ const APP: () = {
debug::exit(debug::EXIT_SUCCESS);
loop {}
loop {
cortex_m::asm::nop();
}
}
};

View file

@ -31,7 +31,9 @@ const APP: () = {
// error: no `resources` field in `idle::Context`
// _cx.resources.shared += 1;
loop {}
loop {
cortex_m::asm::nop();
}
}
// `shared` can be accessed from this context

View file

@ -31,6 +31,8 @@ const APP: () = {
#[idle]
fn idle(_cx: idle::Context) -> ! {
loop {}
loop {
cortex_m::asm::nop();
}
}
};

View file

@ -24,7 +24,9 @@ const APP: () = {
#[cfg(never)]
static mut BAR: u32 = 0;
loop {}
loop {
cortex_m::asm::nop();
}
}
#[task(resources = [foo], schedule = [quux], spawn = [quux])]

View file

@ -14,6 +14,8 @@ const APP: () = {
#[idle]
fn main(_: main::Context) -> ! {
debug::exit(debug::EXIT_SUCCESS);
loop {}
loop {
cortex_m::asm::nop();
}
}
};

View file

@ -31,6 +31,8 @@ const APP: () = {
#[idle(resources = [x, y])]
fn idle(_: idle::Context) -> ! {
loop {}
loop {
cortex_m::asm::nop();
}
}
};

View file

@ -58,7 +58,9 @@ const APP: () = {
// `&` if read-only
let _: &u32 = c.resources.s3;
loop {}
loop {
cortex_m::asm::nop();
}
}
#[task(binds = UART0, resources = [o3, s1, s2, &s3])]

View file

@ -23,7 +23,9 @@ const APP: () = {
let _: Result<(), u32> = c.schedule.bar(Instant::now() + 50.cycles(), 0);
let _: Result<(), (u32, u32)> = c.schedule.baz(Instant::now() + 60.cycles(), 0, 1);
loop {}
loop {
cortex_m::asm::nop();
}
}
#[task(binds = SVCall, schedule = [foo, bar, baz])]

View file

@ -22,7 +22,9 @@ const APP: () = {
let _: Result<(), u32> = c.spawn.bar(0);
let _: Result<(), (u32, u32)> = c.spawn.baz(0, 1);
loop {}
loop {
cortex_m::asm::nop();
}
}
#[task(binds = SVCall, spawn = [foo, bar, baz])]

View file

@ -32,7 +32,9 @@ const APP: () = {
let _: idle::Schedule = cx.schedule;
let _: idle::Spawn = cx.spawn;
loop {}
loop {
cortex_m::asm::nop();
}
}
#[task(binds = UART0, resources = [shared], schedule = [foo], spawn = [foo])]