aboutsummaryrefslogtreecommitdiff
path: root/examples/zero-prio-task.rs
diff options
context:
space:
mode:
authorEmil Fresk <emil.fresk@gmail.com>2023-01-23 20:05:47 +0100
committerHenrik Tjäder <henrik@tjaders.com>2023-03-01 00:33:31 +0100
commit306aa47170fd59369b7a184924e287dc3706d64d (patch)
tree75a331a63a4021f078e330bf2ce4edb1228e2ecf /examples/zero-prio-task.rs
parentb8b881f446a226d6f3c4a7db7c9174590b47dbf6 (diff)
Add rtic-timer (timerqueue + monotonic) and rtic-monotonics (systick-monotonic)
Diffstat (limited to 'examples/zero-prio-task.rs')
-rw-r--r--examples/zero-prio-task.rs60
1 files changed, 0 insertions, 60 deletions
diff --git a/examples/zero-prio-task.rs b/examples/zero-prio-task.rs
deleted file mode 100644
index c810e8f..0000000
--- a/examples/zero-prio-task.rs
+++ /dev/null
@@ -1,60 +0,0 @@
-//! examples/zero-prio-task.rs
-
-#![no_main]
-#![no_std]
-#![feature(type_alias_impl_trait)]
-#![deny(missing_docs)]
-
-use core::marker::PhantomData;
-use panic_semihosting as _;
-
-/// Does not impl send
-pub struct NotSend {
- _0: PhantomData<*const ()>,
-}
-
-#[rtic::app(device = lm3s6965, peripherals = true)]
-mod app {
- use super::NotSend;
- use core::marker::PhantomData;
- use cortex_m_semihosting::{debug, hprintln};
-
- #[shared]
- struct Shared {
- x: NotSend,
- }
-
- #[local]
- struct Local {
- y: NotSend,
- }
-
- #[init]
- fn init(_cx: init::Context) -> (Shared, Local) {
- hprintln!("init");
-
- async_task::spawn().unwrap();
- async_task2::spawn().unwrap();
-
- (
- Shared {
- x: NotSend { _0: PhantomData },
- },
- Local {
- y: NotSend { _0: PhantomData },
- },
- )
- }
-
- #[task(priority = 0, shared = [x], local = [y])]
- async fn async_task(_: async_task::Context) {
- hprintln!("hello from async");
- }
-
- #[task(priority = 0, shared = [x])]
- async fn async_task2(_: async_task2::Context) {
- hprintln!("hello from async2");
-
- debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator
- }
-}