Sleep 1s between sending reset and idle kboot commands. Hopefully this will always make the left half resume after firmware updates.
This commit is contained in:
@@ -5,6 +5,10 @@ const {getTransferBuffers, ConfigBufferId, UhkHidDevice, UsbCommand} = require('
|
|||||||
const Logger = require('./logger');
|
const Logger = require('./logger');
|
||||||
const debug = process.env.DEBUG;
|
const debug = process.env.DEBUG;
|
||||||
|
|
||||||
|
function sleep(ms) {
|
||||||
|
return new Promise(resolve => setTimeout(resolve, ms));
|
||||||
|
}
|
||||||
|
|
||||||
const kbootCommandIdToName = {
|
const kbootCommandIdToName = {
|
||||||
0: 'idle',
|
0: 'idle',
|
||||||
1: 'ping',
|
1: 'ping',
|
||||||
@@ -301,6 +305,7 @@ async function updateModuleFirmware(i2cAddress, moduleSlotId, firmwareImage) {
|
|||||||
await uhk.reenumerate('normalKeyboard');
|
await uhk.reenumerate('normalKeyboard');
|
||||||
device = uhk.getUhkDevice();
|
device = uhk.getUhkDevice();
|
||||||
await uhk.sendKbootCommandToModule(device, uhk.kbootCommands.reset, i2cAddress);
|
await uhk.sendKbootCommandToModule(device, uhk.kbootCommands.reset, i2cAddress);
|
||||||
|
await sleep(1000);
|
||||||
await uhk.sendKbootCommandToModule(device, uhk.kbootCommands.idle, i2cAddress);
|
await uhk.sendKbootCommandToModule(device, uhk.kbootCommands.idle, i2cAddress);
|
||||||
device.close();
|
device.close();
|
||||||
config.verbose = false;
|
config.verbose = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user