Exemple #1
0
        private void btnTest_Click(object sender, EventArgs e)
        {
            var iface = cbQuickInterface.SelectedItem as QuickSetupDatabase.ProgrammingInterface;

            if (iface != null && iface.UsbIdentities != null && iface.UsbIdentities.Length > 0)
            {
                if (!UsbDriverHelper.TryCheckDeviceAndInstallDriversInteractively(iface.UsbIdentities, iface.UniversalDriverId))
                {
                    return;
                }
            }

            Process process = new Process();

            process.StartInfo.FileName         = _OpenOCDDirectory + @"\bin\openocd.exe";
            process.StartInfo.WorkingDirectory = _OpenOCDDirectory + @"\share\openocd\scripts";
            process.StartInfo.Arguments        = CommandLineTools.BuildCommandLine(_Method.GDBServerArguments, new Dictionary <string, string>(), Configuration);

            using (var frm = new CommandTestForm(process))
            {
                frm.ShowDialog();
                string output = frm.AllOutput;
                if (output.Contains("An adapter speed is not selected in the init script") && !cbQuickSpeed.Checked)
                {
                    if (MessageBox.Show("OpenOCD could not determine JTAG speed. Do you want to specify it explicitly?", "VisualGDB", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                    {
                        cbQuickSpeed.Checked = true;
                        numSpeed2.Focus();
                    }
                }
            }
        }
        private void btnTest_Click(object sender, EventArgs e)
        {
            var iface = cbQuickInterface.SelectedItem as QuickSetupDatabase.ProgrammingInterface;
            if (iface != null && iface.UsbIdentities != null && iface.UsbIdentities.Length > 0)
                if (!UsbDriverHelper.TryCheckDeviceAndInstallDriversInteractively(iface.UsbIdentities, iface.UniversalDriverId))
                    return;

            Process process = new Process();
            process.StartInfo.FileName = _OpenOCDDirectory + @"\bin\openocd.exe";
            process.StartInfo.WorkingDirectory = _OpenOCDDirectory + @"\share\openocd\scripts";
            process.StartInfo.Arguments = CommandLineTools.BuildCommandLine(_Method.GDBServerArguments, new Dictionary<string, string>(), Configuration);

            using (var frm = new CommandTestForm(process))
            {
                frm.ShowDialog();
                string output = frm.AllOutput;
                if (output.Contains("An adapter speed is not selected in the init script") && !cbQuickSpeed.Checked)
                    if (MessageBox.Show("OpenOCD could not determine JTAG speed. Do you want to specify it explicitly?", "VisualGDB", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                    {
                        cbQuickSpeed.Checked = true;
                        numSpeed2.Focus();
                    }
            }
        }