use core::marker::PhantomData;
use thr::prelude::*;
pub type Handler = unsafe extern "C" fn();
pub type ResetHandler = unsafe extern "C" fn() -> !;
#[derive(Clone, Copy)]
#[repr(usize)]
pub enum Reserved {
Vector = 0,
}
#[derive(Clone, Copy)]
pub struct Reset<T: ThrTag, U>(PhantomData<T>, PhantomData<U>);
#[cfg_attr(feature = "cargo-clippy", allow(new_without_default_derive))]
impl<T: ThrTag, U: Thread> Reset<T, &'static U> {
#[doc(hidden)]
#[inline(always)]
pub unsafe fn new() -> Self {
Reset(PhantomData, PhantomData)
}
}
impl<T: ThrTag, U: Thread> ThrToken<T> for Reset<T, &'static U> {
type Thr = U;
const THR_NUM: usize = 0;
}
impl<T: ThrTag, U: Thread> AsRef<U> for Reset<T, &'static U> {
#[inline(always)]
fn as_ref(&self) -> &U {
Self::get_thr()
}
}
impl<U: Thread> From<Reset<Ctt, &'static U>> for Reset<Ttt, &'static U> {
#[inline(always)]
fn from(_token: Reset<Ctt, &'static U>) -> Self {
unsafe { Self::new() }
}
}
impl<U: Thread> From<Reset<Ctt, &'static U>> for Reset<Ltt, &'static U> {
#[inline(always)]
fn from(_token: Reset<Ctt, &'static U>) -> Self {
unsafe { Self::new() }
}
}
impl<U: Thread> From<Reset<Ttt, &'static U>> for Reset<Ltt, &'static U> {
#[inline(always)]
fn from(_token: Reset<Ttt, &'static U>) -> Self {
unsafe { Self::new() }
}
}