Plane: Move battery logging code to AP_BattMonitor
This commit is contained in:
parent
725f1a2f2b
commit
43972f8e56
@ -263,14 +263,6 @@ struct PACKED log_Arm_Disarm {
|
||||
uint16_t arm_checks;
|
||||
};
|
||||
|
||||
void Plane::Log_Write_Current()
|
||||
{
|
||||
DataFlash.Log_Write_Current(battery);
|
||||
|
||||
// also write power status
|
||||
DataFlash.Log_Write_Power();
|
||||
}
|
||||
|
||||
void Plane::Log_Arm_Disarm() {
|
||||
struct log_Arm_Disarm pkt = {
|
||||
LOG_PACKET_HEADER_INIT(LOG_ARM_DISARM_MSG),
|
||||
@ -439,7 +431,6 @@ void Plane::Log_Write_Sonar() {}
|
||||
void Plane::Log_Write_Optflow() {}
|
||||
#endif
|
||||
|
||||
void Plane::Log_Write_Current() {}
|
||||
void Plane::Log_Arm_Disarm() {}
|
||||
void Plane::Log_Write_GPS(uint8_t instance) {}
|
||||
void Plane::Log_Write_IMU() {}
|
||||
|
@ -391,7 +391,7 @@ private:
|
||||
int32_t altitude_error_cm;
|
||||
|
||||
// Battery Sensors
|
||||
AP_BattMonitor battery;
|
||||
AP_BattMonitor battery{MASK_LOG_CURRENT};
|
||||
|
||||
#if FRSKY_TELEM_ENABLED == ENABLED
|
||||
// FrSky telemetry support
|
||||
@ -834,7 +834,6 @@ private:
|
||||
void Log_Write_Status();
|
||||
void Log_Write_Sonar();
|
||||
void Log_Write_Optflow();
|
||||
void Log_Write_Current();
|
||||
void Log_Arm_Disarm();
|
||||
void Log_Write_GPS(uint8_t instance);
|
||||
void Log_Write_IMU();
|
||||
|
@ -127,13 +127,6 @@ void Plane::read_battery(void)
|
||||
battery.exhausted(g.fs_batt_voltage, g.fs_batt_mah)) {
|
||||
low_battery_event();
|
||||
}
|
||||
if (battery.get_type() != AP_BattMonitor_Params::BattMonitor_TYPE_NONE) {
|
||||
AP_Notify::flags.battery_voltage = battery.voltage();
|
||||
}
|
||||
|
||||
if (should_log(MASK_LOG_CURRENT)) {
|
||||
Log_Write_Current();
|
||||
}
|
||||
}
|
||||
|
||||
// read the receiver RSSI as an 8 bit number for MAVLink
|
||||
|
Loading…
Reference in New Issue
Block a user