added memory reporting over MAVLink

git-svn-id: https://arducopter.googlecode.com/svn/trunk@3207 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
tridge60@gmail.com 2011-09-01 00:52:08 +00:00
parent 5cac97ca8d
commit 635d4418c8
2 changed files with 7 additions and 0 deletions

View File

@ -64,6 +64,7 @@ And much more so PLEASE PM me on DIYDRONES to add your contribution to the List
#include <AP_OpticalFlow.h> // Optical Flow library
#include <ModeFilter.h>
#include <GCS_MAVLink.h> // MAVLink GCS definitions
#include <memcheck.h>
// Configuration
#include "defines.h"
@ -524,6 +525,7 @@ static byte loop_step;
////////////////////////////////////////////////////////////////////////////////
void setup() {
memcheck_init();
init_ardupilot();
}

View File

@ -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;
}