From d84c4030b2c90cb2c2fe0a50cfeb1e34cdf48560 Mon Sep 17 00:00:00 2001 From: Piotr Esden-Tempski Date: Thu, 4 Mar 2010 19:16:24 +0100 Subject: [PATCH] Cleaned up header inclusion. Now all examples are including only the modules they really need. Also each header file of the library is including only the necessary headers making it possible to use these modules in parallel with other implementations that may collide with the definitions in other modules. --- examples/mb525/fancyblink/fancyblink.c | 3 ++- examples/mb525/pwmleds/pwmleds.c | 1 - examples/stm32-h103/fancyblink/fancyblink.c | 3 ++- examples/stm32-h103/miniblink/miniblink.c | 3 ++- examples/stm32-h103/spi/spi.c | 2 +- examples/stm32-h103/usart/usart.c | 4 +++- include/libopenstm32/adc.h | 3 ++- include/libopenstm32/flash.h | 3 ++- include/libopenstm32/i2c.h | 3 ++- include/libopenstm32/nvic.h | 3 ++- include/libopenstm32/rtc.h | 3 ++- include/libopenstm32/spi.h | 3 ++- include/libopenstm32/usart.h | 3 ++- 13 files changed, 24 insertions(+), 13 deletions(-) diff --git a/examples/mb525/fancyblink/fancyblink.c b/examples/mb525/fancyblink/fancyblink.c index 9c5e5812..f3e7c9b9 100644 --- a/examples/mb525/fancyblink/fancyblink.c +++ b/examples/mb525/fancyblink/fancyblink.c @@ -18,7 +18,8 @@ * along with this program. If not, see . */ -#include +#include +#include /* Set STM32 to 72 MHz. */ void clock_setup(void) diff --git a/examples/mb525/pwmleds/pwmleds.c b/examples/mb525/pwmleds/pwmleds.c index 12c88b56..2bff5a41 100644 --- a/examples/mb525/pwmleds/pwmleds.c +++ b/examples/mb525/pwmleds/pwmleds.c @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -#include #include #include #include diff --git a/examples/stm32-h103/fancyblink/fancyblink.c b/examples/stm32-h103/fancyblink/fancyblink.c index aad18798..1118e4de 100644 --- a/examples/stm32-h103/fancyblink/fancyblink.c +++ b/examples/stm32-h103/fancyblink/fancyblink.c @@ -17,7 +17,8 @@ * along with this program. If not, see . */ -#include +#include +#include /* Set STM32 to 72 MHz. */ void clock_setup(void) diff --git a/examples/stm32-h103/miniblink/miniblink.c b/examples/stm32-h103/miniblink/miniblink.c index a8d253c1..21575f6b 100644 --- a/examples/stm32-h103/miniblink/miniblink.c +++ b/examples/stm32-h103/miniblink/miniblink.c @@ -17,7 +17,8 @@ * along with this program. If not, see . */ -#include +#include +#include void gpio_setup(void) { diff --git a/examples/stm32-h103/spi/spi.c b/examples/stm32-h103/spi/spi.c index 86bd2a96..bf313beb 100644 --- a/examples/stm32-h103/spi/spi.c +++ b/examples/stm32-h103/spi/spi.c @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#include +#include void clock_setup(void) { diff --git a/examples/stm32-h103/usart/usart.c b/examples/stm32-h103/usart/usart.c index 52a158dc..7f1c343c 100644 --- a/examples/stm32-h103/usart/usart.c +++ b/examples/stm32-h103/usart/usart.c @@ -17,7 +17,9 @@ * along with this program. If not, see . */ -#include +#include +#include +#include void clock_setup(void) { diff --git a/include/libopenstm32/adc.h b/include/libopenstm32/adc.h index 0ffd152a..7611be12 100644 --- a/include/libopenstm32/adc.h +++ b/include/libopenstm32/adc.h @@ -20,7 +20,8 @@ #ifndef LIBOPENSTM32_ADC_H #define LIBOPENSTM32_ADC_H -#include +#include +#include /* --- Convenience macros -------------------------------------------------- */ diff --git a/include/libopenstm32/flash.h b/include/libopenstm32/flash.h index 49e5b95a..b4151ef3 100644 --- a/include/libopenstm32/flash.h +++ b/include/libopenstm32/flash.h @@ -27,7 +27,8 @@ #ifndef LIBOPENSTM32_FLASH_H #define LIBOPENSTM32_FLASH_H -#include +#include +#include /* --- FLASH registers ----------------------------------------------------- */ diff --git a/include/libopenstm32/i2c.h b/include/libopenstm32/i2c.h index 62e7b62d..85fdeb18 100644 --- a/include/libopenstm32/i2c.h +++ b/include/libopenstm32/i2c.h @@ -20,7 +20,8 @@ #ifndef LIBOPENSTM32_I2C_H #define LIBOPENSTM32_I2C_H -#include +#include +#include /* --- Convenience macros -------------------------------------------------- */ diff --git a/include/libopenstm32/nvic.h b/include/libopenstm32/nvic.h index 0a740a02..aa427e48 100644 --- a/include/libopenstm32/nvic.h +++ b/include/libopenstm32/nvic.h @@ -20,7 +20,8 @@ #ifndef LIBOPENSTM32_NVIC_H #define LIBOPENSTM32_NVIC_H -#include +#include +#include /* --- NVIC Registers ------------------------------------------------------ */ /* ISER: Interrupt Set Enable Registers */ diff --git a/include/libopenstm32/rtc.h b/include/libopenstm32/rtc.h index fbe738b3..ed03acbf 100644 --- a/include/libopenstm32/rtc.h +++ b/include/libopenstm32/rtc.h @@ -20,7 +20,8 @@ #ifndef LIBOPENSTM32_RTC_H #define LIBOPENSTM32_RTC_H -#include +#include +#include /* --- RTC registers ------------------------------------------------------- */ diff --git a/include/libopenstm32/spi.h b/include/libopenstm32/spi.h index 11afa32a..30902992 100644 --- a/include/libopenstm32/spi.h +++ b/include/libopenstm32/spi.h @@ -20,7 +20,8 @@ #ifndef LIBOPENSTM32_SPI_H #define LIBOPENSTM32_SPI_H -#include +#include +#include /* Registers can be accessed as 16bit or 32bit values. */ diff --git a/include/libopenstm32/usart.h b/include/libopenstm32/usart.h index f3a98787..0cf86d18 100644 --- a/include/libopenstm32/usart.h +++ b/include/libopenstm32/usart.h @@ -20,7 +20,8 @@ #ifndef LIBOPENSTM32_USART_H #define LIBOPENSTM32_USART_H -#include +#include +#include /* --- Convenience macros -------------------------------------------------- */