Skip to content

Commit b78bd13

Browse files
authored
Merge pull request #3052 from UltimateHackingKeyboard/fix-500ms-wait-time
fix: wait only 500 ms to OS initialise serial peripheral on linux when using mcu to upgrade firmware.
2 parents b1a8dc2 + fe267c8 commit b78bd13

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎packages/uhk-usb/src/uhk-operations.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,16 @@ export class UhkOperations {
207207
enumerationMode: EnumerationModes.Bootloader,
208208
});
209209
await this.device.close();
210-
// Give 1 sec to windows to install driver when first time appearing the mcu bootloader
211-
await snooze(1000);
210+
211+
if (process.platform === 'linux') {
212+
// On linux the 1 second timeout is too much because it matches with the bootloader wait timeout.
213+
await snooze(500);
214+
}
215+
else {
216+
// Give 1 sec to windows to install driver when first time appearing the mcu bootloader
217+
await snooze(1000);
218+
}
219+
212220
this.logService.misc(`[UhkOperations] Init SerialPeripheral: ${reenumerateResult.serialPath}`);
213221
const peripheral = new SerialPeripheral(reenumerateResult.serialPath);
214222
const mcuManager = new McuManager(peripheral);

0 commit comments

Comments
 (0)