Use reenumerate() instead of forking reenumerate.js
This commit is contained in:
@@ -20,11 +20,12 @@ const usbDir = `${__dirname}`;
|
|||||||
const blhostUsb = uhk.getBlhostCmd(uhk.enumerationNameToProductId.buspal);
|
const blhostUsb = uhk.getBlhostCmd(uhk.enumerationNameToProductId.buspal);
|
||||||
const blhostBuspal = `${blhostUsb} --buspal i2c,${i2cAddress}`;
|
const blhostBuspal = `${blhostUsb} --buspal i2c,${i2cAddress}`;
|
||||||
|
|
||||||
|
(async function() {
|
||||||
config.verbose = true;
|
config.verbose = true;
|
||||||
exec(`${usbDir}/send-kboot-command-to-module.js ping ${moduleSlot}`);
|
exec(`${usbDir}/send-kboot-command-to-module.js ping ${moduleSlot}`);
|
||||||
exec(`${usbDir}/jump-to-module-bootloader.js ${moduleSlot}`);
|
exec(`${usbDir}/jump-to-module-bootloader.js ${moduleSlot}`);
|
||||||
exec(`${usbDir}/wait-for-kboot-idle.js`);
|
exec(`${usbDir}/wait-for-kboot-idle.js`);
|
||||||
exec(`${usbDir}/reenumerate.js buspal`);
|
await uhk.reenumerate('buspal');
|
||||||
uhk.execRetry(`${blhostBuspal} get-property 1`);
|
uhk.execRetry(`${blhostBuspal} get-property 1`);
|
||||||
exec(`${blhostBuspal} flash-erase-all-unsecure`);
|
exec(`${blhostBuspal} flash-erase-all-unsecure`);
|
||||||
exec(`${blhostBuspal} write-memory 0x0 ${firmwareImage}`);
|
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}`);
|
uhk.execRetry(`${usbDir}/send-kboot-command-to-module.js reset ${moduleSlot}`);
|
||||||
exec(`${usbDir}/send-kboot-command-to-module.js idle`);
|
exec(`${usbDir}/send-kboot-command-to-module.js idle`);
|
||||||
config.verbose = false;
|
config.verbose = false;
|
||||||
|
|
||||||
echo('Firmware updated successfully.');
|
echo('Firmware updated successfully.');
|
||||||
|
})();
|
||||||
|
|||||||
Reference in New Issue
Block a user