#![deny(missing_docs)]
#![deny(rust_2021_compatibility)]
#![deny(rust_2018_compatibility)]
#![deny(rust_2018_idioms)]
#![no_std]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/rtic-rs/cortex-m-rtic/master/book/en/src/RTIC.svg",
html_favicon_url = "https://raw.githubusercontent.com/rtic-rs/cortex-m-rtic/master/book/en/src/RTIC.svg"
)]
#![allow(clippy::inline_always)]
use cortex_m::{interrupt::InterruptNumber, peripheral::NVIC};
pub use cortex_m_rtic_macros::app;
pub use rtic_core::{prelude as mutex_prelude, Exclusive, Mutex};
pub use rtic_monotonic::{self, Monotonic};
pub mod mutex {
pub use rtic_core::prelude;
pub use rtic_core::Mutex;
}
#[doc(hidden)]
pub mod export;
#[doc(hidden)]
mod tq;
pub fn pend<I>(interrupt: I)
where
I: InterruptNumber,
{
NVIC::pend(interrupt);
}
use core::cell::UnsafeCell;
#[repr(transparent)]
pub struct RacyCell<T>(UnsafeCell<T>);
impl<T> RacyCell<T> {
#[inline(always)]
pub const fn new(value: T) -> Self {
RacyCell(UnsafeCell::new(value))
}
#[inline(always)]
pub unsafe fn get_mut(&self) -> *mut T {
self.0.get()
}
#[inline(always)]
pub unsafe fn get(&self) -> *const T {
self.0.get()
}
}
unsafe impl<T> Sync for RacyCell<T> {}