|
|
|
@ -194,8 +194,10 @@ static NOINLINE void send_extended_status1(mavlink_channel_t chan, uint16_t pack
@@ -194,8 +194,10 @@ static NOINLINE void send_extended_status1(mavlink_channel_t chan, uint16_t pack
|
|
|
|
|
|
|
|
|
|
static void NOINLINE send_meminfo(mavlink_channel_t chan) |
|
|
|
|
{ |
|
|
|
|
#if CONFIG_HAL_BOARD != HAL_BOARD_AVR_SITL |
|
|
|
|
extern unsigned __brkval; |
|
|
|
|
mavlink_msg_meminfo_send(chan, __brkval, memcheck_available_memory()); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void NOINLINE send_location(mavlink_channel_t chan) |
|
|
|
@ -252,7 +254,7 @@ static void NOINLINE send_ahrs(mavlink_channel_t chan)
@@ -252,7 +254,7 @@ static void NOINLINE send_ahrs(mavlink_channel_t chan)
|
|
|
|
|
ahrs.get_error_yaw()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifdef DESKTOP_BUILD |
|
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL |
|
|
|
|
// report simulator state |
|
|
|
|
static void NOINLINE send_simstate(mavlink_channel_t chan) |
|
|
|
|
{ |
|
|
|
@ -260,7 +262,6 @@ static void NOINLINE send_simstate(mavlink_channel_t chan)
@@ -260,7 +262,6 @@ static void NOINLINE send_simstate(mavlink_channel_t chan)
|
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#ifndef DESKTOP_BUILD |
|
|
|
|
static void NOINLINE send_hwstatus(mavlink_channel_t chan) |
|
|
|
|
{ |
|
|
|
|
mavlink_msg_hwstatus_send( |
|
|
|
@ -268,8 +269,6 @@ static void NOINLINE send_hwstatus(mavlink_channel_t chan)
@@ -268,8 +269,6 @@ static void NOINLINE send_hwstatus(mavlink_channel_t chan)
|
|
|
|
|
board_voltage(), |
|
|
|
|
hal.i2c->lockup_count()); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void NOINLINE send_gps_raw(mavlink_channel_t chan) |
|
|
|
|
{ |
|
|
|
@ -639,17 +638,15 @@ static bool mavlink_try_send_message(mavlink_channel_t chan, enum ap_message id,
@@ -639,17 +638,15 @@ static bool mavlink_try_send_message(mavlink_channel_t chan, enum ap_message id,
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case MSG_SIMSTATE: |
|
|
|
|
#ifdef DESKTOP_BUILD |
|
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL |
|
|
|
|
CHECK_PAYLOAD_SIZE(SIMSTATE); |
|
|
|
|
send_simstate(chan); |
|
|
|
|
#endif |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case MSG_HWSTATUS: |
|
|
|
|
#ifndef DESKTOP_BUILD |
|
|
|
|
CHECK_PAYLOAD_SIZE(HWSTATUS); |
|
|
|
|
send_hwstatus(chan); |
|
|
|
|
#endif |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case MSG_RETRY_DEFERRED: |
|
|
|
@ -955,13 +952,7 @@ GCS_MAVLINK::send_message(enum ap_message id)
@@ -955,13 +952,7 @@ GCS_MAVLINK::send_message(enum ap_message id)
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
GCS_MAVLINK::send_text(gcs_severity severity, const char *str) |
|
|
|
|
{ |
|
|
|
|
mavlink_send_text(chan,severity,str); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
GCS_MAVLINK::send_text(gcs_severity severity, const prog_char_t *str) |
|
|
|
|
GCS_MAVLINK::send_text_P(gcs_severity severity, const prog_char_t *str) |
|
|
|
|
{ |
|
|
|
|
mavlink_statustext_t m; |
|
|
|
|
uint8_t i; |
|
|
|
@ -1062,7 +1053,7 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
@@ -1062,7 +1053,7 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
|
|
|
|
|
uint8_t result = MAV_RESULT_UNSUPPORTED; |
|
|
|
|
|
|
|
|
|
// do command |
|
|
|
|
send_text(SEVERITY_LOW,PSTR("command received: ")); |
|
|
|
|
send_text_P(SEVERITY_LOW,PSTR("command received: ")); |
|
|
|
|
|
|
|
|
|
switch(packet.command) { |
|
|
|
|
|
|
|
|
@ -1642,7 +1633,7 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
@@ -1642,7 +1633,7 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
|
|
|
|
|
msg->compid, |
|
|
|
|
type); |
|
|
|
|
|
|
|
|
|
send_text(SEVERITY_LOW,PSTR("flight plan received")); |
|
|
|
|
send_text_P(SEVERITY_LOW,PSTR("flight plan received")); |
|
|
|
|
waypoint_receiving = false; |
|
|
|
|
// XXX ignores waypoint radius for individual waypoints, can |
|
|
|
|
// only set WP_RADIUS parameter |
|
|
|
@ -1944,7 +1935,7 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
@@ -1944,7 +1935,7 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
|
|
|
|
|
mavlink_fence_point_t packet; |
|
|
|
|
mavlink_msg_fence_point_decode(msg, &packet); |
|
|
|
|
if (packet.count != geofence_limit.fence_total()) { |
|
|
|
|
send_text(SEVERITY_LOW,PSTR("bad fence point")); |
|
|
|
|
send_text_P(SEVERITY_LOW,PSTR("bad fence point")); |
|
|
|
|
} else { |
|
|
|
|
Vector2l point; |
|
|
|
|
point.x = packet.lat*1.0e7; |
|
|
|
@ -1960,7 +1951,7 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
@@ -1960,7 +1951,7 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg)
|
|
|
|
|
if (mavlink_check_target(packet.target_system, packet.target_component)) |
|
|
|
|
break; |
|
|
|
|
if (packet.idx >= geofence_limit.fence_total()) { |
|
|
|
|
send_text(SEVERITY_LOW,PSTR("bad fence point")); |
|
|
|
|
send_text_P(SEVERITY_LOW,PSTR("bad fence point")); |
|
|
|
|
} else { |
|
|
|
|
Vector2l point = geofence_limit.get_fence_point_with_index(packet.idx); |
|
|
|
|
mavlink_msg_fence_point_send(chan, 0, 0, packet.idx, geofence_limit.fence_total(), |
|
|
|
@ -2111,19 +2102,11 @@ static void gcs_update(void)
@@ -2111,19 +2102,11 @@ static void gcs_update(void)
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void gcs_send_text(gcs_severity severity, const char *str) |
|
|
|
|
{ |
|
|
|
|
gcs0.send_text(severity, str); |
|
|
|
|
if (gcs3.initialised) { |
|
|
|
|
gcs3.send_text(severity, str); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void gcs_send_text_P(gcs_severity severity, const prog_char_t *str) |
|
|
|
|
{ |
|
|
|
|
gcs0.send_text(severity, str); |
|
|
|
|
gcs0.send_text_P(severity, str); |
|
|
|
|
if (gcs3.initialised) { |
|
|
|
|
gcs3.send_text(severity, str); |
|
|
|
|
gcs3.send_text_P(severity, str); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|