From 7bfcf98c93ad69f5bf3d52b26d6b77bcdc11cb32 Mon Sep 17 00:00:00 2001 From: Michael Oborne Date: Fri, 23 Aug 2024 11:46:53 +1000 Subject: [PATCH] ConfigCubeID: add force baud option (default on) --- .../ConfigurationView/ConfigCubeID.Designer.cs | 15 +++++++++++++++ GCSViews/ConfigurationView/ConfigCubeID.cs | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/GCSViews/ConfigurationView/ConfigCubeID.Designer.cs b/GCSViews/ConfigurationView/ConfigCubeID.Designer.cs index b111063f30..9583cf5f1a 100644 --- a/GCSViews/ConfigurationView/ConfigCubeID.Designer.cs +++ b/GCSViews/ConfigurationView/ConfigCubeID.Designer.cs @@ -35,6 +35,7 @@ private void InitializeComponent() this.mavnumtimeout = new MissionPlanner.Controls.MavlinkNumericUpDown(); this.mavpasscombo = new MissionPlanner.Controls.MavlinkComboBox(); this.label4 = new System.Windows.Forms.Label(); + this.CHK_forcebaud = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.mavnumtimeout)).BeginInit(); this.SuspendLayout(); // @@ -110,11 +111,24 @@ private void InitializeComponent() this.label4.TabIndex = 6; this.label4.Text = "Select the ODID device from the dropdown in the top right corner\r\nthen click the " + "Update Firmware button"; + // + // CHK_forcebaud + // + this.CHK_forcebaud.AutoSize = true; + this.CHK_forcebaud.Checked = true; + this.CHK_forcebaud.CheckState = System.Windows.Forms.CheckState.Checked; + this.CHK_forcebaud.Location = new System.Drawing.Point(141, 160); + this.CHK_forcebaud.Name = "CHK_forcebaud"; + this.CHK_forcebaud.Size = new System.Drawing.Size(113, 17); + this.CHK_forcebaud.TabIndex = 7; + this.CHK_forcebaud.Text = "Force 57600 baud"; + this.CHK_forcebaud.UseVisualStyleBackColor = true; // // ConfigCubeID // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.CHK_forcebaud); this.Controls.Add(this.label3); this.Controls.Add(this.label2); this.Controls.Add(this.mavnumtimeout); @@ -139,5 +153,6 @@ private void InitializeComponent() private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label4; + private System.Windows.Forms.CheckBox CHK_forcebaud; } } diff --git a/GCSViews/ConfigurationView/ConfigCubeID.cs b/GCSViews/ConfigurationView/ConfigCubeID.cs index bd92de9ebe..4f3dda6c59 100644 --- a/GCSViews/ConfigurationView/ConfigCubeID.cs +++ b/GCSViews/ConfigurationView/ConfigCubeID.cs @@ -83,7 +83,8 @@ private void Prd_DoWork(Utilities.IProgressReporterDialogue sender) bool seenresp = false; - MainV2.comPort.BaseStream.BaudRate = 57600; + if (CHK_forcebaud.Checked) + MainV2.comPort.BaseStream.BaudRate = 57600; var subid = MainV2.comPort.SubscribeToPacketType(MAVLink.MAVLINK_MSG_ID.CUBEPILOT_FIRMWARE_UPDATE_RESP, msg => {