mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-16 21:05:35 +01:00
Monotonic trait is safe; add MultiCore trait
This commit is contained in:
parent
4e51bb68b9
commit
596cf585ea
7 changed files with 35 additions and 9 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue