Fix: 修复win7下在线版同时启用usb和hid时会导致dataLength配置异常
This commit is contained in:
@@ -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({
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user