diff --git a/src/util/shared.rs b/src/util/shared.rs index 326a1bc0..ccc60d28 100644 --- a/src/util/shared.rs +++ b/src/util/shared.rs @@ -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.