Skip to content

Commit

Permalink
ConfigCubeID: add custom fw upload support
Browse files Browse the repository at this point in the history
  • Loading branch information
meee1 committed Aug 28, 2024
1 parent 1a55209 commit e2331bc
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 17 deletions.
16 changes: 15 additions & 1 deletion GCSViews/ConfigurationView/ConfigCubeID.Designer.cs

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

49 changes: 33 additions & 16 deletions GCSViews/ConfigurationView/ConfigCubeID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,13 @@ private void but_upfw_Click(object sender, EventArgs e)
done = false;
progress = 0.0;
offset = 0;
file = string.Empty;

/*
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "*.bin|*.bin";
if (ofd.ShowDialog() == DialogResult.OK)
{
file = ofd.FileName;
*/
ProgressReporterDialogue prd = new ProgressReporterDialogue();
ProgressReporterDialogue prd = new ProgressReporterDialogue();

prd.DoWork += Prd_DoWork;
prd.DoWork += Prd_DoWork;

prd.RunBackgroundOperationAsync();
//}
prd.RunBackgroundOperationAsync();
}

uint crc32_update(uint crc, byte[] data) {
Expand All @@ -68,11 +60,14 @@ uint crc32_update(uint crc, byte[] data) {

private void Prd_DoWork(Utilities.IProgressReporterDialogue sender)
{
file = Path.GetTempFileName();
if (!Download.getFilefromNet(url, file))
if (file == string.Empty)
{
sender.doWorkArgs.ErrorMessage = "Bad Download";
return;
file = Path.GetTempFileName();
if (!Download.getFilefromNet(url, file))
{
sender.doWorkArgs.ErrorMessage = "Bad Download";
return;
}
}

var firmware_data = File.ReadAllBytes(file);
Expand Down Expand Up @@ -169,5 +164,27 @@ public void Activate()
//SERIAL_PASS2
//SERIAL_PASSTIMO
}

private void but_customfw_Click(object sender, EventArgs e)
{
done = false;
progress = 0.0;
offset = 0;
file = string.Empty;

OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "*.bin|*.bin";

if (ofd.ShowDialog() == DialogResult.OK)
{
file = ofd.FileName;

ProgressReporterDialogue prd = new ProgressReporterDialogue();

prd.DoWork += Prd_DoWork;

prd.RunBackgroundOperationAsync();
}
}
}
}

0 comments on commit e2331bc

Please sign in to comment.