forked from qmk/qmk_toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
51 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
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 |
---|---|---|
|
@@ -20,6 +20,7 @@ public enum BootloaderType | |
UsbAsp, | ||
UsbTinyIsp, | ||
Wb32Dfu, | ||
Sn32Dfu, | ||
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 Sn32DfuDevice : BootloaderDevice | ||
{ | ||
public Sn32DfuDevice(UsbDevice d) : base(d) | ||
{ | ||
Type = BootloaderType.Sn32Dfu; | ||
Name = "SN32 DFU"; | ||
PreferredDriver = "HidUsb"; | ||
|
||
} | ||
|
||
public async override Task Flash(string mcu, string file) | ||
{ | ||
if (Path.GetExtension(file)?.ToLower() == ".bin") | ||
{ | ||
if (ProductId == 0x7010) // SN32F260 | ||
{ | ||
await RunProcessAsync("sonixflasher.exe", $"-v {VendorId:x4}:{ProductId:x4} -o 0x200 -f \"{file}\""); | ||
return; | ||
} | ||
|
||
await RunProcessAsync("sonixflasher.exe", $"-v {VendorId:x4}:{ProductId:x4} -f \"{file}\""); | ||
} | ||
else | ||
{ | ||
PrintMessage("Only firmware files in .bin format can be flashed with sonixflasher!", MessageType.Error); | ||
} | ||
} | ||
} | ||
} |
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