Make update-module-firmware.js use reenumerate() and sendKbootCommandToModule() instead of forking more processes.
This commit is contained in:
@@ -23,6 +23,8 @@ const blhostBuspal = `${blhostUsb} --buspal i2c,${i2cAddress}`;
|
|||||||
(async function() {
|
(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}`);
|
||||||
|
// const device = uhk.getUhkDevice();
|
||||||
|
// await uhk.sendKbootCommandToModule(device, uhk.kbootCommands.ping, i2cAddress);
|
||||||
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`);
|
||||||
await uhk.reenumerate('buspal');
|
await uhk.reenumerate('buspal');
|
||||||
@@ -30,9 +32,10 @@ const blhostBuspal = `${blhostUsb} --buspal i2c,${i2cAddress}`;
|
|||||||
exec(`${blhostBuspal} flash-erase-all-unsecure`);
|
exec(`${blhostBuspal} flash-erase-all-unsecure`);
|
||||||
exec(`${blhostBuspal} write-memory 0x0 ${firmwareImage}`);
|
exec(`${blhostBuspal} write-memory 0x0 ${firmwareImage}`);
|
||||||
exec(`${blhostUsb} reset`);
|
exec(`${blhostUsb} reset`);
|
||||||
exec(`${usbDir}/reenumerate.js normalKeyboard`);
|
await uhk.reenumerate('normalKeyboard');
|
||||||
uhk.execRetry(`${usbDir}/send-kboot-command-to-module.js reset ${moduleSlot}`);
|
const device = uhk.getUhkDevice();
|
||||||
exec(`${usbDir}/send-kboot-command-to-module.js idle`);
|
await uhk.sendKbootCommandToModule(device, uhk.kbootCommands.reset, i2cAddress);
|
||||||
|
await uhk.sendKbootCommandToModule(device, uhk.kbootCommands.idle, i2cAddress);
|
||||||
config.verbose = false;
|
config.verbose = false;
|
||||||
echo('Firmware updated successfully.');
|
echo('Firmware updated successfully.');
|
||||||
})();
|
})();
|
||||||
|
|||||||
Reference in New Issue
Block a user