//Load custom firmware (old CTRL+C shortcut) private void Custom_firmware_label_Click(object sender, EventArgs e) { var fd = new OpenFileDialog { Filter = "Firmware (*.hex;*.px4)|*.hex;*.px4" }; if (Directory.Exists(custom_fw_dir)) { fd.InitialDirectory = custom_fw_dir; } fd.ShowDialog(); if (File.Exists(fd.FileName)) { custom_fw_dir = Path.GetDirectoryName(fd.FileName); fw.Progress -= fw_Progress; fw.Progress += fw_Progress1; BoardDetect.boards boardtype = BoardDetect.boards.none; try { boardtype = BoardDetect.DetectBoard(MainV2.comPortName); } catch { CustomMessageBox.Show("Can not connect to com port and detect board type", "Error"); return; } fw.UploadFlash(MainV2.comPortName, fd.FileName, boardtype); } }
//Load custom firmware (old CTRL+C shortcut) private void Custom_firmware_label_Click(object sender, EventArgs e) { var fd = new OpenFileDialog { Filter = "Firmware (*.hex;*.px4)|*.hex;*.px4" }; fd.ShowDialog(); if (File.Exists(fd.FileName)) { fw.Progress -= fw_Progress; fw.Progress += fw_Progress1; string boardtype = ""; try { boardtype = ArduinoDetect.DetectBoard(MainV2.comPortName); } catch { CustomMessageBox.Show("Can not connect to com port and detect board type", "Error"); return; } fw.UploadFlash(MainV2.comPortName, fd.FileName, boardtype); } }