diff --git a/ArduCopter/defines.h b/ArduCopter/defines.h index b1769aee09..6892e2c27f 100644 --- a/ArduCopter/defines.h +++ b/ArduCopter/defines.h @@ -312,6 +312,7 @@ enum FlipState { #define DATA_MOTORS_EMERGENCY_STOP_CLEARED 55 #define DATA_MOTORS_INTERLOCK_DISABLED 56 #define DATA_MOTORS_INTERLOCK_ENABLED 57 +#define DATA_ROTOR_RUNUP_COMPLETE 58 // Heli only // Centi-degrees to radians #define DEGX100 5729.57795f diff --git a/ArduCopter/heli.cpp b/ArduCopter/heli.cpp index 62e18b1ac8..804e5f8f31 100644 --- a/ArduCopter/heli.cpp +++ b/ArduCopter/heli.cpp @@ -132,6 +132,9 @@ void Copter::heli_update_landing_swash() // heli_update_rotor_speed_targets - reads pilot input and passes new rotor speed targets to heli motors object void Copter::heli_update_rotor_speed_targets() { + + static bool rotor_runup_complete_last = false; + // get rotor control method uint8_t rsc_control_mode = motors.get_rsc_mode(); int16_t rsc_control_deglitched = rotor_speed_deglitch_filter.apply(g.rc_8.control_in); @@ -153,6 +156,12 @@ void Copter::heli_update_rotor_speed_targets() } break; } + + // when rotor_runup_complete changes to true, log event + if (!rotor_runup_complete_last && motors.rotor_runup_complete()){ + Log_Write_Event(DATA_ROTOR_RUNUP_COMPLETE); + } + rotor_runup_complete_last = motors.rotor_runup_complete(); } // heli_radio_passthrough send RC inputs direct into motors library for use during manual passthrough for helicopter setup