#![cfg_attr(feature = "std", allow(unreachable_code))]
use crate::{map::periph::fpu::FpuPeriph, reg::prelude::*};
pub struct Fpu {
periph: FpuPeriph,
}
impl Fpu {
#[inline]
pub fn new(periph: FpuPeriph) -> Self {
Self { periph }
}
#[inline]
pub fn free(self) -> FpuPeriph {
self.periph
}
}
impl Fpu {
pub fn enable(&self) {
self.periph
.fpu_cpacr
.store(|r| r.write_cp10(0b11).write_cp11(0b11));
#[cfg(feature = "std")]
return unimplemented!();
unsafe {
asm!("
dsb
isb
" :
:
:
: "volatile"
);
}
}
}