Skip to content

Commit

Permalink
clean-up start-up info, add links
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhumbert committed Sep 4, 2017
1 parent deffc75 commit f77f6c7
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 63 deletions.
70 changes: 35 additions & 35 deletions windows/QMK Toolbox/Flashing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ public void SetupDFU() {
startInfo_dfu.CreateNoWindow = true;


f.P("dfu-programmer --version", MessageType.Command);
startInfo_dfu.Arguments = "--version";
process_dfu.StartInfo = startInfo_dfu;
process_dfu.Start();
string output = process_dfu.StandardOutput.ReadToEnd();
output += process_dfu.StandardError.ReadToEnd();
process_dfu.WaitForExit();
f.R(output, MessageType.Command);
//f.P("dfu-programmer --version", MessageType.Command);
//startInfo_dfu.Arguments = "--version";
//process_dfu.StartInfo = startInfo_dfu;
//process_dfu.Start();
//string output = process_dfu.StandardOutput.ReadToEnd();
//output += process_dfu.StandardError.ReadToEnd();
//process_dfu.WaitForExit();
//f.R(output, MessageType.Command);
}

public void SetupAvrdude() {
Expand All @@ -97,15 +97,15 @@ public void SetupAvrdude() {
startInfo_avrdude.CreateNoWindow = true;


f.P("avrdude -v", MessageType.Command);
startInfo_avrdude.Arguments = "-v";
process_avrdude.StartInfo = startInfo_avrdude;
process_avrdude.Start();
string output = process_avrdude.StandardOutput.ReadToEnd();
output += process_avrdude.StandardError.ReadToEnd();
output = string.Join("\n", output.Split(new string[] { Environment.NewLine }, StringSplitOptions.None).Take(4));
process_avrdude.WaitForExit();
f.R(output.Substring(1) + "\n", MessageType.Command);
//f.P("avrdude -v", MessageType.Command);
//startInfo_avrdude.Arguments = "-v";
//process_avrdude.StartInfo = startInfo_avrdude;
//process_avrdude.Start();
//string output = process_avrdude.StandardOutput.ReadToEnd();
//output += process_avrdude.StandardError.ReadToEnd();
//output = string.Join("\n", output.Split(new string[] { Environment.NewLine }, StringSplitOptions.None).Take(4));
//process_avrdude.WaitForExit();
//f.R(output.Substring(1) + "\n", MessageType.Command);
}

public void SetupTeensy() {
Expand All @@ -118,15 +118,15 @@ public void SetupTeensy() {
startInfo_teensy.CreateNoWindow = true;


f.P("teensy_loader_cli --list-mcus", MessageType.Command);
startInfo_teensy.Arguments = "--list-mcus";
process_teensy.StartInfo = startInfo_teensy;
process_teensy.Start();
string output = process_teensy.StandardOutput.ReadToEnd();
output += process_teensy.StandardError.ReadToEnd();
//output = string.Join("\n", output.Split(new string[] { Environment.NewLine }, StringSplitOptions.None).Take(4));
process_teensy.WaitForExit();
f.R(output.Substring(0) + "\n", MessageType.Command);
//f.P("teensy_loader_cli --list-mcus", MessageType.Command);
//startInfo_teensy.Arguments = "--list-mcus";
//process_teensy.StartInfo = startInfo_teensy;
//process_teensy.Start();
//string output = process_teensy.StandardOutput.ReadToEnd();
//output += process_teensy.StandardError.ReadToEnd();
////output = string.Join("\n", output.Split(new string[] { Environment.NewLine }, StringSplitOptions.None).Take(4));
//process_teensy.WaitForExit();
//f.R(output.Substring(0) + "\n", MessageType.Command);
}

public void SetupDfuUtil() {
Expand All @@ -139,15 +139,15 @@ public void SetupDfuUtil() {
startInfo_dfuUtil.CreateNoWindow = true;


f.P("dfu-util -V", MessageType.Command);
startInfo_dfuUtil.Arguments = "-V";
process_dfuUtil.StartInfo = startInfo_dfuUtil;
process_dfuUtil.Start();
string output = process_dfuUtil.StandardOutput.ReadToEnd();
output += process_dfuUtil.StandardError.ReadToEnd();
output = string.Join("\n", output.Split(new string[] { Environment.NewLine }, StringSplitOptions.None).Take(6));
process_dfuUtil.WaitForExit();
f.R(output.Substring(0) + "\n", MessageType.Command);
//f.P("dfu-util -V", MessageType.Command);
//startInfo_dfuUtil.Arguments = "-V";
//process_dfuUtil.StartInfo = startInfo_dfuUtil;
//process_dfuUtil.Start();
//string output = process_dfuUtil.StandardOutput.ReadToEnd();
//output += process_dfuUtil.StandardError.ReadToEnd();
//output = string.Join("\n", output.Split(new string[] { Environment.NewLine }, StringSplitOptions.None).Take(6));
//process_dfuUtil.WaitForExit();
//f.R(output.Substring(0) + "\n", MessageType.Command);
}


Expand Down
89 changes: 67 additions & 22 deletions windows/QMK Toolbox/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 12 additions & 6 deletions windows/QMK Toolbox/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ public void R(string str, MessageType type) {
if (!InvokeRequired) {
Printing.colorResponse(richTextBox1, Printing.formatResponse(richTextBox1, str, type), type);
} else {
this.Invoke(new Action<string, MessageType>(R), new object[] { str, type });
try {
this.Invoke(new Action<string, MessageType>(R), new object[] { str, type });
} catch (Exception e) {

}
}
}

Expand Down Expand Up @@ -101,10 +105,12 @@ private void Form1_Load(object sender, EventArgs e) {
if (Settings.Default.hexFileCollection != null)
this.hexFileBox.Items.AddRange(Settings.Default.hexFileCollection.ToArray());

P("QMK Toolbox supports the following bootloaders:", MessageType.Info);
R(" - DFU (Atmel, LUFA)\n", MessageType.Info);
R(" - Caterina (Arduino, Pro Micros)\n", MessageType.Info);
R(" - Halfkay (Teensy, Ergodox EZ)\n", MessageType.Info);
P("QMK Toolbox (http://qmk.fm/toolbox)", MessageType.Info);
R("Supporting following bootloaders:\n", MessageType.Info);
R(" - DFU (Atmel, LUFA) via dfu-programmer (http://dfu-programmer.github.io/)\n", MessageType.Info);
R(" - Caterina (Arduino, Pro Micro) via avrdude (http://nongnu.org/avrdude/)\n", MessageType.Info);
R(" - Halfkay (Teensy, Ergodox EZ) via teensy_loader_cli (https://pjrc.com/teensy/loader_cli.html)\n", MessageType.Info);
R(" - STM32 (ARM) via dfu-util (http://dfu-util.sourceforge.net/)\n", MessageType.Info);

f.SetupDFU();
f.SetupAvrdude();
Expand Down Expand Up @@ -208,7 +214,7 @@ private bool DetectBootloader(ManagementBaseObject instance, bool connected = tr
device_name = "Halfkay";
f.halfkayAvailable = connected;
} else if (dfuUtil_pid.Success && dfuUtil_vid.Success) {
device_name = "Dfu Util";
device_name = "STM32";
f.dfuUtilAvailable = connected;
} else {
return false;
Expand Down

0 comments on commit f77f6c7

Please sign in to comment.