Skip to content
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.

Commit

Permalink
zinc: Provide dummy NoInterrupts for unsupported CPUs
Browse files Browse the repository at this point in the history
  • Loading branch information
mcoffin committed Jun 9, 2015
1 parent a5dbcbd commit 5a84158
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/util/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ use core::marker::{Sync, Send};
use hal::cortex_m3::irq::NoInterrupts;
#[cfg(feature = "cpu_cortex-m4")]
use hal::cortex_m4::irq::NoInterrupts;
// If cpu doesn't have nointerrupts provide dummy implementation
#[cfg(not(any(feature = "cpu_cortex-m3",
feature = "cpu_cortex-m4")))]
use self::dummy_irq::NoInterrupts;

#[allow(missing_docs)]
mod dummy_irq {
pub struct NoInterrupts;

impl NoInterrupts {
pub fn new() -> NoInterrupts {
NoInterrupts;
}
}
}

/// This allows safe sharing of state, ensuring access occurs only
/// when in a critical section.
Expand Down

0 comments on commit 5a84158

Please sign in to comment.