Skip to content

Commit

Permalink
MainV2: fix for baud recall on ports with a space
Browse files Browse the repository at this point in the history
  • Loading branch information
meee1 committed Jun 16, 2022
1 parent 574bb16 commit ac69cc5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MainV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1796,7 +1796,7 @@ public void doConnect(MAVLinkInterface comPort, string portname, string baud, bo
FlightData.CheckBatteryShow();

// save the baudrate for this port
Settings.Instance[_connectionControl.CMB_serialport.Text + "_BAUD"] =
Settings.Instance[_connectionControl.CMB_serialport.Text.Replace(" ","_") + "_BAUD"] =
_connectionControl.CMB_baudrate.Text;

this.Text = titlebar + " " + comPort.MAV.VersionString;
Expand Down Expand Up @@ -2040,10 +2040,10 @@ private void CMB_serialport_SelectedIndexChanged(object sender, EventArgs e)
try
{
// check for saved baud rate and restore
if (Settings.Instance[_connectionControl.CMB_serialport.Text + "_BAUD"] != null)
if (Settings.Instance[_connectionControl.CMB_serialport.Text.Replace(" ", "_") + "_BAUD"] != null)
{
_connectionControl.CMB_baudrate.Text =
Settings.Instance[_connectionControl.CMB_serialport.Text + "_BAUD"];
Settings.Instance[_connectionControl.CMB_serialport.Text.Replace(" ", "_") + "_BAUD"];
}
}
catch
Expand Down

0 comments on commit ac69cc5

Please sign in to comment.