From 72ba18b0e84eab9dc20d75a5075ba239464d8bdb Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Thu, 24 Sep 2020 20:56:49 +0200 Subject: [PATCH 1/2] Regression in master on double schedule --- examples/double_schedule.rs | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 examples/double_schedule.rs diff --git a/examples/double_schedule.rs b/examples/double_schedule.rs new file mode 100644 index 0000000000..a1d6914b0b --- /dev/null +++ b/examples/double_schedule.rs @@ -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(); + } +}; From 7ff35bd0419eb470440527fd0bb81ee16ed46a9d Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Fri, 25 Sep 2020 14:52:09 +0200 Subject: [PATCH 2/2] Fixed example and v7 flag --- Cargo.toml | 4 ++++ examples/double_schedule.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index f7567a1018..d4ad4ef05e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,6 +50,10 @@ required-features = ["__v7"] name = "types" required-features = ["__v7"] +[[example]] +name = "double_schedule" +required-features = ["__v7"] + [dependencies] cortex-m = "0.6.2" cortex-m-rtic-macros = { path = "macros", version = "0.5.2" } diff --git a/examples/double_schedule.rs b/examples/double_schedule.rs index a1d6914b0b..6b3aec8fcd 100644 --- a/examples/double_schedule.rs +++ b/examples/double_schedule.rs @@ -16,7 +16,7 @@ const APP: () = { #[init(spawn = [task1])] fn init(cx: init::Context) -> init::LateResources { - // cx.spawn.task1().ok(); + cx.spawn.task1().ok(); init::LateResources { nothing: () } }