Update: 调整micropython_esp32c2配置

This commit is contained in:
王立帮
2025-01-20 08:48:25 +08:00
parent eb4fa79529
commit 4f6ec33e89
3 changed files with 11 additions and 5 deletions

View File

@@ -68,7 +68,7 @@
"devices": {
"serial": true,
"hid": true,
"usb": false
"usb": true
},
"burn": {
"erase": true,

View File

@@ -68,7 +68,7 @@
"devices": {
"serial": true,
"hid": true,
"usb": false
"usb": true
},
"burn": {
"erase": true,

View File

@@ -20,8 +20,10 @@ const {
const { BOARD } = Config;
let Device = SerialPort;
const platform = goog.platform();
const fullPlatform = goog.fullPlatform();
if (goog.platform() === 'win32' && goog.fullPlatform() !== 'win10') {
if (platform === 'win32' && fullPlatform !== 'win10') {
if (BOARD?.web?.devices?.hid) {
Device = HID;
} else if (BOARD?.web?.devices?.serial) {
@@ -33,8 +35,12 @@ if (goog.platform() === 'win32' && goog.fullPlatform() !== 'win10') {
Device = USBMini;
}
}
} else if (goog.platform() === 'android') {
Device = USB;
} else if (fullPlatform === 'android') {
if (['BBC micro:bit', 'Mithon CC'].includes(BOARD.boardType)) {
Device = USB;
} else {
Device = USBMini;
}
} else {
if (BOARD?.web?.devices?.serial) {
Device = SerialPort;