mirror of https://github.com/ArduPilot/ardupilot
SRV_Channel: add ARM/MOTOR_EMERGENCY_STOP Aux Switch
This commit is contained in:
parent
451ed0aede
commit
61b0f23ee2
|
@ -538,9 +538,7 @@ public:
|
|||
static bool have_digital_outputs() { return digital_mask != 0; }
|
||||
|
||||
// Set E - stop
|
||||
static void set_emergency_stop(bool state) {
|
||||
emergency_stop = state;
|
||||
}
|
||||
static void set_emergency_stop(bool state);
|
||||
|
||||
// get E - stop
|
||||
static bool get_emergency_stop() { return emergency_stop;}
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include <AP_Math/AP_Math.h>
|
||||
#include <AP_Vehicle/AP_Vehicle.h>
|
||||
#include "SRV_Channel.h"
|
||||
#include <AP_Logger/AP_Logger.h>
|
||||
|
||||
#if HAL_MAX_CAN_PROTOCOL_DRIVERS
|
||||
#include <AP_CANManager/AP_CANManager.h>
|
||||
|
@ -602,3 +603,16 @@ bool SRV_Channels::is_GPIO(uint8_t channel)
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set E - stop
|
||||
void SRV_Channels::set_emergency_stop(bool state) {
|
||||
#if HAL_LOGGING_ENABLED
|
||||
if (state != emergency_stop) {
|
||||
AP_Logger *logger = AP_Logger::get_singleton();
|
||||
if (logger && logger->logging_enabled()) {
|
||||
logger->Write_Event(state ? LogEvent::MOTORS_EMERGENCY_STOPPED : LogEvent::MOTORS_EMERGENCY_STOP_CLEARED);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
emergency_stop = state;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue