Monotonic trait is safe; add MultiCore trait

This commit is contained in:
Jorge Aparicio 2019-06-24 14:09:12 +02:00
parent 4e51bb68b9
commit 596cf585ea
7 changed files with 35 additions and 9 deletions

View file

@ -8,7 +8,7 @@ use core::{
};
use bare_metal::Nr;
use rtfm::Monotonic;
use rtfm::{Monotonic, MultiCore};
// both cores have the exact same interrupts
pub use Interrupt_0 as Interrupt_1;
@ -21,7 +21,7 @@ pub fn xpend(_core: u8, _interrupt: impl Nr) {}
/// Fake monotonic timer
pub struct MT;
unsafe impl Monotonic for MT {
impl Monotonic for MT {
type Instant = Instant;
fn ratio() -> u32 {
@ -41,6 +41,8 @@ unsafe impl Monotonic for MT {
}
}
impl MultiCore for MT {}
#[derive(Clone, Copy, Eq, PartialEq)]
pub struct Instant(i32);