Fix: 修复win7下在线版同时启用usb和hid时会导致dataLength配置异常
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -58,6 +58,8 @@ if (platform === 'win32' && fullPlatform !== 'win10') {
|
||||
|
||||
class WebSerial extends Device {
|
||||
static {
|
||||
this.type = Device.type;
|
||||
|
||||
this.getConfig = function () {
|
||||
return Device.getConfig();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user