Use reenumerate() instead of forking reenumerate.js

This commit is contained in:
László Monda
2018-01-30 23:32:37 +01:00
parent cac6fdc190
commit 9284ae5032

View File

@@ -20,11 +20,12 @@ const usbDir = `${__dirname}`;
const blhostUsb = uhk.getBlhostCmd(uhk.enumerationNameToProductId.buspal);
const blhostBuspal = `${blhostUsb} --buspal i2c,${i2cAddress}`;
(async function() {
config.verbose = true;
exec(`${usbDir}/send-kboot-command-to-module.js ping ${moduleSlot}`);
exec(`${usbDir}/jump-to-module-bootloader.js ${moduleSlot}`);
exec(`${usbDir}/wait-for-kboot-idle.js`);
exec(`${usbDir}/reenumerate.js buspal`);
await uhk.reenumerate('buspal');
uhk.execRetry(`${blhostBuspal} get-property 1`);
exec(`${blhostBuspal} flash-erase-all-unsecure`);
exec(`${blhostBuspal} write-memory 0x0 ${firmwareImage}`);
@@ -33,5 +34,5 @@ exec(`${usbDir}/reenumerate.js normalKeyboard`);
uhk.execRetry(`${usbDir}/send-kboot-command-to-module.js reset ${moduleSlot}`);
exec(`${usbDir}/send-kboot-command-to-module.js idle`);
config.verbose = false;
echo('Firmware updated successfully.');
})();