Skip to content

Commit 9a80bae

Browse files
committed
document set_fpu_access_mode footgun
closes #44
1 parent 4689992 commit 9a80bae

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/peripheral/scb.rs

+5
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ impl RegisterBlock {
7878
}
7979

8080
/// Sets FPU access mode
81+
///
82+
/// *IMPORTANT* Any function that runs fully or partly with the FPU disabled must *not* take any
83+
/// floating-point arguments or have any floating-point local variables. Because the compiler
84+
/// might inline such a function into a caller that does have floating-point arguments or
85+
/// variables, any such function must be also marked #[inline(never)].
8186
pub fn set_fpu_access_mode(&self, mode: FpuAccessMode) {
8287
let mut cpacr = self.cpacr.read() & !SCB_CPACR_FPU_MASK;
8388
match mode {

0 commit comments

Comments
 (0)