From 785dc36f20347631743961f00ecdd07de0ab49b2 Mon Sep 17 00:00:00 2001 From: Gustavo Jose de Sousa Date: Tue, 11 Aug 2015 16:28:43 +1000 Subject: [PATCH] AP_InertialSensor: standardize inclusion of libaries headers This commit changes the way libraries headers are included in source files: - If the header is in the same directory the source belongs to, so the notation '#include ""' is used with the path relative to the directory containing the source. - If the header is outside the directory containing the source, then we use the notation '#include <>' with the path relative to libraries folder. Some of the advantages of such approach: - Only one search path for libraries headers. - OSs like Windows may have a better lookup time. --- .../AP_InertialSensor/AP_InertialSensor.cpp | 12 ++-- .../AP_InertialSensor/AP_InertialSensor.h | 6 +- .../AP_InertialSensor_Backend.cpp | 2 +- .../AP_InertialSensor_Flymaple.cpp | 2 +- .../AP_InertialSensor_Flymaple.h | 6 +- .../AP_InertialSensor_HIL.cpp | 2 +- .../AP_InertialSensor_L3G4200D.cpp | 4 +- .../AP_InertialSensor_L3G4200D.h | 6 +- .../AP_InertialSensor_LSM9DS0.cpp | 2 +- .../AP_InertialSensor_LSM9DS0.h | 2 +- .../AP_InertialSensor_MPU6000.cpp | 2 +- .../AP_InertialSensor_MPU6000.h | 10 +-- .../AP_InertialSensor_MPU9150.cpp | 4 +- .../AP_InertialSensor_MPU9150.h | 8 +-- .../AP_InertialSensor_MPU9250.cpp | 2 +- .../AP_InertialSensor_MPU9250.h | 10 +-- .../AP_InertialSensor_Oilpan.cpp | 4 +- .../AP_InertialSensor_Oilpan.h | 2 +- .../AP_InertialSensor_PX4.cpp | 4 +- .../AP_InertialSensor/AP_InertialSensor_PX4.h | 8 +-- .../AP_InertialSensor_UserInteract.h | 2 +- ...AP_InertialSensor_UserInteract_MAVLink.cpp | 6 +- .../AP_InertialSensor_UserInteract_MAVLink.h | 4 +- .../AP_InertialSensor_UserInteract_Stream.cpp | 2 +- .../AP_InertialSensor_UserInteract_Stream.h | 2 +- .../examples/INS_generic/INS_generic.cpp | 70 +++++++++---------- .../examples/VibTest/VibTest.cpp | 66 ++++++++--------- 27 files changed, 125 insertions(+), 125 deletions(-) diff --git a/libraries/AP_InertialSensor/AP_InertialSensor.cpp b/libraries/AP_InertialSensor/AP_InertialSensor.cpp index d9163a61b9..3b1b18bc73 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor.cpp @@ -1,13 +1,13 @@ /// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- -#include +#include #include "AP_InertialSensor.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* enable TIMING_DEBUG to track down scheduling issues with the main diff --git a/libraries/AP_InertialSensor/AP_InertialSensor.h b/libraries/AP_InertialSensor/AP_InertialSensor.h index f715f5af0f..99049dd86a 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor.h +++ b/libraries/AP_InertialSensor/AP_InertialSensor.h @@ -26,10 +26,10 @@ #include -#include -#include +#include +#include #include "AP_InertialSensor_UserInteract.h" -#include +#include class AP_InertialSensor_Backend; diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_Backend.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_Backend.cpp index 068f79bd1b..4ec9a60bb5 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_Backend.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_Backend.cpp @@ -1,6 +1,6 @@ /// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- -#include +#include #include "AP_InertialSensor.h" #include "AP_InertialSensor_Backend.h" diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_Flymaple.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_Flymaple.cpp index cd356266b8..134c11826c 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_Flymaple.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_Flymaple.cpp @@ -21,7 +21,7 @@ // ITG3205 Gyroscope http://www.sparkfun.com/datasheets/Sensors/Gyro/PS-ITG-3200-00-01.4.pdf // ADXL345 Accelerometer http://www.analog.com/static/imported-files/data_sheets/ADXL345.pdf -#include +#include #if CONFIG_HAL_BOARD == HAL_BOARD_FLYMAPLE #include "AP_InertialSensor_Flymaple.h" diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_Flymaple.h b/libraries/AP_InertialSensor/AP_InertialSensor_Flymaple.h index 8c0aa1447b..108c385dee 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_Flymaple.h +++ b/libraries/AP_InertialSensor/AP_InertialSensor_Flymaple.h @@ -3,12 +3,12 @@ #ifndef __AP_INERTIAL_SENSOR_FLYMAPLE_H__ #define __AP_INERTIAL_SENSOR_FLYMAPLE_H__ -#include +#include #if CONFIG_HAL_BOARD == HAL_BOARD_FLYMAPLE #include "AP_InertialSensor.h" -#include -#include +#include +#include class AP_InertialSensor_Flymaple : public AP_InertialSensor_Backend { diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_HIL.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_HIL.cpp index 50bfb4d6b6..edbac91fad 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_HIL.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_HIL.cpp @@ -1,6 +1,6 @@ /// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- -#include +#include #include "AP_InertialSensor_HIL.h" const extern AP_HAL::HAL& hal; diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_L3G4200D.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_L3G4200D.cpp index abc062cba6..c001a8c3d6 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_L3G4200D.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_L3G4200D.cpp @@ -28,10 +28,10 @@ Datasheets: L3G4200D gyro http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/CD00265057.pdf */ -#include +#include #if CONFIG_HAL_BOARD == HAL_BOARD_LINUX -#include +#include #include "AP_InertialSensor_L3G4200D.h" #include #include diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_L3G4200D.h b/libraries/AP_InertialSensor/AP_InertialSensor_L3G4200D.h index 3c0da976cd..d6fbea9ab0 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_L3G4200D.h +++ b/libraries/AP_InertialSensor/AP_InertialSensor_L3G4200D.h @@ -3,14 +3,14 @@ #ifndef __AP_INERTIAL_SENSOR_L3G4200D_H__ #define __AP_INERTIAL_SENSOR_L3G4200D_H__ -#include +#include #if CONFIG_HAL_BOARD == HAL_BOARD_LINUX #include #include "AP_InertialSensor.h" -#include -#include +#include +#include class AP_InertialSensor_L3G4200D : public AP_InertialSensor_Backend { diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS0.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS0.cpp index b01ff757e2..2d7a70d88e 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS0.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS0.cpp @@ -15,7 +15,7 @@ * -- Adapted from Victor Mayoral Vilches's legacy driver under folder LSM9DS0 */ -#include +#include #if CONFIG_HAL_BOARD == HAL_BOARD_LINUX diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS0.h b/libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS0.h index d963116c15..0f01e31d33 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS0.h +++ b/libraries/AP_InertialSensor/AP_InertialSensor_LSM9DS0.h @@ -4,7 +4,7 @@ #define LSM9DS0_DEBUG 0 -#include +#include #include "AP_InertialSensor.h" class AP_InertialSensor_LSM9DS0 : public AP_InertialSensor_Backend diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp index b1fa54e8e3..3361c43da2 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp @@ -1,6 +1,6 @@ /// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- -#include +#include #include "AP_InertialSensor_MPU6000.h" extern const AP_HAL::HAL& hal; diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.h b/libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.h index 905e39c402..e5d7392ef9 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.h +++ b/libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.h @@ -4,9 +4,9 @@ #define __AP_INERTIAL_SENSOR_MPU6000_H__ #include -#include -#include -#include +#include +#include +#include #include "AP_InertialSensor.h" // enable debug to see a register dump on startup @@ -20,8 +20,8 @@ #endif #if MPU6000_FAST_SAMPLING -#include -#include +#include +#include #endif #define MPU6000_SAMPLE_SIZE 12 diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_MPU9150.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_MPU9150.cpp index ca244b0e6a..7a31ff73ab 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_MPU9150.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_MPU9150.cpp @@ -25,10 +25,10 @@ unmaintained */ -#include +#include #if CONFIG_HAL_BOARD == HAL_BOARD_LINUX -#include +#include #include "AP_InertialSensor_MPU9150.h" #include #include diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_MPU9150.h b/libraries/AP_InertialSensor/AP_InertialSensor_MPU9150.h index ffb30d6770..aba5e6c76e 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_MPU9150.h +++ b/libraries/AP_InertialSensor/AP_InertialSensor_MPU9150.h @@ -3,13 +3,13 @@ #ifndef __AP_INERTIAL_SENSOR_MPU9150_H__ #define __AP_INERTIAL_SENSOR_MPU9150_H__ -#include +#include #if CONFIG_HAL_BOARD == HAL_BOARD_LINUX -#include +#include #include "AP_InertialSensor.h" -#include -#include +#include +#include class AP_InertialSensor_MPU9150 : public AP_InertialSensor_Backend diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.cpp index 5ab4260e2d..34d760a594 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.cpp @@ -16,7 +16,7 @@ -- Coded by Victor Mayoral Vilches -- */ -#include +#include #if CONFIG_HAL_BOARD == HAL_BOARD_LINUX #include "AP_InertialSensor_MPU9250.h" diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.h b/libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.h index ec3664915d..dd2ab8be86 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.h +++ b/libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.h @@ -4,11 +4,11 @@ #define __AP_INERTIAL_SENSOR_MPU9250_H__ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "AP_InertialSensor.h" // enable debug to see a register dump on startup diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_Oilpan.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_Oilpan.cpp index 2ef92e0eaf..f62e5bbaaa 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_Oilpan.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_Oilpan.cpp @@ -1,10 +1,10 @@ /// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- -#include +#include #if CONFIG_HAL_BOARD == HAL_BOARD_APM1 #include "AP_InertialSensor_Oilpan.h" -#include +#include const extern AP_HAL::HAL& hal; diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_Oilpan.h b/libraries/AP_InertialSensor/AP_InertialSensor_Oilpan.h index e00169424c..3a785b1afe 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_Oilpan.h +++ b/libraries/AP_InertialSensor/AP_InertialSensor_Oilpan.h @@ -3,7 +3,7 @@ #ifndef __AP_INERTIAL_SENSOR_OILPAN_H__ #define __AP_INERTIAL_SENSOR_OILPAN_H__ -#include +#include #include "AP_InertialSensor.h" class AP_InertialSensor_Oilpan : public AP_InertialSensor_Backend diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_PX4.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_PX4.cpp index f1a73412b8..7b1ee8b314 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_PX4.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_PX4.cpp @@ -1,13 +1,13 @@ /// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- -#include +#include #if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN #include "AP_InertialSensor_PX4.h" const extern AP_HAL::HAL& hal; -#include +#include #include #include diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_PX4.h b/libraries/AP_InertialSensor/AP_InertialSensor_PX4.h index 223a36cabe..879711c10b 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_PX4.h +++ b/libraries/AP_InertialSensor/AP_InertialSensor_PX4.h @@ -3,18 +3,18 @@ #ifndef __AP_INERTIAL_SENSOR_PX4_H__ #define __AP_INERTIAL_SENSOR_PX4_H__ -#include +#include #if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN -#include +#include #include "AP_InertialSensor.h" #include #include #include #include -#include -#include +#include +#include class AP_InertialSensor_PX4 : public AP_InertialSensor_Backend { diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract.h b/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract.h index baf2d95284..117704a817 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract.h +++ b/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract.h @@ -2,7 +2,7 @@ #ifndef __AP_INERTIAL_SENSOR_USER_INTERACT_H__ #define __AP_INERTIAL_SENSOR_USER_INTERACT_H__ -#include +#include /* Pure virtual interface class */ class AP_InertialSensor_UserInteract { diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract_MAVLink.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract_MAVLink.cpp index e9a40016ef..8ebf1a7e31 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract_MAVLink.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract_MAVLink.cpp @@ -1,10 +1,10 @@ // -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- #include -#include -#include +#include +#include #include "AP_InertialSensor_UserInteract_MAVLink.h" -#include +#include extern const AP_HAL::HAL& hal; diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract_MAVLink.h b/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract_MAVLink.h index dfeb59ae76..521ab0faeb 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract_MAVLink.h +++ b/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract_MAVLink.h @@ -2,8 +2,8 @@ #ifndef __AP_INERTIAL_SENSOR_USER_INTERACT_MAVLINK_H__ #define __AP_INERTIAL_SENSOR_USER_INTERACT_MAVLINK_H__ -#include -#include +#include +#include #include "AP_InertialSensor_UserInteract.h" class GCS_MAVLINK; diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract_Stream.cpp b/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract_Stream.cpp index 31f01273f8..00fbb58c02 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract_Stream.cpp +++ b/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract_Stream.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include "AP_InertialSensor_UserInteract_Stream.h" extern const AP_HAL::HAL& hal; diff --git a/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract_Stream.h b/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract_Stream.h index d445846ef5..65f01d79c7 100644 --- a/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract_Stream.h +++ b/libraries/AP_InertialSensor/AP_InertialSensor_UserInteract_Stream.h @@ -2,7 +2,7 @@ #ifndef __AP_INERTIAL_SENSOR_USER_INTERACT_STREAM_H__ #define __AP_INERTIAL_SENSOR_USER_INTERACT_STREAM_H__ -#include +#include #include "AP_InertialSensor_UserInteract.h" /** diff --git a/libraries/AP_InertialSensor/examples/INS_generic/INS_generic.cpp b/libraries/AP_InertialSensor/examples/INS_generic/INS_generic.cpp index 621c304a7c..ef3716ed62 100644 --- a/libraries/AP_InertialSensor/examples/INS_generic/INS_generic.cpp +++ b/libraries/AP_InertialSensor/examples/INS_generic/INS_generic.cpp @@ -5,41 +5,41 @@ // #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include const AP_HAL::HAL& hal = AP_HAL_BOARD_DRIVER; diff --git a/libraries/AP_InertialSensor/examples/VibTest/VibTest.cpp b/libraries/AP_InertialSensor/examples/VibTest/VibTest.cpp index 954c7fb98b..e43f548353 100644 --- a/libraries/AP_InertialSensor/examples/VibTest/VibTest.cpp +++ b/libraries/AP_InertialSensor/examples/VibTest/VibTest.cpp @@ -5,39 +5,39 @@ // #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #if CONFIG_HAL_BOARD == HAL_BOARD_PX4