From 635d4418c88623c2867b3b152d2006b5098617a3 Mon Sep 17 00:00:00 2001 From: "tridge60@gmail.com" Date: Thu, 1 Sep 2011 00:52:08 +0000 Subject: [PATCH] added memory reporting over MAVLink git-svn-id: https://arducopter.googlecode.com/svn/trunk@3207 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- ArduCopterMega/ArduCopterMega.pde | 2 ++ ArduCopterMega/Mavlink_Common.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/ArduCopterMega/ArduCopterMega.pde b/ArduCopterMega/ArduCopterMega.pde index 964021965b..e319cbad4e 100644 --- a/ArduCopterMega/ArduCopterMega.pde +++ b/ArduCopterMega/ArduCopterMega.pde @@ -64,6 +64,7 @@ And much more so PLEASE PM me on DIYDRONES to add your contribution to the List #include // Optical Flow library #include #include // MAVLink GCS definitions +#include // Configuration #include "defines.h" @@ -524,6 +525,7 @@ static byte loop_step; //////////////////////////////////////////////////////////////////////////////// void setup() { + memcheck_init(); init_ardupilot(); } diff --git a/ArduCopterMega/Mavlink_Common.h b/ArduCopterMega/Mavlink_Common.h index 168936d07b..5f744b375f 100644 --- a/ArduCopterMega/Mavlink_Common.h +++ b/ArduCopterMega/Mavlink_Common.h @@ -76,6 +76,11 @@ void mavlink_send_message(mavlink_channel_t chan, uint8_t id, uint32_t param, ui battery_voltage * 1000, battery_remaining, packet_drops); + +#ifdef MAVLINK_MSG_ID_MEMINFO + extern unsigned __brkval; + mavlink_msg_meminfo_send(chan, __brkval, memcheck_available_memory()); +#endif break; }