From a9a85f080bb8fc729125d3ad162058f063496e60 Mon Sep 17 00:00:00 2001 From: Ken Sarkies Date: Thu, 7 Mar 2013 18:35:04 +1030 Subject: 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. --- include/libopencm3/stm32/common/gpio_common_all.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/libopencm3/stm32/common/gpio_common_all.h') diff --git a/include/libopencm3/stm32/common/gpio_common_all.h b/include/libopencm3/stm32/common/gpio_common_all.h index 4d03db0..beac325 100644 --- a/include/libopencm3/stm32/common/gpio_common_all.h +++ b/include/libopencm3/stm32/common/gpio_common_all.h @@ -25,8 +25,11 @@ * along with this library. If not, see . */ -/* THIS FILE SHOULD NOT BE INCLUDED DIRECTLY, BUT ONLY VIA GPIO.H */ +/* THIS FILE SHOULD NOT BE INCLUDED DIRECTLY, BUT ONLY VIA GPIO.H +The order of header inclusion is important. gpio.h includes the device +specific memorymap.h header before including this header file.*/ +#if defined (LIBOPENCM3_GPIO_H) || defined (LIBOPENCM3_GPIO_COMMON_F24_H) #ifndef LIBOPENCM3_GPIO_COMMON_ALL_H #define LIBOPENCM3_GPIO_COMMON_ALL_H @@ -79,4 +82,7 @@ END_DECLS /**@}*/ #endif +#else +#warning "gpio_common_all.h should not be included explicitly, only via gpio.h" +#endif -- cgit v1.2.3