aboutsummaryrefslogtreecommitdiff
path: root/include/libopencm3/stm32/common/spi_common_f24.h
diff options
context:
space:
mode:
authorKen Sarkies2013-03-07 18:35:04 +1030
committerKen Sarkies2013-03-07 18:35:04 +1030
commita9a85f080bb8fc729125d3ad162058f063496e60 (patch)
treecee25cef4074fe637d9d653ddf41bcf005fc26b2 /include/libopencm3/stm32/common/spi_common_f24.h
parente2022f588492d5c117743b6b13801940f4a4b03e (diff)
Add test in common headers for improper inclusion of such files in application.
(prevents inclusion and also issues warning) Changes to some source files to remove references to common headers. Changes to rng.h to make guard symbols the same in f2 and f4.
Diffstat (limited to 'include/libopencm3/stm32/common/spi_common_f24.h')
-rw-r--r--include/libopencm3/stm32/common/spi_common_f24.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/libopencm3/stm32/common/spi_common_f24.h b/include/libopencm3/stm32/common/spi_common_f24.h
index 0a5873d..ad90142 100644
--- a/include/libopencm3/stm32/common/spi_common_f24.h
+++ b/include/libopencm3/stm32/common/spi_common_f24.h
@@ -22,8 +22,11 @@
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-/* THIS FILE SHOULD NOT BE INCLUDED DIRECTLY, BUT ONLY VIA SPI.H */
+/* THIS FILE SHOULD NOT BE INCLUDED DIRECTLY, BUT ONLY VIA SPI.H
+The order of header inclusion is important. spi.h includes the device
+specific memorymap.h header before including this header file.*/
+#ifdef LIBOPENCM3_SPI_H
#ifndef LIBOPENCM3_SPI_COMMON_F24_H
#define LIBOPENCM3_SPI_COMMON_F24_H
@@ -50,5 +53,8 @@
#define SPI_SR_TIFRFE (1 << 8)
#endif
+#else
+#warning "spi_common_f24.h should not be included explicitly, only via spi.h"
+#endif
/**@}*/