diff --git a/src/main/drivers/accgyro_lsm303dlhc.c b/src/main/drivers/accgyro_lsm303dlhc.c index 4caed30911..c3ea4968e7 100644 --- a/src/main/drivers/accgyro_lsm303dlhc.c +++ b/src/main/drivers/accgyro_lsm303dlhc.c @@ -19,7 +19,6 @@ #include #include "platform.h" -#include "build_config.h" #include "debug.h" #include "common/maths.h" diff --git a/src/main/drivers/accgyro_mpu6500.c b/src/main/drivers/accgyro_mpu6500.c index 0cc23cfa9b..ed872230ea 100644 --- a/src/main/drivers/accgyro_mpu6500.c +++ b/src/main/drivers/accgyro_mpu6500.c @@ -20,7 +20,6 @@ #include #include "platform.h" -#include "build_config.h" #include "common/axis.h" #include "common/maths.h" diff --git a/src/main/drivers/accgyro_spi_mpu6000.c b/src/main/drivers/accgyro_spi_mpu6000.c index 8c277dea5c..aa2d7696e7 100644 --- a/src/main/drivers/accgyro_spi_mpu6000.c +++ b/src/main/drivers/accgyro_spi_mpu6000.c @@ -24,7 +24,6 @@ #include #include -#include #include "platform.h" diff --git a/src/main/drivers/accgyro_spi_mpu6500.c b/src/main/drivers/accgyro_spi_mpu6500.c index 32ae6a1ce8..afc69fbf16 100755 --- a/src/main/drivers/accgyro_spi_mpu6500.c +++ b/src/main/drivers/accgyro_spi_mpu6500.c @@ -17,7 +17,6 @@ #include #include -#include #include "platform.h" diff --git a/src/main/drivers/accgyro_spi_mpu9250.c b/src/main/drivers/accgyro_spi_mpu9250.c index 219bd51a21..b5beca2946 100644 --- a/src/main/drivers/accgyro_spi_mpu9250.c +++ b/src/main/drivers/accgyro_spi_mpu9250.c @@ -25,7 +25,6 @@ #include #include -#include #include "platform.h" #include "light_led.h" diff --git a/src/main/drivers/barometer_spi_bmp280.c b/src/main/drivers/barometer_spi_bmp280.c index d7a7491959..a32d6d1176 100644 --- a/src/main/drivers/barometer_spi_bmp280.c +++ b/src/main/drivers/barometer_spi_bmp280.c @@ -17,12 +17,9 @@ #include #include -#include #include -#include "build_config.h" - #include "bus_spi.h" #include "barometer.h" diff --git a/src/main/drivers/bus_i2c_stm32f10x.c b/src/main/drivers/bus_i2c_stm32f10x.c index 281db6bf2d..74a9f36559 100644 --- a/src/main/drivers/bus_i2c_stm32f10x.c +++ b/src/main/drivers/bus_i2c_stm32f10x.c @@ -21,8 +21,6 @@ #include -#include "build_config.h" - #include "io.h" #include "system.h" diff --git a/src/main/drivers/bus_i2c_stm32f30x.c b/src/main/drivers/bus_i2c_stm32f30x.c index 58d0caff31..d645a70504 100644 --- a/src/main/drivers/bus_i2c_stm32f30x.c +++ b/src/main/drivers/bus_i2c_stm32f30x.c @@ -17,12 +17,9 @@ #include #include -#include #include -#include "build_config.h" - #include "gpio.h" #include "system.h" #include "drivers/io_impl.h" diff --git a/src/main/drivers/bus_spi.c b/src/main/drivers/bus_spi.c index 2eefe6edc6..005f7936b6 100644 --- a/src/main/drivers/bus_spi.c +++ b/src/main/drivers/bus_spi.c @@ -20,8 +20,6 @@ #include -#include "build_config.h" - #include "bus_spi.h" #include "io.h" #include "io_impl.h" diff --git a/src/main/drivers/compass_hmc5883l.c b/src/main/drivers/compass_hmc5883l.c index c8c398fc3d..68c404d804 100644 --- a/src/main/drivers/compass_hmc5883l.c +++ b/src/main/drivers/compass_hmc5883l.c @@ -17,7 +17,6 @@ #include #include -#include #include diff --git a/src/main/drivers/display_ug2864hsweg01.c b/src/main/drivers/display_ug2864hsweg01.c index d16798e042..84ad2b4c2b 100644 --- a/src/main/drivers/display_ug2864hsweg01.c +++ b/src/main/drivers/display_ug2864hsweg01.c @@ -17,7 +17,6 @@ #include #include -#include #include "platform.h" diff --git a/src/main/drivers/dma.c b/src/main/drivers/dma.c index 4b6cace0e5..0ad411312e 100644 --- a/src/main/drivers/dma.c +++ b/src/main/drivers/dma.c @@ -21,8 +21,6 @@ #include -#include "build_config.h" - #include "drivers/nvic.h" #include "drivers/dma.h" diff --git a/src/main/drivers/dma_stm32f4xx.c b/src/main/drivers/dma_stm32f4xx.c index bf2d2ec582..ce960ab4c2 100644 --- a/src/main/drivers/dma_stm32f4xx.c +++ b/src/main/drivers/dma_stm32f4xx.c @@ -16,13 +16,11 @@ */ #include -#include #include +#include #include -#include "build_config.h" - #include "drivers/nvic.h" #include "drivers/dma.h" diff --git a/src/main/drivers/exti.c b/src/main/drivers/exti.c index e876f7a6be..cd97ba9b74 100644 --- a/src/main/drivers/exti.c +++ b/src/main/drivers/exti.c @@ -1,6 +1,6 @@ -#include #include #include +#include #include "platform.h" diff --git a/src/main/drivers/flash_m25p16.c b/src/main/drivers/flash_m25p16.c index c788dd8fe1..806c777dab 100644 --- a/src/main/drivers/flash_m25p16.c +++ b/src/main/drivers/flash_m25p16.c @@ -15,7 +15,6 @@ * along with Cleanflight. If not, see . */ -#include #include #include diff --git a/src/main/drivers/gpio_stm32f30x.c b/src/main/drivers/gpio_stm32f30x.c index 279f1acee3..ee54ab8a90 100644 --- a/src/main/drivers/gpio_stm32f30x.c +++ b/src/main/drivers/gpio_stm32f30x.c @@ -20,8 +20,6 @@ #include "platform.h" -#include "build_config.h" - #include "gpio.h" #define MODE_OFFSET 0 diff --git a/src/main/drivers/gyro_sync.c b/src/main/drivers/gyro_sync.c index 61305e1819..cd95e186e1 100644 --- a/src/main/drivers/gyro_sync.c +++ b/src/main/drivers/gyro_sync.c @@ -9,7 +9,6 @@ #include #include "platform.h" -#include "build_config.h" #include "drivers/sensor.h" #include "drivers/accgyro.h" diff --git a/src/main/drivers/max7456.c b/src/main/drivers/max7456.c index 793f6f77eb..b9f521273c 100644 --- a/src/main/drivers/max7456.c +++ b/src/main/drivers/max7456.c @@ -15,17 +15,15 @@ * along with Cleanflight. If not, see . */ -#include #include -#include #include -#include "common/printf.h" #include "platform.h" #include "version.h" #ifdef USE_MAX7456 +#include "common/printf.h" #include "drivers/bus_spi.h" #include "drivers/light_led.h" #include "drivers/system.h" diff --git a/src/main/drivers/pwm_mapping.c b/src/main/drivers/pwm_mapping.c index 80d2b01d92..13f01eac42 100755 --- a/src/main/drivers/pwm_mapping.c +++ b/src/main/drivers/pwm_mapping.c @@ -18,7 +18,6 @@ #include #include #include -#include #include "platform.h" diff --git a/src/main/drivers/pwm_rx.c b/src/main/drivers/pwm_rx.c index a0f65f4e3a..cde900c52b 100644 --- a/src/main/drivers/pwm_rx.c +++ b/src/main/drivers/pwm_rx.c @@ -18,9 +18,8 @@ #include #include -#include - #include + #include "build_config.h" #include "debug.h" diff --git a/src/main/drivers/sdcard.c b/src/main/drivers/sdcard.c index 722715fc16..3813fed74b 100644 --- a/src/main/drivers/sdcard.c +++ b/src/main/drivers/sdcard.c @@ -15,12 +15,13 @@ * along with Cleanflight. If not, see . */ -#include #include #include #include "platform.h" +#ifdef USE_SDCARD + #include "nvic.h" #include "io.h" @@ -30,8 +31,6 @@ #include "sdcard.h" #include "sdcard_standard.h" -#ifdef USE_SDCARD - #ifdef AFATFS_USE_INTROSPECTIVE_LOGGING #define SDCARD_PROFILING #endif diff --git a/src/main/drivers/serial_softserial.c b/src/main/drivers/serial_softserial.c index e44ff10a33..51cdeb2936 100644 --- a/src/main/drivers/serial_softserial.c +++ b/src/main/drivers/serial_softserial.c @@ -17,7 +17,6 @@ #include #include -#include #include "platform.h" diff --git a/src/main/drivers/serial_uart.c b/src/main/drivers/serial_uart.c index 3bee96b89e..ced8d97fff 100644 --- a/src/main/drivers/serial_uart.c +++ b/src/main/drivers/serial_uart.c @@ -22,7 +22,6 @@ */ #include #include -#include #include "platform.h" diff --git a/src/main/drivers/serial_uart_stm32f10x.c b/src/main/drivers/serial_uart_stm32f10x.c index 330b3f837a..4774ab33e6 100644 --- a/src/main/drivers/serial_uart_stm32f10x.c +++ b/src/main/drivers/serial_uart_stm32f10x.c @@ -24,7 +24,6 @@ #include #include -#include #include diff --git a/src/main/drivers/serial_uart_stm32f30x.c b/src/main/drivers/serial_uart_stm32f30x.c index ee65d54d2d..09b6663e86 100644 --- a/src/main/drivers/serial_uart_stm32f30x.c +++ b/src/main/drivers/serial_uart_stm32f30x.c @@ -25,7 +25,6 @@ #include #include -#include #include diff --git a/src/main/drivers/serial_uart_stm32f4xx.c b/src/main/drivers/serial_uart_stm32f4xx.c index 91577628b0..97f087a510 100644 --- a/src/main/drivers/serial_uart_stm32f4xx.c +++ b/src/main/drivers/serial_uart_stm32f4xx.c @@ -17,7 +17,6 @@ #include #include -#include #include "platform.h" diff --git a/src/main/drivers/serial_usb_vcp.c b/src/main/drivers/serial_usb_vcp.c index 5f1b223918..f225dd62bb 100644 --- a/src/main/drivers/serial_usb_vcp.c +++ b/src/main/drivers/serial_usb_vcp.c @@ -16,9 +16,7 @@ */ #include -#include #include -#include #include "platform.h" diff --git a/src/main/drivers/sound_beeper.c b/src/main/drivers/sound_beeper.c index 0c60ca4eb4..44d968db0b 100644 --- a/src/main/drivers/sound_beeper.c +++ b/src/main/drivers/sound_beeper.c @@ -17,12 +17,9 @@ #include #include -#include #include "platform.h" -#include "common/utils.h" - #include "system.h" #include "io.h" diff --git a/src/main/drivers/system.c b/src/main/drivers/system.c index 9efa3e4440..962b637349 100644 --- a/src/main/drivers/system.c +++ b/src/main/drivers/system.c @@ -15,15 +15,11 @@ * along with Cleanflight. If not, see . */ -#include #include #include -#include #include "platform.h" -#include "build_config.h" - #include "gpio.h" #include "light_led.h" #include "sound_beeper.h" diff --git a/src/main/drivers/system_stm32f10x.c b/src/main/drivers/system_stm32f10x.c index c273c6f3dc..f5eab63fac 100644 --- a/src/main/drivers/system_stm32f10x.c +++ b/src/main/drivers/system_stm32f10x.c @@ -15,10 +15,9 @@ * along with Cleanflight. If not, see . */ -#include #include #include -#include +#include #include "platform.h" diff --git a/src/main/drivers/system_stm32f30x.c b/src/main/drivers/system_stm32f30x.c index d762e2c333..e0aaad1bb0 100644 --- a/src/main/drivers/system_stm32f30x.c +++ b/src/main/drivers/system_stm32f30x.c @@ -15,10 +15,9 @@ * along with Cleanflight. If not, see . */ -#include #include #include -#include +#include #include "platform.h" diff --git a/src/main/drivers/system_stm32f4xx.c b/src/main/drivers/system_stm32f4xx.c index e7587aa9b3..8101974377 100644 --- a/src/main/drivers/system_stm32f4xx.c +++ b/src/main/drivers/system_stm32f4xx.c @@ -15,26 +15,18 @@ * along with Cleanflight. If not, see . */ -#include #include #include -#include +#include #include "platform.h" +#include "accgyro_mpu.h" #include "gpio.h" #include "nvic.h" #include "system.h" - #include "exti.h" -#include "debug.h" -#include "sensor.h" -#include "accgyro.h" -#include "accgyro_mpu.h" -#include "accgyro_spi_mpu6000.h" -#include "accgyro_mpu6500.h" -#include "accgyro_spi_mpu9250.h" #define AIRCR_VECTKEY_MASK ((uint32_t)0x05FA0000) diff --git a/src/main/drivers/transponder_ir.c b/src/main/drivers/transponder_ir.c index 2faf37731d..792e26beff 100644 --- a/src/main/drivers/transponder_ir.c +++ b/src/main/drivers/transponder_ir.c @@ -17,12 +17,9 @@ #include #include -#include #include -#include "build_config.h" - #include "drivers/dma.h" #include "drivers/nvic.h" #include "drivers/transponder_ir.h" diff --git a/src/main/drivers/usb_detection.c b/src/main/drivers/usb_detection.c index 13cc8bb1cb..9279d7dff4 100644 --- a/src/main/drivers/usb_detection.c +++ b/src/main/drivers/usb_detection.c @@ -15,7 +15,6 @@ * along with Cleanflight. If not, see . */ -#include #include #include diff --git a/src/main/drivers/usb_io.c b/src/main/drivers/usb_io.c index 14a01bcd65..d8a7206109 100644 --- a/src/main/drivers/usb_io.c +++ b/src/main/drivers/usb_io.c @@ -15,19 +15,19 @@ * along with Cleanflight. If not, see . */ -#include "sdcard.h" - -#include #include #include #include "platform.h" +#ifdef USB_IO + #include "io.h" #include "system.h" #include "usb_io.h" +#include "sdcard.h" + -#ifdef USB_IO #ifdef USB_DETECT_PIN static IO_t usbDetectPin = IO_NONE; diff --git a/src/main/drivers/vtx_rtc6705.c b/src/main/drivers/vtx_rtc6705.c index 35e78fe0dc..ee540da60e 100644 --- a/src/main/drivers/vtx_rtc6705.c +++ b/src/main/drivers/vtx_rtc6705.c @@ -22,7 +22,6 @@ * as this header is maintained with the file at all times. */ -#include #include #include diff --git a/src/main/drivers/vtx_soft_spi_rtc6705.c b/src/main/drivers/vtx_soft_spi_rtc6705.c index 6572540c66..4ceba50df9 100644 --- a/src/main/drivers/vtx_soft_spi_rtc6705.c +++ b/src/main/drivers/vtx_soft_spi_rtc6705.c @@ -15,7 +15,6 @@ * along with Cleanflight. If not, see . */ -#include #include #include