aboutsummaryrefslogtreecommitdiff
path: root/examples/task-local-minimal.rs
diff options
context:
space:
mode:
authorGravatar Per Lindgren <per.lindgren@ltu.se> 2021-03-12 01:30:20 +0100
committerGravatar Per Lindgren <per.lindgren@ltu.se> 2021-03-12 01:30:20 +0100
commit37530fd687cad35a66eab75a36e660743ba9c4f9 (patch)
treecbc0fe2edadbb8c77ea3263d9b0dc8c7d963bd4d /examples/task-local-minimal.rs
parent4b370c3d602a1e43d0bc4f1c8deff629e838c784 (diff)
downloadrtic-37530fd687cad35a66eab75a36e660743ba9c4f9.tar.gz
rtic-37530fd687cad35a66eab75a36e660743ba9c4f9.tar.zst
rtic-37530fd687cad35a66eab75a36e660743ba9c4f9.zip
task local early now with RacyCell
Diffstat (limited to '')
-rw-r--r--examples/task-local-minimal.rs34
1 files changed, 0 insertions, 34 deletions
diff --git a/examples/task-local-minimal.rs b/examples/task-local-minimal.rs
deleted file mode 100644
index 29132f00..00000000
--- a/examples/task-local-minimal.rs
+++ /dev/null
@@ -1,34 +0,0 @@
-//! examples/task-local_minimal.rs
-#![deny(unsafe_code)]
-//#![deny(warnings)]
-#![no_main]
-#![no_std]
-
-use panic_semihosting as _;
-
-#[rtic::app(device = lm3s6965)]
-mod app {
- use cortex_m_semihosting::{debug, hprintln};
-
- #[resources]
- struct Resources {
- // A local (move), late resource
- #[task_local]
- task_local: u32,
- }
-
- #[init]
- fn init(_: init::Context) -> (init::LateResources, init::Monotonics) {
- (init::LateResources { task_local: 42 }, init::Monotonics())
- }
-
- // task_local is task_local
- #[idle(resources =[task_local])]
- fn idle(cx: idle::Context) -> ! {
- hprintln!("IDLE:l = {}", cx.resources.task_local).unwrap();
- debug::exit(debug::EXIT_SUCCESS);
- loop {
- cortex_m::asm::nop();
- }
- }
-}