mirror of https://github.com/ArduPilot/ardupilot
APM Planner 1.1.15
fix reset issue add Circle AP Mode change time to wait to 17 secs
This commit is contained in:
parent
cd145fd7a9
commit
8b2f14c40a
|
@ -27,6 +27,8 @@ namespace ArdupilotMega
|
|||
//void Write(char[] buffer, int offset, int count);
|
||||
void WriteLine(string text);
|
||||
|
||||
void toggleDTR();
|
||||
|
||||
// Properties
|
||||
//Stream BaseStream { get; }
|
||||
int BaudRate { get; set; }
|
||||
|
|
|
@ -9,5 +9,12 @@ namespace ArdupilotMega
|
|||
class SerialPort : System.IO.Ports.SerialPort,ICommsSerial
|
||||
{
|
||||
|
||||
|
||||
public void toggleDTR()
|
||||
{
|
||||
DtrEnable = true;
|
||||
System.Threading.Thread.Sleep(100);
|
||||
DtrEnable = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,10 @@ namespace System.IO.Ports
|
|||
Port = "5760";
|
||||
}
|
||||
|
||||
public void toggleDTR()
|
||||
{
|
||||
}
|
||||
|
||||
public string Port { get; set; }
|
||||
|
||||
public int ReadTimeout
|
||||
|
|
|
@ -35,6 +35,10 @@ namespace System.IO.Ports
|
|||
Port = "14550";
|
||||
}
|
||||
|
||||
public void toggleDTR()
|
||||
{
|
||||
}
|
||||
|
||||
public string Port { get; set; }
|
||||
|
||||
public int ReadTimeout
|
||||
|
|
|
@ -461,7 +461,7 @@ namespace ArdupilotMega
|
|||
}
|
||||
break;
|
||||
case (byte)ArdupilotMega.MAVLink.MAV_MODE.MAV_MODE_TEST3:
|
||||
mode = "FBW B";
|
||||
mode = "Circle";
|
||||
break;
|
||||
case (byte)ArdupilotMega.MAVLink.MAV_MODE.MAV_MODE_AUTO:
|
||||
switch (sysstatus.nav_mode)
|
||||
|
|
|
@ -693,7 +693,7 @@ namespace ArdupilotMega.GCSViews
|
|||
}
|
||||
}
|
||||
|
||||
lbl_status.Text = "Write Done... Waiting (90 sec)";
|
||||
lbl_status.Text = "Write Done... Waiting (17 sec)";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -714,7 +714,7 @@ namespace ArdupilotMega.GCSViews
|
|||
|
||||
DateTime startwait = DateTime.Now;
|
||||
|
||||
while ((DateTime.Now - startwait).TotalSeconds < 75)
|
||||
while ((DateTime.Now - startwait).TotalSeconds < 17)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -722,7 +722,7 @@ namespace ArdupilotMega.GCSViews
|
|||
}
|
||||
catch { }
|
||||
System.Threading.Thread.Sleep(1000);
|
||||
progress.Value = (int)((DateTime.Now - startwait).TotalSeconds / 75 * 100);
|
||||
progress.Value = (int)((DateTime.Now - startwait).TotalSeconds / 17 * 100);
|
||||
progress.Refresh();
|
||||
}
|
||||
try
|
||||
|
|
|
@ -172,14 +172,14 @@ namespace ArdupilotMega.GCSViews
|
|||
if (comPort.IsOpen)
|
||||
comPort.Close();
|
||||
|
||||
comPort.DtrEnable = true;
|
||||
|
||||
comPort.ReadBufferSize = 1024 * 1024;
|
||||
|
||||
comPort.PortName = MainV2.comportname;
|
||||
|
||||
comPort.Open();
|
||||
|
||||
comPort.toggleDTR();
|
||||
|
||||
System.Threading.Thread t11 = new System.Threading.Thread(delegate()
|
||||
{
|
||||
threadrun = true;
|
||||
|
|
|
@ -69,9 +69,7 @@ namespace ArdupilotMega
|
|||
//comPort.ReadBufferSize = 1024 * 1024;
|
||||
try
|
||||
{
|
||||
comPort.DtrEnable = false;
|
||||
System.Threading.Thread.Sleep(100);
|
||||
comPort.DtrEnable = true;
|
||||
comPort.toggleDTR();
|
||||
//comPort.Open();
|
||||
}
|
||||
catch (Exception)
|
||||
|
|
|
@ -98,10 +98,7 @@ namespace ArdupilotMega
|
|||
|
||||
BaseStream.DiscardInBuffer();
|
||||
|
||||
System.Threading.Thread.Sleep(200); // allow reset to work
|
||||
|
||||
if (BaseStream.DtrEnable)
|
||||
BaseStream.DtrEnable = false;
|
||||
BaseStream.toggleDTR();
|
||||
|
||||
// allow 2560 connect timeout on usb
|
||||
System.Threading.Thread.Sleep(1000);
|
||||
|
|
|
@ -685,7 +685,7 @@ namespace ArdupilotMega
|
|||
comPort.BaseStream.DtrEnable = false;
|
||||
|
||||
if (config["CHK_resetapmonconnect"] == null || bool.Parse(config["CHK_resetapmonconnect"].ToString()) == true)
|
||||
comPort.BaseStream.DtrEnable = true;
|
||||
comPort.BaseStream.toggleDTR();
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -1047,6 +1047,8 @@ namespace ArdupilotMega
|
|||
{
|
||||
this.MenuConnect.BackgroundImage = global::ArdupilotMega.Properties.Resources.disconnect;
|
||||
this.MenuConnect.BackgroundImage.Tag = "Disconnect";
|
||||
CMB_baudrate.Enabled = false;
|
||||
CMB_serialport.Enabled = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1058,6 +1060,8 @@ namespace ArdupilotMega
|
|||
{
|
||||
this.MenuConnect.BackgroundImage = global::ArdupilotMega.Properties.Resources.connect;
|
||||
this.MenuConnect.BackgroundImage.Tag = "Connect";
|
||||
CMB_baudrate.Enabled = true;
|
||||
CMB_serialport.Enabled = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,5 +34,5 @@ using System.Resources;
|
|||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.1.14")]
|
||||
[assembly: AssemblyFileVersion("1.1.15")]
|
||||
[assembly: NeutralResourcesLanguageAttribute("")]
|
||||
|
|
|
@ -811,11 +811,11 @@ namespace ArdupilotMega.Setup
|
|||
}
|
||||
catch (Exception ex) { MainV2.givecomport = false; MessageBox.Show("Invalid Comport Settings : " + ex.Message); return; }
|
||||
|
||||
BUT_reset.Text = "Rebooting (75 sec)";
|
||||
BUT_reset.Text = "Rebooting (17 sec)";
|
||||
BUT_reset.Refresh();
|
||||
Application.DoEvents();
|
||||
|
||||
Sleep(75000, comPortT); // wait for boot/reset
|
||||
Sleep(17000, comPortT); // wait for boot/reset
|
||||
|
||||
comPortT.DtrEnable = false;
|
||||
|
||||
|
|
Loading…
Reference in New Issue