Extract uhk.jumpToModuleBootloader() and use it.

This commit is contained in:
László Monda
2018-01-31 01:17:28 +01:00
parent 4f8a0247d3
commit df14e2d569
3 changed files with 8 additions and 2 deletions
+5
View File
@@ -200,6 +200,10 @@ async function sendKbootCommandToModule(device, kbootCommandId, i2cAddress) {
return await uhk.writeDevice(device, [uhk.usbCommands.sendKbootCommandToModule, kbootCommandId, parseInt(i2cAddress)])
};
async function jumpToModuleBootloader(device, moduleSlotId) {
await uhk.writeDevice(device, [uhk.usbCommands.jumpToModuleBootloader, moduleSlotId]);
};
uhk = exports = module.exports = moduleExports = {
bufferToString,
getUint16,
@@ -216,6 +220,7 @@ uhk = exports = module.exports = moduleExports = {
updateDeviceFirmware,
reenumerate,
sendKbootCommandToModule,
jumpToModuleBootloader,
usbCommands: {
getDeviceProperty : 0x00,
reenumerate : 0x01,