From 81275bfa4f41e2066770087f3a33cad4227eab41 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 13 Jun 2019 23:56:59 +0200 Subject: rtfm-syntax refactor + heterogeneous multi-core support --- mc/examples/x-spawn.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 mc/examples/x-spawn.rs (limited to 'mc/examples/x-spawn.rs') diff --git a/mc/examples/x-spawn.rs b/mc/examples/x-spawn.rs new file mode 100644 index 0000000..749918f --- /dev/null +++ b/mc/examples/x-spawn.rs @@ -0,0 +1,20 @@ +#![no_main] +#![no_std] + +use panic_halt as _; + +#[rtfm::app(cores = 2, device = mc)] +const APP: () = { + #[init(core = 0, spawn = [foo])] + fn init(c: init::Context) { + c.spawn.foo().ok(); + } + + #[task(core = 1)] + fn foo(_: foo::Context) {} + + extern "C" { + #[core = 1] + fn I0(); + } +}; -- cgit v1.2.3