From 93ac82e1f6e5d9ca5c6cb85870e1ec62a09c066e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 29 Feb 2016 21:24:33 +1100 Subject: [PATCH] Plane: write voltage/current much more frequently --- ArduPlane/ArduPlane.cpp | 3 --- ArduPlane/sensors.cpp | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ArduPlane/ArduPlane.cpp b/ArduPlane/ArduPlane.cpp index 663381200d..f38ae7d794 100644 --- a/ArduPlane/ArduPlane.cpp +++ b/ArduPlane/ArduPlane.cpp @@ -307,9 +307,6 @@ void Plane::update_aux(void) void Plane::one_second_loop() { - if (should_log(MASK_LOG_CURRENT)) - Log_Write_Current(); - // send a heartbeat gcs_send_message(MSG_HEARTBEAT); diff --git a/ArduPlane/sensors.cpp b/ArduPlane/sensors.cpp index 5ced8f0442..462292a515 100644 --- a/ArduPlane/sensors.cpp +++ b/ArduPlane/sensors.cpp @@ -128,6 +128,10 @@ void Plane::read_battery(void) battery.exhausted(g.fs_batt_voltage, g.fs_batt_mah)) { low_battery_event(); } + + if (should_log(MASK_LOG_CURRENT)) { + Log_Write_Current(); + } } // read the receiver RSSI as an 8 bit number for MAVLink