diff options
author | 2021-03-10 15:37:11 +0100 | |
---|---|---|
committer | 2021-03-10 15:37:11 +0100 | |
commit | db1574bf6b978bfac19efae6ad77fe01511492db (patch) | |
tree | 96b5d7892538b4f2cbf6de7c221ca4d78ac71faf /examples/minimal_late_resource.rs | |
parent | 3c86d713a6f8fdb052de80380a17468090e42624 (diff) | |
download | rtic-db1574bf6b978bfac19efae6ad77fe01511492db.tar.gz rtic-db1574bf6b978bfac19efae6ad77fe01511492db.tar.zst rtic-db1574bf6b978bfac19efae6ad77fe01511492db.zip |
goodby static mut, welcome back to UnsafeCell
Diffstat (limited to 'examples/minimal_late_resource.rs')
-rw-r--r-- | examples/minimal_late_resource.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/examples/minimal_late_resource.rs b/examples/minimal_late_resource.rs new file mode 100644 index 00000000..2419b8d7 --- /dev/null +++ b/examples/minimal_late_resource.rs @@ -0,0 +1,29 @@ +//! examples/minimal_late_resource.rs + +#![deny(unsafe_code)] +#![deny(warnings)] +#![no_main] +#![no_std] + +use panic_semihosting as _; + +#[rtic::app(device = lm3s6965)] +mod app { + + #[resources] + struct Resources { + resource_x: u32, + } + + #[init] + fn init(_: init::Context) -> (init::LateResources, init::Monotonics) { + (init::LateResources { resource_x: 0 }, init::Monotonics {}) + } + + #[idle(resources = [resource_x])] + fn idle(_: idle::Context) -> ! { + loop { + cortex_m::asm::nop(); + } + } +} |