From 9a80bae79d1eb9111e50406cb7cc088246deb04d Mon Sep 17 00:00:00 2001
From: Jorge Aparicio <jorge@japaric.io>
Date: Thu, 21 Dec 2017 09:45:52 +0100
Subject: [PATCH] document `set_fpu_access_mode` footgun

closes #44
---
 src/peripheral/scb.rs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/peripheral/scb.rs b/src/peripheral/scb.rs
index 188f3b7..2a98618 100644
--- a/src/peripheral/scb.rs
+++ b/src/peripheral/scb.rs
@@ -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 {
-- 
GitLab