Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 45 additions & 29 deletions windows/QMK Toolbox/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,19 +293,23 @@

if (!windowState.AutoFlashEnabled)
{
Invoke(new Action(DisableUI));
DisableUI();
}

foreach (BootloaderDevice b in FindBootloaders())
var bootloaders = FindBootloaders();
await Task.Run(async () =>

Check failure on line 300 in windows/QMK Toolbox/MainWindow.cs

View workflow job for this annotation

GitHub Actions / Build (Windows)

The name 'Task' does not exist in the current context
{
logTextBox.LogBootloader("Attempting to flash, please don't remove device");
await b.Flash(selectedMcu, filePath);
logTextBox.LogBootloader("Flash complete");
}
foreach (BootloaderDevice b in bootloaders)
{
Invoke(new Action(() => logTextBox.LogBootloader("Attempting to flash, please don't remove device")));
await b.Flash(selectedMcu, filePath);
Invoke(new Action(() => logTextBox.LogBootloader("Flash complete")));
}
});

if (!windowState.AutoFlashEnabled)
{
Invoke(new Action(EnableUI));
EnableUI();
}
}

Expand All @@ -315,20 +319,24 @@

if (!windowState.AutoFlashEnabled)
{
Invoke(new Action(DisableUI));
DisableUI();
}

foreach (BootloaderDevice b in FindBootloaders())
var bootloaders = FindBootloaders();
await Task.Run(async () =>

Check failure on line 326 in windows/QMK Toolbox/MainWindow.cs

View workflow job for this annotation

GitHub Actions / Build (Windows)

The name 'Task' does not exist in the current context
{
if (b.IsResettable)
foreach (BootloaderDevice b in bootloaders)
{
await b.Reset(selectedMcu);
if (b.IsResettable)
{
await b.Reset(selectedMcu);
}
}
}
});

if (!windowState.AutoFlashEnabled)
{
Invoke(new Action(EnableUI));
EnableUI();
}
}

Expand All @@ -338,22 +346,26 @@

if (!windowState.AutoFlashEnabled)
{
Invoke(new Action(DisableUI));
DisableUI();
}

foreach (BootloaderDevice b in FindBootloaders())
var bootloaders = FindBootloaders();
await Task.Run(async () =>

Check failure on line 353 in windows/QMK Toolbox/MainWindow.cs

View workflow job for this annotation

GitHub Actions / Build (Windows)

The name 'Task' does not exist in the current context
{
if (b.IsEepromFlashable)
foreach (BootloaderDevice b in bootloaders)
{
logTextBox.LogBootloader("Attempting to clear EEPROM, please don't remove device");
await b.FlashEeprom(selectedMcu, "reset.eep");
logTextBox.LogBootloader("EEPROM clear complete");
if (b.IsEepromFlashable)
{
Invoke(new Action(() => logTextBox.LogBootloader("Attempting to clear EEPROM, please don't remove device")));
await b.FlashEeprom(selectedMcu, "reset.eep");
Invoke(new Action(() => logTextBox.LogBootloader("EEPROM clear complete")));
}
}
}
});

if (!windowState.AutoFlashEnabled)
{
Invoke(new Action(EnableUI));
EnableUI();
}
}

Expand All @@ -364,22 +376,26 @@

if (!windowState.AutoFlashEnabled)
{
Invoke(new Action(DisableUI));
DisableUI();
}

foreach (BootloaderDevice b in FindBootloaders())
var bootloaders = FindBootloaders();
await Task.Run(async () =>

Check failure on line 383 in windows/QMK Toolbox/MainWindow.cs

View workflow job for this annotation

GitHub Actions / Build (Windows)

The name 'Task' does not exist in the current context
{
if (b.IsEepromFlashable)
foreach (BootloaderDevice b in bootloaders)
{
logTextBox.LogBootloader("Attempting to set handedness, please don't remove device");
await b.FlashEeprom(selectedMcu, file);
logTextBox.LogBootloader("EEPROM write complete");
if (b.IsEepromFlashable)
{
Invoke(new Action(() => logTextBox.LogBootloader("Attempting to set handedness, please don't remove device")));
await b.FlashEeprom(selectedMcu, file);
Invoke(new Action(() => logTextBox.LogBootloader("EEPROM write complete")));
}
}
}
});

if (!windowState.AutoFlashEnabled)
{
Invoke(new Action(EnableUI));
EnableUI();
}
}

Expand Down
Loading