From b88c12ad1f25b19c6fabaca6715c99a57112bf87 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 5 May 2015 13:44:08 +1000 Subject: [PATCH] Copter: use M_PI_F instead of (float)M_PI --- ArduCopter/commands_logic.pde | 2 +- ArduCopter/control_poshold.pde | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ArduCopter/commands_logic.pde b/ArduCopter/commands_logic.pde index 8be42cbce4..ccf37bee2b 100644 --- a/ArduCopter/commands_logic.pde +++ b/ArduCopter/commands_logic.pde @@ -701,7 +701,7 @@ static bool verify_circle(const AP_Mission::Mission_Command& cmd) } // check if we have completed circling - return fabsf(circle_nav.get_angle_total()/(float)(2*M_PI)) >= LOWBYTE(cmd.p1); + return fabsf(circle_nav.get_angle_total()/(2*M_PI_F)) >= LOWBYTE(cmd.p1); } // externs to remove compiler warning diff --git a/ArduCopter/control_poshold.pde b/ArduCopter/control_poshold.pde index c741748b2b..e2c571e786 100644 --- a/ArduCopter/control_poshold.pde +++ b/ArduCopter/control_poshold.pde @@ -641,8 +641,8 @@ static void poshold_get_wind_comp_lean_angles(int16_t &roll_angle, int16_t &pitc poshold.wind_comp_timer = 0; // convert earth frame desired accelerations to body frame roll and pitch lean angles - roll_angle = (float)fast_atan((-poshold.wind_comp_ef.x*ahrs.sin_yaw() + poshold.wind_comp_ef.y*ahrs.cos_yaw())/981)*(18000/(float)M_PI); - pitch_angle = (float)fast_atan(-(poshold.wind_comp_ef.x*ahrs.cos_yaw() + poshold.wind_comp_ef.y*ahrs.sin_yaw())/981)*(18000/(float)M_PI); + roll_angle = (float)fast_atan((-poshold.wind_comp_ef.x*ahrs.sin_yaw() + poshold.wind_comp_ef.y*ahrs.cos_yaw())/981)*(18000/M_PI_F); + pitch_angle = (float)fast_atan(-(poshold.wind_comp_ef.x*ahrs.cos_yaw() + poshold.wind_comp_ef.y*ahrs.sin_yaw())/981)*(18000/M_PI_F); } // poshold_roll_controller_to_pilot_override - initialises transition from a controller submode (brake or loiter) to a pilot override on roll axis