From e82af3bead54fe69304e19e95f5371e279b3b479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=AB=8B=E5=B8=AE?= <3294713004@qq.com> Date: Tue, 21 Jan 2025 21:30:20 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20=E4=BF=AE=E5=A4=8Dwin7=E4=B8=8B=E5=9C=A8?= =?UTF-8?q?=E7=BA=BF=E7=89=88=E5=90=8C=E6=97=B6=E5=90=AF=E7=94=A8usb?= =?UTF-8?q?=E5=92=8Chid=E6=97=B6=E4=BC=9A=E5=AF=BC=E8=87=B4dataLength?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/modules/mixly-modules/web/burn-upload.js | 6 ++---- common/modules/mixly-modules/web/serial.js | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/modules/mixly-modules/web/burn-upload.js b/common/modules/mixly-modules/web/burn-upload.js index cb3bc32c..14e027ef 100644 --- a/common/modules/mixly-modules/web/burn-upload.js +++ b/common/modules/mixly-modules/web/burn-upload.js @@ -657,11 +657,9 @@ BU.uploadWithAmpy = (portName) => { const mainWorkspace = Workspace.getMain(); const editor = mainWorkspace.getEditorsManager().getActive(); let useBuffer = true, dataLength = 256; - if (BOARD?.web?.devices?.usb) { - useBuffer = true; + if (Serial.type === 'usb') { dataLength = 64; - } else if (BOARD?.web?.devices?.hid) { - useBuffer = true; + } else if (Serial.type === 'hid') { dataLength = 31; } layer.open({ diff --git a/common/modules/mixly-modules/web/serial.js b/common/modules/mixly-modules/web/serial.js index f6dded09..e1d880e2 100644 --- a/common/modules/mixly-modules/web/serial.js +++ b/common/modules/mixly-modules/web/serial.js @@ -58,6 +58,8 @@ if (platform === 'win32' && fullPlatform !== 'win10') { class WebSerial extends Device { static { + this.type = Device.type; + this.getConfig = function () { return Device.getConfig(); }