Fix: 修复win7下在线版同时启用usb和hid时会导致dataLength配置异常

This commit is contained in:
王立帮
2025-01-21 21:30:20 +08:00
parent a186d5d2aa
commit e82af3bead
2 changed files with 4 additions and 4 deletions

View File

@@ -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({

View File

@@ -58,6 +58,8 @@ if (platform === 'win32' && fullPlatform !== 'win10') {
class WebSerial extends Device {
static {
this.type = Device.type;
this.getConfig = function () {
return Device.getConfig();
}