mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_Arming: move Log_Write_Arm_Disarm in, make disarm virtual
This commit is contained in:
parent
d384827291
commit
aff6cb424f
@ -900,6 +900,17 @@ bool AP_Arming::rc_checks_copter_sub(const bool display_failure, const RC_Channe
|
||||
return ret;
|
||||
}
|
||||
|
||||
void AP_Arming::Log_Write_Arm_Disarm()
|
||||
{
|
||||
struct log_Arm_Disarm pkt = {
|
||||
LOG_PACKET_HEADER_INIT(LOG_ARM_DISARM_MSG),
|
||||
time_us : AP_HAL::micros64(),
|
||||
arm_state : is_armed(),
|
||||
arm_checks : get_enabled_checks()
|
||||
};
|
||||
AP::logger().WriteCriticalBlock(&pkt, sizeof(pkt));
|
||||
}
|
||||
|
||||
AP_Arming *AP_Arming::_singleton = nullptr;
|
||||
|
||||
/*
|
||||
|
@ -51,7 +51,7 @@ public:
|
||||
// these functions should not be used by Copter which holds the armed state in the motors library
|
||||
Required arming_required();
|
||||
virtual bool arm(AP_Arming::Method method, bool do_arming_checks=true);
|
||||
bool disarm();
|
||||
virtual bool disarm();
|
||||
bool is_armed();
|
||||
|
||||
// get bitmask of enabled checks
|
||||
@ -133,6 +133,8 @@ protected:
|
||||
// handle the case where a check fails
|
||||
void check_failed(const enum AP_Arming::ArmingChecks check, bool report, const char *fmt, ...) const;
|
||||
|
||||
void Log_Write_Arm_Disarm();
|
||||
|
||||
private:
|
||||
|
||||
static AP_Arming *_singleton;
|
||||
|
Loading…
Reference in New Issue
Block a user