Minor fix for Teensy upload in Windows

This commit is contained in:
Josh Stewart 2020-10-21 21:01:53 +11:00
parent ef32f7d149
commit aaa637f433
2 changed files with 4 additions and 2 deletions

View File

@ -237,11 +237,13 @@ ipcMain.on('uploadFW', (e, args) => {
var executableName = __dirname + "/bin/" + platform + "/teensy_post_compile"; var executableName = __dirname + "/bin/" + platform + "/teensy_post_compile";
executableName = executableName.replace('app.asar',''); //This is important for allowing the binary to be found once the app is packaed into an asar executableName = executableName.replace('app.asar',''); //This is important for allowing the binary to be found once the app is packaed into an asar
var configName = executableName + ".conf"; var configName = executableName + ".conf";
if(process.platform == "win32") { executableName = executableName + '.exe'; } //This must come after the configName line above
var execArgs = ['-board=TEENSY35', '-reboot', '-file='+path.basename(args.firmwareFile, '.hex'), '-path='+path.dirname(args.firmwareFile), '-tools='+executableName.replace('/teensy_post_compile', "")]; var execArgs = ['-board=TEENSY35', '-reboot', '-file='+path.basename(args.firmwareFile, '.hex'), '-path='+path.dirname(args.firmwareFile), '-tools='+executableName.replace('/teensy_post_compile', "")];
//console.log(execArgs); //console.log(execArgs);
if(process.platform == "win32") { executableName = executableName + '.exe'; } //This must come after the configName line above
console.log(executableName); console.log(executableName);
const child = execFile(executableName, execArgs); const child = execFile(executableName, execArgs);

View File

@ -46,7 +46,7 @@ function refreshSerialPorts()
isMega = true; isMega = true;
} }
} }
else if(ports[i].vendorId == "16c0") else if(ports[i].vendorId == "16c0" || ports[i].vendorId == "16C0")
{ {
//Teensy //Teensy
if(ports[i].productId == "0483") if(ports[i].productId == "0483")