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 mainWorkspace = Workspace.getMain();
const editor = mainWorkspace.getEditorsManager().getActive(); const editor = mainWorkspace.getEditorsManager().getActive();
let useBuffer = true, dataLength = 256; let useBuffer = true, dataLength = 256;
if (BOARD?.web?.devices?.usb) { if (Serial.type === 'usb') {
useBuffer = true;
dataLength = 64; dataLength = 64;
} else if (BOARD?.web?.devices?.hid) { } else if (Serial.type === 'hid') {
useBuffer = true;
dataLength = 31; dataLength = 31;
} }
layer.open({ layer.open({

View File

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