-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(arch): split the
dummy
arch into multiple submodule files
Split the `dummy` arch to make it more manageable when it keeps growing.
- Loading branch information
1 parent
bead939
commit c16dd7c
Showing
6 changed files
with
207 additions
and
207 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use embassy_executor::SpawnToken; | ||
|
||
use crate::arch; | ||
|
||
pub struct Executor; | ||
|
||
impl Executor { | ||
#[allow(clippy::new_without_default)] | ||
pub const fn new() -> Self { | ||
// Actually return a value instead of marking it unimplemented like other dummy | ||
// functions, because this function is const and is thus run during compilation | ||
Self {} | ||
} | ||
|
||
pub fn start(&self, _: arch::SWI) { | ||
unimplemented!(); | ||
} | ||
|
||
pub fn spawner(&self) -> Spawner { | ||
unimplemented!(); | ||
} | ||
} | ||
|
||
pub struct Spawner; | ||
|
||
impl Spawner { | ||
#[allow(clippy::result_unit_err)] | ||
pub fn spawn<S>(&self, _token: SpawnToken<S>) -> Result<(), ()> { | ||
unimplemented!(); | ||
} | ||
pub fn must_spawn<S>(&self, _token: SpawnToken<S>) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
use crate::arch; | ||
|
||
pub fn construct_rng(_peripherals: &mut arch::OptionalPeripherals) { | ||
unimplemented!(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
//! Dummy module used to satisfy platform-independent tooling. | ||
|
||
mod executor; | ||
|
||
#[cfg(feature = "hwrng")] | ||
pub mod hwrng; | ||
|
||
#[cfg(feature = "usb")] | ||
pub mod usb; | ||
|
||
pub use executor::{Executor, Spawner}; | ||
|
||
/// Dummy type. | ||
/// | ||
/// See the `OptionalPeripherals` type of your Embassy architecture crate instead. | ||
pub struct OptionalPeripherals; | ||
|
||
/// Dummy type. | ||
pub struct Peripherals; | ||
|
||
impl From<Peripherals> for OptionalPeripherals { | ||
fn from(_peripherals: Peripherals) -> Self { | ||
Self {} | ||
} | ||
} | ||
|
||
#[derive(Default)] | ||
pub struct Config; | ||
|
||
pub fn init(_config: Config) -> OptionalPeripherals { | ||
unimplemented!(); | ||
} | ||
|
||
pub struct SWI; |
Oops, something went wrong.