Plane: only send GPS_RAW_INT if new data

this reduces link load when asking for high rate telemetry
This commit is contained in:
Andrew Tridgell 2013-11-05 14:40:51 +11:00
parent 5e4b243c7b
commit 78604bd84e

View File

@ -279,6 +279,11 @@ static void NOINLINE send_nav_controller_output(mavlink_channel_t chan)
static void NOINLINE send_gps_raw(mavlink_channel_t chan)
{
static uint32_t last_send_time;
if (last_send_time != 0 && last_send_time == g_gps->last_fix_time) {
return;
}
last_send_time = g_gps->last_fix_time;
mavlink_msg_gps_raw_int_send(
chan,
g_gps->last_fix_time*(uint64_t)1000,