From 974e8362ae1134811c221ecd20b7f556662af22c Mon Sep 17 00:00:00 2001 From: rentt Date: Tue, 20 Oct 2015 13:23:53 +0800 Subject: [PATCH] arm-status and flight-mode flicker when connect the FlightControl(with OSD plug on) to GCS. Only happens when the FlightControl running ArduCopter3.3 or ArduPlane3.4. --- MinimOSD_Extra_Plane_Pre_release_Beta/MAVLink.ino | 10 ++++++++++ MinimOsd_Extra_Copter_Pre_release_Beta/MAVLink.ino | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/MinimOSD_Extra_Plane_Pre_release_Beta/MAVLink.ino b/MinimOSD_Extra_Plane_Pre_release_Beta/MAVLink.ino index 2782b70..53caba5 100644 --- a/MinimOSD_Extra_Plane_Pre_release_Beta/MAVLink.ino +++ b/MinimOSD_Extra_Plane_Pre_release_Beta/MAVLink.ino @@ -54,6 +54,16 @@ void read_mavlink(){ switch(msg.msgid) { case MAVLINK_MSG_ID_HEARTBEAT: { + if((msg.compid != 1) && (msg.compid != 50)){ + // MAVMSG not from ardupilot(component ID:1) or pixhawk(component ID:50) + break; + } + + uint8_t mavtype = mavlink_msg_heartbeat_get_type(&msg); + if(mavtype == 6){ + // MAVMSG from GCS + break; + } mavbeat = 1; apm_mav_system = msg.sysid; apm_mav_component = msg.compid; diff --git a/MinimOsd_Extra_Copter_Pre_release_Beta/MAVLink.ino b/MinimOsd_Extra_Copter_Pre_release_Beta/MAVLink.ino index 9bd2831..6a8de55 100644 --- a/MinimOsd_Extra_Copter_Pre_release_Beta/MAVLink.ino +++ b/MinimOsd_Extra_Copter_Pre_release_Beta/MAVLink.ino @@ -54,6 +54,16 @@ void read_mavlink(){ switch(msg.msgid) { case MAVLINK_MSG_ID_HEARTBEAT: { + if((msg.compid != 1) && (msg.compid != 50)){ + //MAVMSG not from ardupilot(component ID:1) or pixhawk(component ID:50) + break; + } + + uint8_t mavtype = mavlink_msg_heartbeat_get_type(&msg); + if(mavtype == 6){ + // MAVMSG from GCS + break; + } mavbeat = 1; apm_mav_system = msg.sysid; apm_mav_component = msg.compid;