Skip to content
Snippets Groups Projects
Commit 9a80bae7 authored by Jorge Aparicio's avatar Jorge Aparicio
Browse files

document `set_fpu_access_mode` footgun

closes #44
parent 4689992e
No related branches found
No related tags found
No related merge requests found
...@@ -78,6 +78,11 @@ impl RegisterBlock { ...@@ -78,6 +78,11 @@ impl RegisterBlock {
} }
/// Sets FPU access mode /// Sets FPU access mode
///
/// *IMPORTANT* Any function that runs fully or partly with the FPU disabled must *not* take any
/// floating-point arguments or have any floating-point local variables. Because the compiler
/// might inline such a function into a caller that does have floating-point arguments or
/// variables, any such function must be also marked #[inline(never)].
pub fn set_fpu_access_mode(&self, mode: FpuAccessMode) { pub fn set_fpu_access_mode(&self, mode: FpuAccessMode) {
let mut cpacr = self.cpacr.read() & !SCB_CPACR_FPU_MASK; let mut cpacr = self.cpacr.read() & !SCB_CPACR_FPU_MASK;
match mode { match mode {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment