Revert "FIx: 修复一些平板设备下web device初始化异常"

This reverts commit d864c8242a.
This commit is contained in:
fredqian
2025-02-07 20:34:27 +08:00
parent d864c8242a
commit 2780079a89

View File

@@ -24,11 +24,11 @@ const platform = goog.platform();
const fullPlatform = goog.fullPlatform();
if (platform === 'win32' && fullPlatform !== 'win10') {
if (BOARD?.web?.devices?.hid && navigator.hid) {
if (BOARD?.web?.devices?.hid) {
Device = HID;
} else if (BOARD?.web?.devices?.serial && navigator.serial) {
} else if (BOARD?.web?.devices?.serial) {
Device = SerialPort;
} else if (BOARD?.web?.devices?.usb && navigator.usb) {
} else if (BOARD?.web?.devices?.usb) {
if (['BBC micro:bit', 'Mithon CC'].includes(BOARD.boardType)) {
Device = USB;
} else {
@@ -42,15 +42,15 @@ if (platform === 'win32' && fullPlatform !== 'win10') {
Device = USBMini;
}
} else {
if (BOARD?.web?.devices?.serial && navigator.serial) {
if (BOARD?.web?.devices?.serial) {
Device = SerialPort;
} else if (BOARD?.web?.devices?.usb && navigator.usb) {
} else if (BOARD?.web?.devices?.usb) {
if (['BBC micro:bit', 'Mithon CC'].includes(BOARD.boardType)) {
Device = USB;
} else {
Device = USBMini;
}
} else if (BOARD?.web?.devices?.hid && navigator.hid) {
} else if (BOARD?.web?.devices?.hid) {
Device = HID;
}
}