Browse Source

Copter: Log Emergency Stop and Motor Interlock status

mission-4.1.18
Robert Lefebvre 10 years ago committed by Randy Mackay
parent
commit
41a6cc64ff
  1. 7
      ArduCopter/AP_State.pde
  2. 4
      ArduCopter/defines.h
  3. 7
      ArduCopter/switches.pde

7
ArduCopter/AP_State.pde

@ -151,4 +151,11 @@ void set_motor_emergency_stop(bool b) @@ -151,4 +151,11 @@ void set_motor_emergency_stop(bool b)
if(ap.motor_emergency_stop != b) {
ap.motor_emergency_stop = b;
}
// Log new status
if (ap.motor_emergency_stop){
Log_Write_Event(DATA_MOTORS_EMERGENCY_STOPPED);
} else {
Log_Write_Event(DATA_MOTORS_EMERGENCY_STOP_CLEARED);
}
}

4
ArduCopter/defines.h

@ -306,6 +306,10 @@ enum FlipState { @@ -306,6 +306,10 @@ enum FlipState {
#define DATA_PARACHUTE_RELEASED 51
#define DATA_LANDING_GEAR_DEPLOYED 52
#define DATA_LANDING_GEAR_RETRACTED 53
#define DATA_MOTORS_EMERGENCY_STOPPED 54
#define DATA_MOTORS_EMERGENCY_STOP_CLEARED 55
#define DATA_MOTORS_INTERLOCK_DISABLED 56
#define DATA_MOTORS_INTERLOCK_ENABLED 57
// Centi-degrees to radians
#define DEGX100 5729.57795f

7
ArduCopter/switches.pde

@ -564,6 +564,13 @@ static void do_aux_switch_function(int8_t ch_function, uint8_t ch_flag) @@ -564,6 +564,13 @@ static void do_aux_switch_function(int8_t ch_function, uint8_t ch_flag)
// Turn on when above LOW, because channel will also be used for speed
// control signal in tradheli
motors.set_interlock(ch_flag == AUX_SWITCH_HIGH || ch_flag == AUX_SWITCH_MIDDLE);
// Log new status
if (motors.get_interlock()){
Log_Write_Event(DATA_MOTORS_INTERLOCK_ENABLED);
} else {
Log_Write_Event(DATA_MOTORS_INTERLOCK_DISABLED);
}
break;
}

Loading…
Cancel
Save