From 2bf7a46c9b3cfc70ecff2544fef7ac6c1a3fe916 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 13 Feb 2014 22:10:23 +1100 Subject: [PATCH] Copter: log power status on Pixhawk --- ArduCopter/GCS_Mavlink.pde | 2 ++ ArduCopter/Log.pde | 3 +++ 2 files changed, 5 insertions(+) diff --git a/ArduCopter/GCS_Mavlink.pde b/ArduCopter/GCS_Mavlink.pde index dfb69026f5..bc01cb8c23 100644 --- a/ArduCopter/GCS_Mavlink.pde +++ b/ArduCopter/GCS_Mavlink.pde @@ -574,6 +574,8 @@ static bool mavlink_try_send_message(mavlink_channel_t chan, enum ap_message id, case MSG_EXTENDED_STATUS1: CHECK_PAYLOAD_SIZE(SYS_STATUS); send_extended_status1(chan, packet_drops); + CHECK_PAYLOAD_SIZE(POWER_STATUS); + gcs[chan-MAVLINK_COMM_0].send_power_status(); break; case MSG_EXTENDED_STATUS2: diff --git a/ArduCopter/Log.pde b/ArduCopter/Log.pde index 2e968e499b..ec253fef6d 100644 --- a/ArduCopter/Log.pde +++ b/ArduCopter/Log.pde @@ -228,6 +228,9 @@ static void Log_Write_Current() current_total : battery.current_total_mah() }; DataFlash.WriteBlock(&pkt, sizeof(pkt)); + + // also write power status + DataFlash.Log_Write_Power(); } struct PACKED log_Optflow {