APM Planner - fix timeout bug

This commit is contained in:
Michael Oborne 2012-02-20 23:33:04 +08:00
parent ce4437578a
commit b00487513b
3 changed files with 6 additions and 1 deletions

View File

@ -1865,7 +1865,7 @@ namespace ArdupilotMega
int readcount = 0;
lastbad = new byte[2];
BaseStream.ReadTimeout = 100;
BaseStream.ReadTimeout = 500; // 500 ms between chars
DateTime start = DateTime.Now;

View File

@ -257,6 +257,11 @@ namespace ArdupilotMega
string[] ports = SerialPort.GetPortNames();
for (int a = 0; a < ports.Length; a++)
{
ports[a] = ports[a].TrimEnd();
}
string[] all = new string[devs.Length + ports.Length];
devs.CopyTo(all, 0);