From c82a403b883225c228da5d9ad442523838c89475 Mon Sep 17 00:00:00 2001 From: rmackay9 Date: Sat, 2 Jun 2012 16:12:00 +0900 Subject: [PATCH] AP_MotorsHeli: Added reference to "Arduino.h" to allow autotest builder to work. Moved around initialisation of parmeters in AP_MotorHeli object to remove compiler warnings. --- libraries/AP_Motors/AP_MotorsHeli.h | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/libraries/AP_Motors/AP_MotorsHeli.h b/libraries/AP_Motors/AP_MotorsHeli.h index b880fde656..fc2c6d7c8d 100644 --- a/libraries/AP_Motors/AP_MotorsHeli.h +++ b/libraries/AP_Motors/AP_MotorsHeli.h @@ -14,6 +14,13 @@ #include // ArduPilot Mega RC Library #include +// below is required to make "map" function available to this library +#if defined(ARDUINO) && ARDUINO >= 100 + #include "Arduino.h" +#else + #include "WProgram.h" +#endif + #define AP_MOTORS_HELI_SPEED_DEFAULT 125 // default servo update rate for helicopters #define AP_MOTORS_HELI_SPEED_DIGITAL_SERVOS 125 // update rate for digital servos #define AP_MOTORS_HELI_SPEED_ANALOG_SERVOS 125 // update rate for analog servos @@ -65,21 +72,21 @@ public: servo1_pos (-60), servo2_pos (60), servo3_pos (180), - roll_max (4500), - pitch_max (4500), collective_min (1250), collective_max (1750), collective_mid (1500), ext_gyro_enabled (0), ext_gyro_gain (1350), + roll_max (4500), + pitch_max (4500), phase_angle (0), collective_yaw_effect (0), servo_manual (0), - throttle_mid(0), - ext_gov_setpoint(1500), - _roll_scaler(1), - _pitch_scaler(1), - _collective_scalar(1), + ext_gov_setpoint (1500), + throttle_mid (0), + _roll_scaler (1), + _pitch_scaler (1), + _collective_scalar (1), _swash_initialised(false) {}; @@ -103,8 +110,7 @@ public: AP_Int16 collective_yaw_effect; AP_Int8 servo_manual; // used to trigger swash reset from mission planner AP_Int16 ext_gov_setpoint; // maximum output to the motor governor - int16_t throttle_mid; // throttle mid point in pwm form (i.e. 0 ~ 1000) - int16_t coll_out_scaled; + int16_t throttle_mid; // throttle mid point in pwm form (i.e. 0 ~ 1000) // init