Use reenumerate() in update-device-firmware.js instead of forking reenumerate.js
This commit is contained in:
@@ -86,7 +86,7 @@ function reenumerate(enumerationMode) {
|
||||
const enumerationModeId = exports.enumerationModes[enumerationMode];
|
||||
|
||||
if (enumerationModeId === undefined) {
|
||||
const enumerationModes = Object.keys(uhk.enumerationModes).join(', ');
|
||||
const enumerationModes = Object.keys(exports.enumerationModes).join(', ');
|
||||
console.log(`Invalid enumeration mode '${enumerationMode}' is not one of: ${enumerationModes}`);
|
||||
reject();
|
||||
return;
|
||||
|
||||
@@ -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.');
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user