-
-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support of WB32 DFU for Windows. (#321)
Co-authored-by: Ryan <[email protected]>
- Loading branch information
Showing
9 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ public enum BootloaderType | |
Stm32Duino, | ||
UsbAsp, | ||
UsbTinyIsp, | ||
Wb32Dfu, | ||
None | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
|
||
namespace QMK_Toolbox.Usb.Bootloader | ||
{ | ||
class Wb32DfuDevice : BootloaderDevice | ||
{ | ||
public Wb32DfuDevice(UsbDevice d) : base(d) | ||
{ | ||
Type = BootloaderType.Wb32Dfu; | ||
Name = "WB32 DFU"; | ||
PreferredDriver = "WinUSB"; | ||
IsResettable = true; | ||
} | ||
|
||
public async override Task Flash(string mcu, string file) | ||
{ | ||
if (Path.GetExtension(file)?.ToLower() == ".bin") | ||
{ | ||
await RunProcessAsync("wb32-dfu-updater_cli.exe", $"--toolbox-mode --dfuse-address 0x08000000 --download \"{file}\""); | ||
} | ||
else if (Path.GetExtension(file)?.ToLower() == ".hex") | ||
{ | ||
await RunProcessAsync("wb32-dfu-updater_cli.exe", $"--toolbox-mode --download \"{file}\""); | ||
} | ||
else | ||
{ | ||
PrintMessage("Only firmware files in .bin or .hex format can be flashed with wb32-dfu-updater_cli!", MessageType.Error); | ||
} | ||
} | ||
|
||
public async override Task Reset(string mcu) => await RunProcessAsync("wb32-dfu-updater_cli.exe", $"--reset"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters