aboutsummaryrefslogtreecommitdiff
path: root/include/libopencm3/stm32/common/i2c_common_all.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libopencm3/stm32/common/i2c_common_all.h')
-rw-r--r--include/libopencm3/stm32/common/i2c_common_all.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/libopencm3/stm32/common/i2c_common_all.h b/include/libopencm3/stm32/common/i2c_common_all.h
index 7f6d447..cd954cb 100644
--- a/include/libopencm3/stm32/common/i2c_common_all.h
+++ b/include/libopencm3/stm32/common/i2c_common_all.h
@@ -23,8 +23,11 @@
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-/* THIS FILE SHOULD NOT BE INCLUDED DIRECTLY, BUT ONLY VIA I2C.H */
+/* THIS FILE SHOULD NOT BE INCLUDED DIRECTLY, BUT ONLY VIA I2C.H
+The order of header inclusion is important. i2c.h includes the device
+specific memorymap.h header before including this header file.*/
+#if defined (LIBOPENCM3_I2C_H) || defined (LIBOPENCM3_I2C_COMMON_F24_H)
#ifndef LIBOPENCM3_I2C_COMMON_ALL_H
#define LIBOPENCM3_I2C_COMMON_ALL_H
@@ -383,5 +386,8 @@ void i2c_clear_dma_last_transfer(u32 i2c);
END_DECLS
#endif
+#else
+#warning "i2c_common_all.h should not be included explicitly, only via i2c.h"
+#endif
/**@}*/