365: Regression in master on double schedule example r=AfoHT a=korken89



Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
This commit is contained in:
bors[bot] 2020-09-25 12:56:46 +00:00 committed by GitHub
commit 4d61437bb4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 0 deletions

View file

@ -50,6 +50,10 @@ required-features = ["__v7"]
name = "types" name = "types"
required-features = ["__v7"] required-features = ["__v7"]
[[example]]
name = "double_schedule"
required-features = ["__v7"]
[dependencies] [dependencies]
cortex-m = "0.6.2" cortex-m = "0.6.2"
cortex-m-rtic-macros = { path = "macros", version = "0.5.2" } cortex-m-rtic-macros = { path = "macros", version = "0.5.2" }

View file

@ -0,0 +1,37 @@
//! examples/double_schedule.rs
#![deny(unsafe_code)]
#![deny(warnings)]
#![no_main]
#![no_std]
use panic_semihosting as _;
use rtic::cyccnt::U32Ext;
#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)]
const APP: () = {
struct Resources {
nothing: (),
}
#[init(spawn = [task1])]
fn init(cx: init::Context) -> init::LateResources {
cx.spawn.task1().ok();
init::LateResources { nothing: () }
}
#[task(schedule = [task2])]
fn task1(_cx: task1::Context) {
_cx.schedule.task2(_cx.scheduled + 100.cycles()).ok();
}
#[task(schedule = [task1])]
fn task2(_cx: task2::Context) {
_cx.schedule.task1(_cx.scheduled + 100.cycles()).ok();
}
extern "C" {
fn SSI0();
}
};