Update: 调整fullPlatform下对各系统的判断顺序

This commit is contained in:
王立帮
2025-01-20 09:31:31 +08:00
parent 4f6ec33e89
commit d9e41b76c8
3 changed files with 6 additions and 6 deletions

View File

@@ -657,12 +657,12 @@ BU.uploadWithAmpy = (portName) => {
const mainWorkspace = Workspace.getMain();
const editor = mainWorkspace.getEditorsManager().getActive();
let useBuffer = true, dataLength = 256;
if (BOARD.web.com === 'usb') {
if (BOARD?.web?.devices?.usb) {
useBuffer = true;
dataLength = 64;
} else if (BOARD.web.com === 'hid') {
} else if (BOARD?.web?.devices?.hid) {
useBuffer = true;
dataLength = 30;
dataLength = 31;
}
layer.open({
type: 1,

View File

@@ -189,7 +189,7 @@ class WebHID extends Serial {
let temp = new Uint8Array(buffer.length + 1);
temp[0] = buffer.length;
temp.set(buffer, 1);
buffer= temp;
buffer = temp;
} else {
buffer.unshift(buffer.length);
buffer = new Uint8Array(buffer);