aboutsummaryrefslogtreecommitdiff
path: root/embassy-cortex-m
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2022-07-29 21:58:35 +0200
committerDario Nieuwenhuis <[email protected]>2022-07-29 23:40:36 +0200
commita0f1b0ee01d461607660d2d56b5b1bdc57e0d3fb (patch)
treee60fc8f8db8ec07e55d655c1a830b07f4db0b7d2 /embassy-cortex-m
parent8745d646f0976791b7098456aa61adb983fb1c18 (diff)
Split embassy crate into embassy-executor, embassy-util.
Diffstat (limited to 'embassy-cortex-m')
-rw-r--r--embassy-cortex-m/Cargo.toml3
-rw-r--r--embassy-cortex-m/src/executor.rs8
2 files changed, 6 insertions, 5 deletions
diff --git a/embassy-cortex-m/Cargo.toml b/embassy-cortex-m/Cargo.toml
index 9dbec0462..454f34e0b 100644
--- a/embassy-cortex-m/Cargo.toml
+++ b/embassy-cortex-m/Cargo.toml
@@ -35,7 +35,8 @@ prio-bits-8 = []
35defmt = { version = "0.3", optional = true } 35defmt = { version = "0.3", optional = true }
36log = { version = "0.4.14", optional = true } 36log = { version = "0.4.14", optional = true }
37 37
38embassy = { version = "0.1.0", path = "../embassy"} 38embassy-util = { version = "0.1.0", path = "../embassy-util" }
39embassy-executor = { version = "0.1.0", path = "../embassy-executor"}
39embassy-macros = { version = "0.1.0", path = "../embassy-macros"} 40embassy-macros = { version = "0.1.0", path = "../embassy-macros"}
40embassy-hal-common = { version = "0.1.0", path = "../embassy-hal-common"} 41embassy-hal-common = { version = "0.1.0", path = "../embassy-hal-common"}
41atomic-polyfill = "0.1.5" 42atomic-polyfill = "0.1.5"
diff --git a/embassy-cortex-m/src/executor.rs b/embassy-cortex-m/src/executor.rs
index 17ccf0e81..4a3fa9903 100644
--- a/embassy-cortex-m/src/executor.rs
+++ b/embassy-cortex-m/src/executor.rs
@@ -1,7 +1,7 @@
1//! Executor specific to cortex-m devices. 1//! Executor specific to cortex-m devices.
2use core::marker::PhantomData; 2use core::marker::PhantomData;
3 3
4pub use embassy::executor::*; 4pub use embassy_executor::executor::*;
5 5
6use crate::interrupt::{Interrupt, InterruptExt}; 6use crate::interrupt::{Interrupt, InterruptExt};
7 7
@@ -60,18 +60,18 @@ impl<I: Interrupt> InterruptExecutor<I> {
60 /// The executor keeps running in the background through the interrupt. 60 /// The executor keeps running in the background through the interrupt.
61 /// 61 ///
62 /// This returns a [`SendSpawner`] you can use to spawn tasks on it. A [`SendSpawner`] 62 /// This returns a [`SendSpawner`] you can use to spawn tasks on it. A [`SendSpawner`]
63 /// is returned instead of a [`Spawner`](embassy::executor::Spawner) because the executor effectively runs in a 63 /// is returned instead of a [`Spawner`](embassy_executor::executor::Spawner) because the executor effectively runs in a
64 /// different "thread" (the interrupt), so spawning tasks on it is effectively 64 /// different "thread" (the interrupt), so spawning tasks on it is effectively
65 /// sending them. 65 /// sending them.
66 /// 66 ///
67 /// To obtain a [`Spawner`](embassy::executor::Spawner) for this executor, use [`Spawner::for_current_executor()`](embassy::executor::Spawner::for_current_executor()) from 67 /// To obtain a [`Spawner`](embassy_executor::executor::Spawner) for this executor, use [`Spawner::for_current_executor()`](embassy_executor::executor::Spawner::for_current_executor()) from
68 /// a task running in it. 68 /// a task running in it.
69 /// 69 ///
70 /// This function requires `&'static mut self`. This means you have to store the 70 /// This function requires `&'static mut self`. This means you have to store the
71 /// Executor instance in a place where it'll live forever and grants you mutable 71 /// Executor instance in a place where it'll live forever and grants you mutable
72 /// access. There's a few ways to do this: 72 /// access. There's a few ways to do this:
73 /// 73 ///
74 /// - a [Forever](embassy::util::Forever) (safe) 74 /// - a [Forever](embassy_util::Forever) (safe)
75 /// - a `static mut` (unsafe) 75 /// - a `static mut` (unsafe)
76 /// - a local variable in a function you know never returns (like `fn main() -> !`), upgrading its lifetime with `transmute`. (unsafe) 76 /// - a local variable in a function you know never returns (like `fn main() -> !`), upgrading its lifetime with `transmute`. (unsafe)
77 pub fn start(&'static mut self) -> SendSpawner { 77 pub fn start(&'static mut self) -> SendSpawner {