aboutsummaryrefslogtreecommitdiff
path: root/mc/examples/x-spawn.rs
diff options
context:
space:
mode:
Diffstat (limited to 'mc/examples/x-spawn.rs')
-rw-r--r--mc/examples/x-spawn.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/mc/examples/x-spawn.rs b/mc/examples/x-spawn.rs
new file mode 100644
index 00000000..749918fd
--- /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();
+ }
+};