From 33fbaed040abb5210817ab45ad5a0438cf493fb4 Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Mon, 20 Feb 2023 15:44:26 -0800 Subject: [PATCH] change jdusb speed 921600->1500000; fix devmode serial filters --- src/jdom/transport/nodewebserialio.ts | 2 +- src/jdom/transport/webserialio.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/jdom/transport/nodewebserialio.ts b/src/jdom/transport/nodewebserialio.ts index fe82dbbf2..81db75b5e 100644 --- a/src/jdom/transport/nodewebserialio.ts +++ b/src/jdom/transport/nodewebserialio.ts @@ -142,7 +142,7 @@ class NodeWebSerialIO implements HF2_IO { console.debug(`serial: found ${this.port.serialNumber}`) await toPromise(cb => { this.dev = new this.SerialPort( - { path: this.port.path, baudRate: 921600 }, + { path: this.port.path, baudRate: 1500000 }, cb ) }) diff --git a/src/jdom/transport/webserialio.ts b/src/jdom/transport/webserialio.ts index 749fab6e9..76690fe30 100644 --- a/src/jdom/transport/webserialio.ts +++ b/src/jdom/transport/webserialio.ts @@ -179,9 +179,11 @@ export class WebSerialIO implements HF2_IO { // eslint-disable-next-line @typescript-eslint/no-unused-vars private async requestDeviceAsync(deviceId?: string) { const vendorIds = this.bus.deviceCatalog.vendorIds("serial") - const options: SerialPortRequestOptions = { - filters: vendorIds.map(usbVendorId => ({ usbVendorId })), - } + const options: SerialPortRequestOptions = Flags.developerMode + ? {} + : { + filters: vendorIds.map(usbVendorId => ({ usbVendorId })), + } try { console.debug("request serial", { options }) this.dev = await navigator.serial.requestPort(options) @@ -219,7 +221,7 @@ export class WebSerialIO implements HF2_IO { if (!this.dev) throwError("device not found", { cancel: true }) await this.dev.open({ - baudRate: 921600, + baudRate: 1500000, bufferSize: 32 * 1024, })