Skip to content

Commit

Permalink
riot-rs-embassy: fix some dummy arch lints
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 committed Feb 22, 2024
1 parent 109b0ac commit 54c0da3
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/riot-rs-embassy/src/arch/dummy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@
/// Dummy type.
///
/// See the `OptionalPeripherals` type of your Embassy architecture crate instead.
#[derive(Default)]
pub struct OptionalPeripherals;

/// Dummy type.
pub struct Peripherals;

impl From<Peripherals> for OptionalPeripherals {
fn from(_peripherals: Peripherals) -> Self {
Self {}
}
}

mod executor {
use embassy_executor::SpawnToken;

Expand All @@ -25,15 +35,16 @@ mod executor {
pub struct Spawner {}

impl Spawner {
pub fn spawn<S>(&self, token: SpawnToken<S>) -> Result<(), ()> {
#[allow(clippy::result_unit_err)]
pub fn spawn<S>(&self, _token: SpawnToken<S>) -> Result<(), ()> {
Ok(())
}
}
}
pub use executor::{Executor, Spawner};

pub fn init(_: ()) -> OptionalPeripherals {
OptionalPeripherals {}
pub fn init(_: OptionalPeripherals) -> Peripherals {
Peripherals {}
}

pub struct SWI;

0 comments on commit 54c0da3

Please sign in to comment.