Skip to content

Commit

Permalink
document set_fpu_access_mode footgun
Browse files Browse the repository at this point in the history
closes #44
  • Loading branch information
japaric committed Dec 21, 2017
1 parent 4689992 commit 9a80bae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/peripheral/scb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ impl RegisterBlock {
}

/// 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) {
let mut cpacr = self.cpacr.read() & !SCB_CPACR_FPU_MASK;
match mode {
Expand Down

0 comments on commit 9a80bae

Please sign in to comment.