From ad1f20924d9c2d8958ce52aeab352e5eedc2056c Mon Sep 17 00:00:00 2001 From: uncrustify Date: Tue, 21 Aug 2012 19:19:50 -0700 Subject: [PATCH] uncrustify ArduCopter/config.h --- ArduCopter/config.h | 622 ++++++++++++++++++++++---------------------- 1 file changed, 311 insertions(+), 311 deletions(-) diff --git a/ArduCopter/config.h b/ArduCopter/config.h index deee6026f4..417bb8e4b9 100644 --- a/ArduCopter/config.h +++ b/ArduCopter/config.h @@ -29,9 +29,9 @@ /// change in your local copy of APM_Config.h. /// #ifdef USE_CMAKE_APM_CONFIG -#include "APM_Config_cmake.h" // <== Prefer cmake config if it exists + #include "APM_Config_cmake.h" // <== Prefer cmake config if it exists #else -#include "APM_Config.h" // <== THIS INCLUDE, DO NOT EDIT IT. EVER. + #include "APM_Config.h" // <== THIS INCLUDE, DO NOT EDIT IT. EVER. #endif @@ -46,7 +46,7 @@ // #ifndef CONFIG_APM_HARDWARE -# define CONFIG_APM_HARDWARE APM_HARDWARE_APM1 + # define CONFIG_APM_HARDWARE APM_HARDWARE_APM1 #endif ////////////////////////////////////////////////////////////////////////////// @@ -54,33 +54,33 @@ // #if CONFIG_APM_HARDWARE == APM_HARDWARE_APM2 -# define CONFIG_IMU_TYPE CONFIG_IMU_MPU6000 -# define CONFIG_PUSHBUTTON DISABLED -# define CONFIG_RELAY DISABLED -# define MAG_ORIENTATION AP_COMPASS_APM2_SHIELD -# define CONFIG_SONAR_SOURCE SONAR_SOURCE_ANALOG_PIN -# define MAGNETOMETER ENABLED -# ifdef APM2_BETA_HARDWARE -# define CONFIG_BARO AP_BARO_BMP085 -# else // APM2 Production Hardware (default) -# define CONFIG_BARO AP_BARO_MS5611 -# endif + # define CONFIG_IMU_TYPE CONFIG_IMU_MPU6000 + # define CONFIG_PUSHBUTTON DISABLED + # define CONFIG_RELAY DISABLED + # define MAG_ORIENTATION AP_COMPASS_APM2_SHIELD + # define CONFIG_SONAR_SOURCE SONAR_SOURCE_ANALOG_PIN + # define MAGNETOMETER ENABLED + # ifdef APM2_BETA_HARDWARE + # define CONFIG_BARO AP_BARO_BMP085 + # else // APM2 Production Hardware (default) + # define CONFIG_BARO AP_BARO_MS5611 + # endif #endif ////////////////////////////////////////////////////////////////////////////// // FRAME_CONFIG // #ifndef FRAME_CONFIG -# define FRAME_CONFIG QUAD_FRAME + # define FRAME_CONFIG QUAD_FRAME #endif #ifndef FRAME_ORIENTATION -# define FRAME_ORIENTATION X_FRAME + # define FRAME_ORIENTATION X_FRAME #endif #ifndef TOY_EDF -# define TOY_EDF DISABLED + # define TOY_EDF DISABLED #endif #ifndef TOY_MIXER -# define TOY_MIXER TOY_LINEAR_MIXER + # define TOY_MIXER TOY_LINEAR_MIXER #endif @@ -89,13 +89,13 @@ // IMU Selection // #ifndef CONFIG_IMU_TYPE -# define CONFIG_IMU_TYPE CONFIG_IMU_OILPAN + # define CONFIG_IMU_TYPE CONFIG_IMU_OILPAN #endif #if CONFIG_IMU_TYPE == CONFIG_IMU_MPU6000 -# ifndef CONFIG_MPU6000_CHIP_SELECT_PIN -# define CONFIG_MPU6000_CHIP_SELECT_PIN 53 -# endif + # ifndef CONFIG_MPU6000_CHIP_SELECT_PIN + # define CONFIG_MPU6000_CHIP_SELECT_PIN 53 + # endif #endif @@ -103,58 +103,58 @@ // ADC Enable - used to eliminate for systems which don't have ADC. // #ifndef CONFIG_ADC -# if CONFIG_IMU_TYPE == CONFIG_IMU_OILPAN -# define CONFIG_ADC ENABLED -# else -# define CONFIG_ADC DISABLED -# endif + # if CONFIG_IMU_TYPE == CONFIG_IMU_OILPAN + # define CONFIG_ADC ENABLED + # else + # define CONFIG_ADC DISABLED + # endif #endif ////////////////////////////////////////////////////////////////////////////// // PWM control // #ifndef INSTANT_PWM -# define INSTANT_PWM DISABLED + # define INSTANT_PWM DISABLED #endif // default RC speed in Hz if INSTANT_PWM is not used #ifndef RC_FAST_SPEED -# if FRAME_CONFIG == HELI_FRAME -# define RC_FAST_SPEED 125 -# else -# define RC_FAST_SPEED 490 -# endif + # if FRAME_CONFIG == HELI_FRAME + # define RC_FAST_SPEED 125 + # else + # define RC_FAST_SPEED 490 + # endif #endif //////////////////////////////////////////////////////// // LED and IO Pins // #if CONFIG_APM_HARDWARE == APM_HARDWARE_APM1 -# define A_LED_PIN 37 -# define B_LED_PIN 36 -# define C_LED_PIN 35 -# define LED_ON HIGH -# define LED_OFF LOW -# define SLIDE_SWITCH_PIN 40 -# define PUSHBUTTON_PIN 41 -# define USB_MUX_PIN -1 -# define CLI_SLIDER_ENABLED DISABLED -# define OPTFLOW_CS_PIN 34 -# define BATTERY_PIN_1 0 -# define CURRENT_PIN_1 1 + # define A_LED_PIN 37 + # define B_LED_PIN 36 + # define C_LED_PIN 35 + # define LED_ON HIGH + # define LED_OFF LOW + # define SLIDE_SWITCH_PIN 40 + # define PUSHBUTTON_PIN 41 + # define USB_MUX_PIN -1 + # define CLI_SLIDER_ENABLED DISABLED + # define OPTFLOW_CS_PIN 34 + # define BATTERY_PIN_1 0 + # define CURRENT_PIN_1 1 #elif CONFIG_APM_HARDWARE == APM_HARDWARE_APM2 -# define A_LED_PIN 27 -# define B_LED_PIN 26 -# define C_LED_PIN 25 -# define LED_ON LOW -# define LED_OFF HIGH -# define SLIDE_SWITCH_PIN (-1) -# define PUSHBUTTON_PIN (-1) -# define CLI_SLIDER_ENABLED DISABLED -# define USB_MUX_PIN 23 -# define OPTFLOW_CS_PIN A3 -# define BATTERY_PIN_1 1 -# define CURRENT_PIN_1 2 + # define A_LED_PIN 27 + # define B_LED_PIN 26 + # define C_LED_PIN 25 + # define LED_ON LOW + # define LED_OFF HIGH + # define SLIDE_SWITCH_PIN (-1) + # define PUSHBUTTON_PIN (-1) + # define CLI_SLIDER_ENABLED DISABLED + # define USB_MUX_PIN 23 + # define OPTFLOW_CS_PIN A3 + # define BATTERY_PIN_1 1 + # define CURRENT_PIN_1 2 #endif //////////////////////////////////////////////////////////////////////////////// @@ -162,30 +162,30 @@ // #ifndef COPTER_LEDS -#define COPTER_LEDS ENABLED + #define COPTER_LEDS ENABLED #endif -#define COPTER_LED_ON HIGH -#define COPTER_LED_OFF LOW +#define COPTER_LED_ON HIGH +#define COPTER_LED_OFF LOW #if CONFIG_APM_HARDWARE == APM_HARDWARE_APM2 -#define COPTER_LED_1 AN4 // Motor or Aux LED -#define COPTER_LED_2 AN5 // Motor LED or Beeper -#define COPTER_LED_3 AN6 // Motor or GPS LED -#define COPTER_LED_4 AN7 // Motor LED -#define COPTER_LED_5 AN8 // Motor LED -#define COPTER_LED_6 AN9 // Motor LED -#define COPTER_LED_7 AN10 // Motor LED -#define COPTER_LED_8 AN11 // Motor LED + #define COPTER_LED_1 AN4 // Motor or Aux LED + #define COPTER_LED_2 AN5 // Motor LED or Beeper + #define COPTER_LED_3 AN6 // Motor or GPS LED + #define COPTER_LED_4 AN7 // Motor LED + #define COPTER_LED_5 AN8 // Motor LED + #define COPTER_LED_6 AN9 // Motor LED + #define COPTER_LED_7 AN10 // Motor LED + #define COPTER_LED_8 AN11 // Motor LED #elif CONFIG_APM_HARDWARE == APM_HARDWARE_APM1 -#define COPTER_LED_1 AN8 // Motor or Aux LED -#define COPTER_LED_2 AN9 // Motor LED -#define COPTER_LED_3 AN10 // Motor or GPS LED -#define COPTER_LED_4 AN11 // Motor LED -#define COPTER_LED_5 AN12 // Motor LED -#define COPTER_LED_6 AN13 // Motor LED -#define COPTER_LED_7 AN14 // Motor LED -#define COPTER_LED_8 AN15 // Motor LED + #define COPTER_LED_1 AN8 // Motor or Aux LED + #define COPTER_LED_2 AN9 // Motor LED + #define COPTER_LED_3 AN10 // Motor or GPS LED + #define COPTER_LED_4 AN11 // Motor LED + #define COPTER_LED_5 AN12 // Motor LED + #define COPTER_LED_6 AN13 // Motor LED + #define COPTER_LED_7 AN14 // Motor LED + #define COPTER_LED_8 AN15 // Motor LED #endif @@ -194,11 +194,11 @@ // #ifndef CONFIG_PUSHBUTTON -# define CONFIG_PUSHBUTTON ENABLED + # define CONFIG_PUSHBUTTON ENABLED #endif #ifndef CONFIG_RELAY -# define CONFIG_RELAY ENABLED + # define CONFIG_RELAY ENABLED #endif ////////////////////////////////////////////////////////////////////////////// @@ -206,7 +206,7 @@ // #ifndef CONFIG_BARO -# define CONFIG_BARO AP_BARO_BMP085 + # define CONFIG_BARO AP_BARO_BMP085 #endif ////////////////////////////////////////////////////////////////////////////// @@ -214,32 +214,32 @@ // #ifndef CONFIG_SONAR_SOURCE -# define CONFIG_SONAR_SOURCE SONAR_SOURCE_ADC + # define CONFIG_SONAR_SOURCE SONAR_SOURCE_ADC #endif #if CONFIG_SONAR_SOURCE == SONAR_SOURCE_ADC && CONFIG_ADC == DISABLED -# warning Cannot use ADC for CONFIG_SONAR_SOURCE, becaude CONFIG_ADC is DISABLED -# warning Defaulting CONFIG_SONAR_SOURCE to ANALOG_PIN -# undef CONFIG_SONAR_SOURCE -# define CONFIG_SONAR_SOURCE SONAR_SOURCE_ANALOG_PIN + # warning Cannot use ADC for CONFIG_SONAR_SOURCE, becaude CONFIG_ADC is DISABLED + # warning Defaulting CONFIG_SONAR_SOURCE to ANALOG_PIN + # undef CONFIG_SONAR_SOURCE + # define CONFIG_SONAR_SOURCE SONAR_SOURCE_ANALOG_PIN #endif #if CONFIG_SONAR_SOURCE == SONAR_SOURCE_ADC -# ifndef CONFIG_SONAR_SOURCE_ADC_CHANNEL -# define CONFIG_SONAR_SOURCE_ADC_CHANNEL 7 -# endif + # ifndef CONFIG_SONAR_SOURCE_ADC_CHANNEL + # define CONFIG_SONAR_SOURCE_ADC_CHANNEL 7 + # endif #elif CONFIG_SONAR_SOURCE == SONAR_SOURCE_ANALOG_PIN -# ifndef CONFIG_SONAR_SOURCE_ANALOG_PIN -# define CONFIG_SONAR_SOURCE_ANALOG_PIN A0 -# endif + # ifndef CONFIG_SONAR_SOURCE_ANALOG_PIN + # define CONFIG_SONAR_SOURCE_ANALOG_PIN A0 + # endif #else -# warning Invalid value for CONFIG_SONAR_SOURCE, disabling sonar -# undef SONAR_ENABLED -# define SONAR_ENABLED DISABLED + # warning Invalid value for CONFIG_SONAR_SOURCE, disabling sonar + # undef SONAR_ENABLED + # define SONAR_ENABLED DISABLED #endif #ifndef CONFIG_SONAR -# define CONFIG_SONAR ENABLED + # define CONFIG_SONAR ENABLED #endif ////////////////////////////////////////////////////////////////////////////// @@ -247,7 +247,7 @@ // #ifndef CONFIG_CHANNELS -# define CONFIG_CHANNELS CHANNEL_CONFIG_DEFAULT + # define CONFIG_CHANNELS CHANNEL_CONFIG_DEFAULT #endif ////////////////////////////////////////////////////////////////////////////// @@ -255,7 +255,7 @@ // #ifndef CH7_OPTION -# define CH7_OPTION CH7_SAVE_WP + # define CH7_OPTION CH7_SAVE_WP #endif @@ -263,10 +263,10 @@ // HIL_MODE OPTIONAL #ifndef HIL_MODE -#define HIL_MODE HIL_MODE_DISABLED + #define HIL_MODE HIL_MODE_DISABLED #endif -#if HIL_MODE != HIL_MODE_DISABLED // we are in HIL mode +#if HIL_MODE != HIL_MODE_DISABLED // we are in HIL mode # undef GPS_PROTOCOL # define GPS_PROTOCOL GPS_PROTOCOL_NONE @@ -280,12 +280,12 @@ // GPS_PROTOCOL // #ifndef GPS_PROTOCOL -# define GPS_PROTOCOL GPS_PROTOCOL_AUTO + # define GPS_PROTOCOL GPS_PROTOCOL_AUTO #endif #ifndef MAV_SYSTEM_ID -# define MAV_SYSTEM_ID 1 + # define MAV_SYSTEM_ID 1 #endif @@ -293,10 +293,10 @@ // Serial port speeds. // #ifndef SERIAL0_BAUD -# define SERIAL0_BAUD 115200 + # define SERIAL0_BAUD 115200 #endif #ifndef SERIAL3_BAUD -# define SERIAL3_BAUD 57600 + # define SERIAL3_BAUD 57600 #endif @@ -304,23 +304,23 @@ // Battery monitoring // #ifndef BATTERY_EVENT -# define BATTERY_EVENT DISABLED + # define BATTERY_EVENT DISABLED #endif #ifndef LOW_VOLTAGE -# define LOW_VOLTAGE 9.6 + # define LOW_VOLTAGE 9.6 #endif #ifndef VOLT_DIV_RATIO -# define VOLT_DIV_RATIO 3.56 + # define VOLT_DIV_RATIO 3.56 #endif #ifndef CURR_AMP_PER_VOLT -# define CURR_AMP_PER_VOLT 27.32 + # define CURR_AMP_PER_VOLT 27.32 #endif #ifndef CURR_AMPS_OFFSET -# define CURR_AMPS_OFFSET 0.0 + # define CURR_AMPS_OFFSET 0.0 #endif #ifndef HIGH_DISCHARGE -# define HIGH_DISCHARGE 1760 + # define HIGH_DISCHARGE 1760 #endif @@ -331,58 +331,58 @@ // INPUT_VOLTAGE // #ifndef INPUT_VOLTAGE -# define INPUT_VOLTAGE 5.0 + # define INPUT_VOLTAGE 5.0 #endif ////////////////////////////////////////////////////////////////////////////// // MAGNETOMETER #ifndef MAGNETOMETER -# define MAGNETOMETER ENABLED + # define MAGNETOMETER ENABLED #endif #ifndef MAG_ORIENTATION -# define MAG_ORIENTATION AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD + # define MAG_ORIENTATION AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD #endif ////////////////////////////////////////////////////////////////////////////// // OPTICAL_FLOW -#if defined( __AVR_ATmega2560__ ) // determines if optical flow code is included - #define OPTFLOW_ENABLED +#if defined( __AVR_ATmega2560__ ) // determines if optical flow code is included + #define OPTFLOW_ENABLED #endif -#ifndef OPTFLOW // sets global enabled/disabled flag for optflow (as seen in CLI) -# define OPTFLOW DISABLED +#ifndef OPTFLOW // sets global enabled/disabled flag for optflow (as seen in CLI) + # define OPTFLOW DISABLED #endif #ifndef OPTFLOW_ORIENTATION -# define OPTFLOW_ORIENTATION AP_OPTICALFLOW_ADNS3080_PINS_FORWARD + # define OPTFLOW_ORIENTATION AP_OPTICALFLOW_ADNS3080_PINS_FORWARD #endif #ifndef OPTFLOW_RESOLUTION -# define OPTFLOW_RESOLUTION ADNS3080_RESOLUTION_1600 + # define OPTFLOW_RESOLUTION ADNS3080_RESOLUTION_1600 #endif #ifndef OPTFLOW_FOV -# define OPTFLOW_FOV AP_OPTICALFLOW_ADNS3080_08_FOV + # define OPTFLOW_FOV AP_OPTICALFLOW_ADNS3080_08_FOV #endif // optical flow based loiter PI values #ifndef OPTFLOW_ROLL_P - #define OPTFLOW_ROLL_P 2.5 + #define OPTFLOW_ROLL_P 2.5 #endif #ifndef OPTFLOW_ROLL_I - #define OPTFLOW_ROLL_I 3.2 + #define OPTFLOW_ROLL_I 3.2 #endif #ifndef OPTFLOW_ROLL_D - #define OPTFLOW_ROLL_D 0.12 + #define OPTFLOW_ROLL_D 0.12 #endif #ifndef OPTFLOW_PITCH_P - #define OPTFLOW_PITCH_P 2.5 + #define OPTFLOW_PITCH_P 2.5 #endif #ifndef OPTFLOW_PITCH_I - #define OPTFLOW_PITCH_I 3.2 + #define OPTFLOW_PITCH_I 3.2 #endif #ifndef OPTFLOW_PITCH_D - #define OPTFLOW_PITCH_D 0.12 + #define OPTFLOW_PITCH_D 0.12 #endif #ifndef OPTFLOW_IMAX - #define OPTFLOW_IMAX 4 + #define OPTFLOW_IMAX 4 #endif @@ -397,22 +397,22 @@ // #if !defined(FLIGHT_MODE_1) -# define FLIGHT_MODE_1 STABILIZE + # define FLIGHT_MODE_1 STABILIZE #endif #if !defined(FLIGHT_MODE_2) -# define FLIGHT_MODE_2 STABILIZE + # define FLIGHT_MODE_2 STABILIZE #endif #if !defined(FLIGHT_MODE_3) -# define FLIGHT_MODE_3 STABILIZE + # define FLIGHT_MODE_3 STABILIZE #endif #if !defined(FLIGHT_MODE_4) -# define FLIGHT_MODE_4 STABILIZE + # define FLIGHT_MODE_4 STABILIZE #endif #if !defined(FLIGHT_MODE_5) -# define FLIGHT_MODE_5 STABILIZE + # define FLIGHT_MODE_5 STABILIZE #endif #if !defined(FLIGHT_MODE_6) -# define FLIGHT_MODE_6 STABILIZE + # define FLIGHT_MODE_6 STABILIZE #endif @@ -422,23 +422,23 @@ // THROTTLE_FAILSAFE_ACTION // #ifndef THROTTLE_FAILSAFE -# define THROTTLE_FAILSAFE DISABLED + # define THROTTLE_FAILSAFE DISABLED #endif #ifndef THROTTE_FS_VALUE -# define THROTTLE_FS_VALUE 975 + # define THROTTLE_FS_VALUE 975 #endif #ifndef THROTTLE_FAILSAFE_ACTION -# define THROTTLE_FAILSAFE_ACTION 2 + # define THROTTLE_FAILSAFE_ACTION 2 #endif #ifndef MINIMUM_THROTTLE -# define MINIMUM_THROTTLE 130 + # define MINIMUM_THROTTLE 130 #endif #ifndef MAXIMUM_THROTTLE -# define MAXIMUM_THROTTLE 1000 + # define MAXIMUM_THROTTLE 1000 #endif #ifndef AUTO_LAND_TIME -# define AUTO_LAND_TIME 5 + # define AUTO_LAND_TIME 5 #endif @@ -453,7 +453,7 @@ // GROUND_START_DELAY // #ifndef GROUND_START_DELAY -# define GROUND_START_DELAY 3 + # define GROUND_START_DELAY 3 #endif ////////////////////////////////////////////////////////////////////////////// @@ -467,7 +467,7 @@ // Y6 Support #ifndef TOP_BOTTOM_RATIO -# define TOP_BOTTOM_RATIO 1.00 + # define TOP_BOTTOM_RATIO 1.00 #endif @@ -475,49 +475,49 @@ // CAMERA TRIGGER AND CONTROL // #ifndef CAMERA -# if defined( __AVR_ATmega1280__ ) -# define CAMERA DISABLED -# else -# define CAMERA ENABLED -# endif + # if defined( __AVR_ATmega1280__ ) + # define CAMERA DISABLED + # else + # define CAMERA ENABLED + # endif #endif ////////////////////////////////////////////////////////////////////////////// // MOUNT (ANTENNA OR CAMERA) // #ifndef MOUNT -# if defined( __AVR_ATmega1280__ ) -# define MOUNT DISABLED -# else -# define MOUNT ENABLED -# endif + # if defined( __AVR_ATmega1280__ ) + # define MOUNT DISABLED + # else + # define MOUNT ENABLED + # endif #endif #ifndef MOUNT2 -# define MOUNT2 DISABLED + # define MOUNT2 DISABLED #endif #if defined( __AVR_ATmega1280__ ) && (MOUNT == ENABLED || MOUNT2 == ENABLED) -# warning "You choose to enable MOUNT on a small ATmega1280, CLI, CAMERA and AP_LIMITS will be disabled to free some space for it" + # warning "You choose to enable MOUNT on a small ATmega1280, CLI, CAMERA and AP_LIMITS will be disabled to free some space for it" // The small ATmega1280 chip does not have enough memory for mount support // so disable CLI, this will allow mount support and other improvements to fit. // This should almost have no side effects, because the APM planner can now do a complete board setup. -# define CLI_ENABLED DISABLED + # define CLI_ENABLED DISABLED // The small ATmega1280 chip does not have enough memory for mount support // so disable AUTO GPS support, this will allow mount support and other improvements to fit. // This should almost have no side effects, because the most users use MTK anyways. // If the user defined a GPS protocol, than we will NOT overwrite it -# if GPS_PROTOCOL == GPS_PROTOCOL_AUTO -# undef GPS_PROTOCOL -# define GPS_PROTOCOL GPS_PROTOCOL_MTK -# endif + # if GPS_PROTOCOL == GPS_PROTOCOL_AUTO + # undef GPS_PROTOCOL + # define GPS_PROTOCOL GPS_PROTOCOL_MTK + # endif // To save some more space -# undef CAMERA -# define CAMERA DISABLED -# define AP_LIMITS DISABLED + # undef CAMERA + # define CAMERA DISABLED + # define AP_LIMITS DISABLED #endif @@ -528,99 +528,99 @@ // Alt Hold Mode #ifndef ALT_HOLD_YAW -# define ALT_HOLD_YAW YAW_HOLD + # define ALT_HOLD_YAW YAW_HOLD #endif #ifndef ALT_HOLD_RP -# define ALT_HOLD_RP ROLL_PITCH_STABLE + # define ALT_HOLD_RP ROLL_PITCH_STABLE #endif #ifndef ALT_HOLD_THR -# define ALT_HOLD_THR THROTTLE_HOLD + # define ALT_HOLD_THR THROTTLE_HOLD #endif // AUTO Mode #ifndef AUTO_YAW -# define AUTO_YAW YAW_AUTO + # define AUTO_YAW YAW_AUTO #endif #ifndef AUTO_RP -# define AUTO_RP ROLL_PITCH_AUTO + # define AUTO_RP ROLL_PITCH_AUTO #endif #ifndef AUTO_THR -# define AUTO_THR THROTTLE_AUTO + # define AUTO_THR THROTTLE_AUTO #endif // CIRCLE Mode #ifndef CIRCLE_YAW -# define CIRCLE_YAW YAW_AUTO + # define CIRCLE_YAW YAW_AUTO #endif #ifndef CIRCLE_RP -# define CIRCLE_RP ROLL_PITCH_AUTO + # define CIRCLE_RP ROLL_PITCH_AUTO #endif #ifndef CIRCLE_THR -# define CIRCLE_THR THROTTLE_HOLD + # define CIRCLE_THR THROTTLE_HOLD #endif // LOITER Mode #ifndef LOITER_YAW -# define LOITER_YAW YAW_HOLD + # define LOITER_YAW YAW_HOLD #endif #ifndef LOITER_RP -# define LOITER_RP ROLL_PITCH_AUTO + # define LOITER_RP ROLL_PITCH_AUTO #endif #ifndef LOITER_THR -# define LOITER_THR THROTTLE_HOLD + # define LOITER_THR THROTTLE_HOLD #endif // RTL Mode #ifndef RTL_YAW -# define RTL_YAW YAW_HOLD + # define RTL_YAW YAW_HOLD #endif #ifndef RTL_RP -# define RTL_RP ROLL_PITCH_AUTO + # define RTL_RP ROLL_PITCH_AUTO #endif #ifndef RTL_THR -# define RTL_THR THROTTLE_HOLD + # define RTL_THR THROTTLE_HOLD #endif #ifndef SUPER_SIMPLE -# define SUPER_SIMPLE DISABLED + # define SUPER_SIMPLE DISABLED #endif #ifndef SUPER_SIMPLE_RADIUS -# define SUPER_SIMPLE_RADIUS 1000 + # define SUPER_SIMPLE_RADIUS 1000 #endif // RTL Mode #ifndef RTL_APPROACH_ALT -# define RTL_APPROACH_ALT 200 // cm!!! + # define RTL_APPROACH_ALT 200 // cm!!! #endif #ifndef RTL_HOLD_ALT -# define RTL_HOLD_ALT 1500 // height to return to Home in CM, 0 = Maintain current altitude + # define RTL_HOLD_ALT 1500 // height to return to Home in CM, 0 = Maintain current altitude #endif // LOITER Mode #ifndef OF_LOITER_YAW -# define OF_LOITER_YAW YAW_HOLD + # define OF_LOITER_YAW YAW_HOLD #endif #ifndef OF_LOITER_RP -# define OF_LOITER_RP ROLL_PITCH_STABLE_OF + # define OF_LOITER_RP ROLL_PITCH_STABLE_OF #endif #ifndef OF_LOITER_THR -# define OF_LOITER_THR THROTTLE_HOLD + # define OF_LOITER_THR THROTTLE_HOLD #endif ////////////////////////////////////////////////////////////////////////////// @@ -630,67 +630,67 @@ // Extra motor values that are changed from time to time by jani @ jDrones as software // and charachteristics changes. #ifdef MOTORS_JD880 -# define STABILIZE_ROLL_P 3.7 -# define STABILIZE_ROLL_I 0.0 -# define STABILIZE_ROLL_IMAX 8.0 // degrees -# define STABILIZE_PITCH_P 3.7 -# define STABILIZE_PITCH_I 0.0 -# define STABILIZE_PITCH_IMAX 8.0 // degrees + # define STABILIZE_ROLL_P 3.7 + # define STABILIZE_ROLL_I 0.0 + # define STABILIZE_ROLL_IMAX 8.0 // degrees + # define STABILIZE_PITCH_P 3.7 + # define STABILIZE_PITCH_I 0.0 + # define STABILIZE_PITCH_IMAX 8.0 // degrees #endif #ifdef MOTORS_JD850 -# define STABILIZE_ROLL_P 4.2 -# define STABILIZE_ROLL_I 0.0 -# define STABILIZE_ROLL_IMAX 8.0 // degrees -# define STABILIZE_PITCH_P 4.2 -# define STABILIZE_PITCH_I 0.0 -# define STABILIZE_PITCH_IMAX 8.0 // degrees + # define STABILIZE_ROLL_P 4.2 + # define STABILIZE_ROLL_I 0.0 + # define STABILIZE_ROLL_IMAX 8.0 // degrees + # define STABILIZE_PITCH_P 4.2 + # define STABILIZE_PITCH_I 0.0 + # define STABILIZE_PITCH_IMAX 8.0 // degrees #endif #ifndef ACRO_P -# define ACRO_P 4.5 + # define ACRO_P 4.5 #endif #ifndef AXIS_LOCK_ENABLED -# define AXIS_LOCK_ENABLED DISABLED + # define AXIS_LOCK_ENABLED DISABLED #endif #ifndef AXIS_LOCK_P -# define AXIS_LOCK_P .02 + # define AXIS_LOCK_P .02 #endif // Good for smaller payload motors. #ifndef STABILIZE_ROLL_P -# define STABILIZE_ROLL_P 4.5 + # define STABILIZE_ROLL_P 4.5 #endif #ifndef STABILIZE_ROLL_I -# define STABILIZE_ROLL_I 0.01 + # define STABILIZE_ROLL_I 0.01 #endif #ifndef STABILIZE_ROLL_IMAX -# define STABILIZE_ROLL_IMAX 8.0 // degrees + # define STABILIZE_ROLL_IMAX 8.0 // degrees #endif #ifndef STABILIZE_PITCH_P -# define STABILIZE_PITCH_P 4.5 + # define STABILIZE_PITCH_P 4.5 #endif #ifndef STABILIZE_PITCH_I -# define STABILIZE_PITCH_I 0.01 + # define STABILIZE_PITCH_I 0.01 #endif #ifndef STABILIZE_PITCH_IMAX -# define STABILIZE_PITCH_IMAX 8.0 // degrees + # define STABILIZE_PITCH_IMAX 8.0 // degrees #endif #ifndef STABILIZE_YAW_P -# define STABILIZE_YAW_P 7.0 // increase for more aggressive Yaw Hold, decrease if it's bouncy + # define STABILIZE_YAW_P 7.0 // increase for more aggressive Yaw Hold, decrease if it's bouncy #endif #ifndef STABILIZE_YAW_I -# define STABILIZE_YAW_I 0.02 + # define STABILIZE_YAW_I 0.02 #endif #ifndef STABILIZE_YAW_IMAX -# define STABILIZE_YAW_IMAX 8.0 // degrees * 100 + # define STABILIZE_YAW_IMAX 8.0 // degrees * 100 #endif @@ -698,109 +698,109 @@ // Stabilize Rate Control // #ifndef RATE_ROLL_P -# define RATE_ROLL_P 0.185 + # define RATE_ROLL_P 0.185 #endif #ifndef RATE_ROLL_I -# define RATE_ROLL_I 0.0 + # define RATE_ROLL_I 0.0 #endif #ifndef RATE_ROLL_D -# define RATE_ROLL_D 0.008 + # define RATE_ROLL_D 0.008 #endif #ifndef RATE_ROLL_IMAX -# define RATE_ROLL_IMAX 5.0 // degrees + # define RATE_ROLL_IMAX 5.0 // degrees #endif #ifndef RATE_PITCH_P -# define RATE_PITCH_P 0.185 + # define RATE_PITCH_P 0.185 #endif #ifndef RATE_PITCH_I -# define RATE_PITCH_I 0.0 + # define RATE_PITCH_I 0.0 #endif #ifndef RATE_PITCH_D -# define RATE_PITCH_D 0.008 + # define RATE_PITCH_D 0.008 #endif #ifndef RATE_PITCH_IMAX -# define RATE_PITCH_IMAX 5.0 // degrees + # define RATE_PITCH_IMAX 5.0 // degrees #endif #ifndef RATE_YAW_P -# define RATE_YAW_P .25 + # define RATE_YAW_P .25 #endif #ifndef RATE_YAW_I -# define RATE_YAW_I 0.02 + # define RATE_YAW_I 0.02 #endif #ifndef RATE_YAW_D -# define RATE_YAW_D 0.000 + # define RATE_YAW_D 0.000 #endif #ifndef RATE_YAW_IMAX -# define RATE_YAW_IMAX 8.0 // degrees + # define RATE_YAW_IMAX 8.0 // degrees #endif #ifndef STABILIZE_D -# define STABILIZE_D 0.00 + # define STABILIZE_D 0.00 #endif #ifndef STABILIZE_D_SCHEDULE -# define STABILIZE_D_SCHEDULE 0.5 + # define STABILIZE_D_SCHEDULE 0.5 #endif ////////////////////////////////////////////////////////////////////////////// // Loiter control gains // #ifndef LOITER_P -# define LOITER_P .20 + # define LOITER_P .20 #endif #ifndef LOITER_I -# define LOITER_I 0.0 + # define LOITER_I 0.0 #endif #ifndef LOITER_IMAX -# define LOITER_IMAX 30 // degrees + # define LOITER_IMAX 30 // degrees #endif ////////////////////////////////////////////////////////////////////////////// // Loiter Navigation control gains // #ifndef LOITER_RATE_P -# define LOITER_RATE_P 2.4 // + # define LOITER_RATE_P 2.4 // #endif #ifndef LOITER_RATE_I -# define LOITER_RATE_I 0.08 // Wind control + # define LOITER_RATE_I 0.08 // Wind control #endif #ifndef LOITER_RATE_D -# define LOITER_RATE_D 0.40 // try 2 or 3 for LOITER_RATE 1 + # define LOITER_RATE_D 0.40 // try 2 or 3 for LOITER_RATE 1 #endif #ifndef LOITER_RATE_IMAX -# define LOITER_RATE_IMAX 30 // degrees + # define LOITER_RATE_IMAX 30 // degrees #endif ////////////////////////////////////////////////////////////////////////////// // WP Navigation control gains // #ifndef NAV_P -# define NAV_P 2.4 // + # define NAV_P 2.4 // #endif #ifndef NAV_I -# define NAV_I 0.17 // Wind control + # define NAV_I 0.17 // Wind control #endif #ifndef NAV_D -# define NAV_D 0.00 // .95 + # define NAV_D 0.00 // .95 #endif #ifndef NAV_IMAX -# define NAV_IMAX 18 // degrees + # define NAV_IMAX 18 // degrees #endif #ifndef AUTO_SLEW_RATE -# define AUTO_SLEW_RATE 30 // degrees + # define AUTO_SLEW_RATE 30 // degrees #endif #ifndef WAYPOINT_SPEED_MAX -# define WAYPOINT_SPEED_MAX 500 // 6m/s error = 13mph + # define WAYPOINT_SPEED_MAX 500 // 6m/s error = 13mph #endif #ifndef WAYPOINT_SPEED_MIN -# define WAYPOINT_SPEED_MIN 150 // 1m/s + # define WAYPOINT_SPEED_MIN 150 // 1m/s #endif @@ -808,35 +808,35 @@ // Throttle control gains // #ifndef AUTO_THROTTLE_HOLD -# define AUTO_THROTTLE_HOLD 1 + # define AUTO_THROTTLE_HOLD 1 #endif #ifndef THROTTLE_CRUISE -# define THROTTLE_CRUISE 450 // + # define THROTTLE_CRUISE 450 // #endif #ifndef ALT_HOLD_P -# define ALT_HOLD_P 0.3 // .5 + # define ALT_HOLD_P 0.3 // .5 #endif #ifndef ALT_HOLD_I -# define ALT_HOLD_I 0.04 + # define ALT_HOLD_I 0.04 #endif #ifndef ALT_HOLD_IMAX -# define ALT_HOLD_IMAX 300 + # define ALT_HOLD_IMAX 300 #endif // RATE control #ifndef THROTTLE_P -# define THROTTLE_P 0.3 // .25 + # define THROTTLE_P 0.3 // .25 #endif #ifndef THROTTLE_I -# define THROTTLE_I 0.03 + # define THROTTLE_I 0.03 #endif #ifndef THROTTLE_D -# define THROTTLE_D 0.0 + # define THROTTLE_D 0.0 #endif #ifndef THROTTLE_IMAX -# define THROTTLE_IMAX 300 + # define THROTTLE_IMAX 300 #endif @@ -844,7 +844,7 @@ // Crosstrack compensation // #ifndef CROSSTRACK_GAIN -# define CROSSTRACK_GAIN .2 + # define CROSSTRACK_GAIN .2 #endif @@ -858,7 +858,7 @@ // DEBUG_LEVEL // #ifndef DEBUG_LEVEL -# define DEBUG_LEVEL SEVERITY_LOW + # define DEBUG_LEVEL SEVERITY_LOW #endif ////////////////////////////////////////////////////////////////////////////// @@ -866,137 +866,137 @@ // // Logging must be disabled for 1280 build. #if defined( __AVR_ATmega1280__ ) -# if LOGGING_ENABLED == ENABLED + # if LOGGING_ENABLED == ENABLED // If logging was enabled in APM_Config or command line, warn the user. -# warning "Logging is not supported on ATmega1280" -# undef LOGGING_ENABLED -# endif -# ifndef LOGGING_ENABLED -# define LOGGING_ENABLED DISABLED -# endif + # warning "Logging is not supported on ATmega1280" + # undef LOGGING_ENABLED + # endif + # ifndef LOGGING_ENABLED + # define LOGGING_ENABLED DISABLED + # endif #elif !defined(LOGGING_ENABLED) // Logging is enabled by default for all other builds. -# define LOGGING_ENABLED ENABLED + # define LOGGING_ENABLED ENABLED #endif #ifndef LOG_ATTITUDE_FAST -# define LOG_ATTITUDE_FAST DISABLED + # define LOG_ATTITUDE_FAST DISABLED #endif #ifndef LOG_ATTITUDE_MED -# define LOG_ATTITUDE_MED ENABLED + # define LOG_ATTITUDE_MED ENABLED #endif #ifndef LOG_GPS -# define LOG_GPS ENABLED + # define LOG_GPS ENABLED #endif #ifndef LOG_PM -# define LOG_PM ENABLED + # define LOG_PM ENABLED #endif #ifndef LOG_CTUN -# define LOG_CTUN ENABLED + # define LOG_CTUN ENABLED #endif #ifndef LOG_NTUN -# define LOG_NTUN ENABLED + # define LOG_NTUN ENABLED #endif #ifndef LOG_MODE -# define LOG_MODE ENABLED + # define LOG_MODE ENABLED #endif #ifndef LOG_RAW -# define LOG_RAW DISABLED + # define LOG_RAW DISABLED #endif #ifndef LOG_CMD -# define LOG_CMD ENABLED + # define LOG_CMD ENABLED #endif // current #ifndef LOG_CUR -# define LOG_CUR DISABLED + # define LOG_CUR DISABLED #endif // quad motor PWMs #ifndef LOG_MOTORS -# define LOG_MOTORS DISABLED + # define LOG_MOTORS DISABLED #endif // optical flow #ifndef LOG_OPTFLOW -# define LOG_OPTFLOW DISABLED + # define LOG_OPTFLOW DISABLED #endif #ifndef LOG_PID -# define LOG_PID DISABLED + # define LOG_PID DISABLED #endif // calculate the default log_bitmask -#define LOGBIT(_s) (LOG_##_s ? MASK_LOG_##_s : 0) +#define LOGBIT(_s) (LOG_ ## _s ? MASK_LOG_ ## _s : 0) #define DEFAULT_LOG_BITMASK \ - LOGBIT(ATTITUDE_FAST) | \ - LOGBIT(ATTITUDE_MED) | \ - LOGBIT(GPS) | \ - LOGBIT(PM) | \ - LOGBIT(CTUN) | \ - LOGBIT(NTUN) | \ - LOGBIT(MODE) | \ - LOGBIT(RAW) | \ - LOGBIT(CMD) | \ - LOGBIT(CUR) | \ - LOGBIT(MOTORS) | \ - LOGBIT(OPTFLOW) | \ - LOGBIT(PID) + LOGBIT(ATTITUDE_FAST) | \ + LOGBIT(ATTITUDE_MED) | \ + LOGBIT(GPS) | \ + LOGBIT(PM) | \ + LOGBIT(CTUN) | \ + LOGBIT(NTUN) | \ + LOGBIT(MODE) | \ + LOGBIT(RAW) | \ + LOGBIT(CMD) | \ + LOGBIT(CUR) | \ + LOGBIT(MOTORS) | \ + LOGBIT(OPTFLOW) | \ + LOGBIT(PID) // if we are using fast, Disable Medium //#if LOG_ATTITUDE_FAST == ENABLED // #undef LOG_ATTITUDE_MED -// #define LOG_ATTITUDE_MED DISABLED +// #define LOG_ATTITUDE_MED DISABLED //#endif #ifndef DEBUG_PORT -# define DEBUG_PORT 0 + # define DEBUG_PORT 0 #endif #if DEBUG_PORT == 0 -# define SendDebug_P(a) Serial.print_P(PSTR(a)) -# define SendDebugln_P(a) Serial.println_P(PSTR(a)) -# define SendDebug Serial.print -# define SendDebugln Serial.println + # define SendDebug_P(a) Serial.print_P(PSTR(a)) + # define SendDebugln_P(a) Serial.println_P(PSTR(a)) + # define SendDebug Serial.print + # define SendDebugln Serial.println #elif DEBUG_PORT == 1 -# define SendDebug_P(a) Serial1.print_P(PSTR(a)) -# define SendDebugln_P(a) Serial1.println_P(PSTR(a)) -# define SendDebug Serial1.print -# define SendDebugln Serial1.println + # define SendDebug_P(a) Serial1.print_P(PSTR(a)) + # define SendDebugln_P(a) Serial1.println_P(PSTR(a)) + # define SendDebug Serial1.print + # define SendDebugln Serial1.println #elif DEBUG_PORT == 2 -# define SendDebug_P(a) Serial2.print_P(PSTR(a)) -# define SendDebugln_P(a) Serial2.println_P(PSTR(a)) -# define SendDebug Serial2.print -# define SendDebugln Serial2.println + # define SendDebug_P(a) Serial2.print_P(PSTR(a)) + # define SendDebugln_P(a) Serial2.println_P(PSTR(a)) + # define SendDebug Serial2.print + # define SendDebugln Serial2.println #elif DEBUG_PORT == 3 -# define SendDebug_P(a) Serial3.print_P(PSTR(a)) -# define SendDebugln_P(a) Serial3.println_P(PSTR(a)) -# define SendDebug Serial3.print -# define SendDebugln Serial3.println + # define SendDebug_P(a) Serial3.print_P(PSTR(a)) + # define SendDebugln_P(a) Serial3.println_P(PSTR(a)) + # define SendDebug Serial3.print + # define SendDebugln Serial3.println #endif ////////////////////////////////////////////////////////////////////////////// // Navigation defaults // #ifndef WP_RADIUS_DEFAULT -# define WP_RADIUS_DEFAULT 2 + # define WP_RADIUS_DEFAULT 2 #endif #ifndef LOITER_RADIUS -# define LOITER_RADIUS 10 // meters for circle mode + # define LOITER_RADIUS 10 // meters for circle mode #endif #ifndef USE_CURRENT_ALT -# define USE_CURRENT_ALT FALSE + # define USE_CURRENT_ALT FALSE #endif #ifndef CUT_MOTORS -# define CUT_MOTORS 1 // do we cut the motors with no throttle? + # define CUT_MOTORS 1 // do we cut the motors with no throttle? #endif ////////////////////////////////////////////////////////////////////////////// // RC override // #ifndef ALLOW_RC_OVERRIDE -# define ALLOW_RC_OVERRIDE DISABLED + # define ALLOW_RC_OVERRIDE DISABLED #endif ////////////////////////////////////////////////////////////////////////////// @@ -1044,31 +1044,31 @@ // use this to completely disable the CLI #ifndef CLI_ENABLED // Sorry the chip is just too small to let this fit -# if defined( __AVR_ATmega1280__ ) -# define CLI_ENABLED DISABLED -# else -# define CLI_ENABLED ENABLED -# endif + # if defined( __AVR_ATmega1280__ ) + # define CLI_ENABLED DISABLED + # else + # define CLI_ENABLED ENABLED + # endif #endif // use this to disable the CLI slider switch #ifndef CLI_SLIDER_ENABLED -# define CLI_SLIDER_ENABLED DISABLED + # define CLI_SLIDER_ENABLED DISABLED #endif // delay to prevent Xbee bricking, in milliseconds #ifndef MAVLINK_TELEMETRY_PORT_DELAY -# define MAVLINK_TELEMETRY_PORT_DELAY 2000 + # define MAVLINK_TELEMETRY_PORT_DELAY 2000 #endif // experimental mpu6000 DMP code #ifndef DMP_ENABLED -# define DMP_ENABLED DISABLED + # define DMP_ENABLED DISABLED #endif #ifndef ALTERNATIVE_YAW_MODE -# define ALTERNATIVE_YAW_MODE DISABLED + # define ALTERNATIVE_YAW_MODE DISABLED #endif // Inertia based contollers. disabled by default, work in progress