diff --git a/Controls/ConnectionOptions.cs b/Controls/ConnectionOptions.cs index 550f5619e2..08be229c29 100644 --- a/Controls/ConnectionOptions.cs +++ b/Controls/ConnectionOptions.cs @@ -32,10 +32,16 @@ private void BUT_connect_Click(object sender, EventArgs e) try { - MainV2.instance.doConnect(mav, CMB_serialport.Text, CMB_baudrate.Text); - - MainV2.Comports.Add(mav); - + // Connect, but don't try to get params yet, the serial reader thread doesn't try to + // read from this port until we add it to Comports, and it cannot be added to Comports + // until the BaseStream is open. + MainV2.instance.doConnect(mav, CMB_serialport.Text, CMB_baudrate.Text, getparams:false); + + MainV2.Comports.Add(mav); + + // It is now safe to fetch params + mav.getParamList(); + MainV2._connectionControl.UpdateSysIDS(); } catch (Exception) diff --git a/Program.cs b/Program.cs index d8d4dc6127..375e5f04ff 100644 --- a/Program.cs +++ b/Program.cs @@ -385,7 +385,11 @@ public static void Start(string[] args) // generic status report screen MAVLinkInterface.CreateIProgressReporterDialogue += title => - new ProgressReporterDialogue() {StartPosition = FormStartPosition.CenterScreen, Text = title}; + { + var ret = new ProgressReporterDialogue() {StartPosition = FormStartPosition.CenterScreen, Text = title}; + ThemeManager.ApplyThemeTo(ret); + return ret; + }; Console.WriteLine("Setup proxy"); try