Use reenumerate() in update-device-firmware.js instead of forking reenumerate.js

This commit is contained in:
László Monda
2018-01-30 20:39:48 +01:00
parent 0d4e1acf76
commit 8e620caac5
2 changed files with 11 additions and 10 deletions
+10 -9
View File
@@ -17,12 +17,13 @@ const blhost = getBlhostCmd(uhk.enumerationNameToProductId.bootloader);
checkFirmwareImage(firmwareImage, extension);
config.verbose = true;
exec(`${usbDir}/reenumerate.js bootloader`);
exec(`${blhost} flash-security-disable 0403020108070605`);
exec(`${blhost} flash-erase-region 0xc000 475136`);
exec(`${blhost} flash-image ${firmwareImage}`);
exec(`${blhost} reset`);
config.verbose = false;
echo('Firmware updated successfully.');
(async function() {
config.verbose = true;
await uhk.reenumerate('bootloader');
exec(`${blhost} flash-security-disable 0403020108070605`);
exec(`${blhost} flash-erase-region 0xc000 475136`);
exec(`${blhost} flash-image ${firmwareImage}`);
exec(`${blhost} reset`);
config.verbose = false;
echo('Firmware updated successfully.');
})();