Update: 在线版添加devices配置项

This commit is contained in:
王立帮
2025-01-16 10:33:08 +08:00
parent 3a3fc5c8bf
commit fa78011344
20 changed files with 132 additions and 84 deletions

View File

@@ -19,10 +19,24 @@ const { BOARD } = Config;
let Device = SerialPort;
if (BOARD?.web?.com === 'usb') {
if (goog.platform() === 'win32' && goog.fullPlatform() !== 'win10') {
if (BOARD?.web?.devices?.hid) {
Device = HID;
} else if (BOARD?.web?.devices?.serial) {
Device = SerialPort;
} else if (BOARD?.web?.devices?.usb) {
Device = USB;
}
} else if (goog.platform() === 'android') {
Device = USB;
} else if (BOARD?.web?.com === 'hid') {
Device = HID;
} else {
if (BOARD?.web?.devices?.serial) {
Device = SerialPort;
} else if (BOARD?.web?.devices?.usb) {
Device = USB;
} else if (BOARD?.web?.devices?.hid) {
Device = HID;
}
}