Update: 在线版设置选中串口后继续 烧录上传 操作

This commit is contained in:
王立帮
2024-10-12 21:25:23 +08:00
parent 0e42ca74d4
commit f82839e936
3 changed files with 49 additions and 36 deletions

View File

@@ -46,13 +46,14 @@ class USB extends Serial {
Serial.renderSelectBox(portsName);
}
this.requestPort = function () {
navigator.usb.requestDevice({ filters: [{ vendorId: 0xD28 }] })
.then((device) => {
this.addPort(device);
this.refreshPorts();
})
.catch(Debug.error);
this.requestPort = async function () {
const device = await navigator.usb.requestDevice({
filters: [{
vendorId: 0xD28
}]
});
this.addPort(device);
this.refreshPorts();
}
this.getPort = function (name) {