зеркало из https://github.com/microsoft/jacdac-ts.git
change jdusb speed 921600->1500000; fix devmode serial filters
This commit is contained in:
Родитель
5ce700f99b
Коммит
33fbaed040
|
@ -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
|
||||
)
|
||||
})
|
||||
|
|
|
@ -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,
|
||||
})
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче