1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
extern crate cortex_m;
use ::destination;
use ::modes::InterruptModer;
use core::marker::PhantomData;
pub struct Itm<M: InterruptModer> {
inner: destination::Itm,
_mod: PhantomData<M>
}
impl<M: InterruptModer> Itm<M> {
pub fn new(itm: destination::Itm) -> Self {
Self { inner: itm, _mod: PhantomData }
}
}
impl<Mode: InterruptModer> super::Printer for Itm<Mode> {
type W = destination::Itm;
type M = Mode;
#[inline]
fn destination(&mut self) -> &mut Self::W {
&mut self.inner
}
}
pub type InterruptFree = Itm<::modes::InterruptFree>;
pub type InterruptOk = Itm<::modes::InterruptOk>;