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];
|
const enumerationModeId = exports.enumerationModes[enumerationMode];
|
||||||
|
|
||||||
if (enumerationModeId === undefined) {
|
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}`);
|
console.log(`Invalid enumeration mode '${enumerationMode}' is not one of: ${enumerationModes}`);
|
||||||
reject();
|
reject();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -17,12 +17,13 @@ const blhost = getBlhostCmd(uhk.enumerationNameToProductId.bootloader);
|
|||||||
|
|
||||||
checkFirmwareImage(firmwareImage, extension);
|
checkFirmwareImage(firmwareImage, extension);
|
||||||
|
|
||||||
config.verbose = true;
|
(async function() {
|
||||||
exec(`${usbDir}/reenumerate.js bootloader`);
|
config.verbose = true;
|
||||||
exec(`${blhost} flash-security-disable 0403020108070605`);
|
await uhk.reenumerate('bootloader');
|
||||||
exec(`${blhost} flash-erase-region 0xc000 475136`);
|
exec(`${blhost} flash-security-disable 0403020108070605`);
|
||||||
exec(`${blhost} flash-image ${firmwareImage}`);
|
exec(`${blhost} flash-erase-region 0xc000 475136`);
|
||||||
exec(`${blhost} reset`);
|
exec(`${blhost} flash-image ${firmwareImage}`);
|
||||||
config.verbose = false;
|
exec(`${blhost} reset`);
|
||||||
|
config.verbose = false;
|
||||||
echo('Firmware updated successfully.');
|
echo('Firmware updated successfully.');
|
||||||
|
})();
|
||||||
|
|||||||
Reference in New Issue
Block a user