Tracker: moved gcs code to be more common

This commit is contained in:
Tom Pittenger 2015-07-24 10:08:20 -07:00 committed by Andrew Tridgell
parent 2319bdb068
commit 85027e1997
1 changed files with 1 additions and 4 deletions

View File

@ -8,9 +8,6 @@
// use this to prevent recursion during sensor init // use this to prevent recursion during sensor init
static bool in_mavlink_delay; static bool in_mavlink_delay;
// check if a message will fit in the payload space available
#define CHECK_PAYLOAD_SIZE(id) if (txspace < MAVLINK_NUM_NON_PAYLOAD_BYTES+MAVLINK_MSG_ID_ ## id ## _LEN) return false
/* /*
* !!NOTE!! * !!NOTE!!
* *
@ -178,7 +175,6 @@ void GCS_MAVLINK::handle_change_alt_request(AP_Mission::Mission_Command&)
// try to send a message, return false if it won't fit in the serial tx buffer // try to send a message, return false if it won't fit in the serial tx buffer
bool GCS_MAVLINK::try_send_message(enum ap_message id) bool GCS_MAVLINK::try_send_message(enum ap_message id)
{ {
uint16_t txspace = comm_get_txspace(chan);
switch (id) { switch (id) {
case MSG_HEARTBEAT: case MSG_HEARTBEAT:
CHECK_PAYLOAD_SIZE(HEARTBEAT); CHECK_PAYLOAD_SIZE(HEARTBEAT);
@ -286,6 +282,7 @@ bool GCS_MAVLINK::try_send_message(enum ap_message id)
case MSG_PID_TUNING: case MSG_PID_TUNING:
case MSG_VIBRATION: case MSG_VIBRATION:
case MSG_RPM: case MSG_RPM:
case MSG_MISSION_ITEM_REACHED:
break; // just here to prevent a warning break; // just here to prevent a warning
} }
return true; return true;