Update: win7支持同时使用Serial和HID

This commit is contained in:
王立帮
2025-03-06 18:20:50 +08:00
parent 1590712159
commit fa3b4781e1
13 changed files with 277 additions and 127 deletions

View File

@@ -239,9 +239,6 @@ class App extends Component {
id: 'command-burn-btn',
displayText: Msg.Lang['nav.btn.burn'],
preconditionFn: () => {
if (!goog.isElectron && !goog.hasSocketServer && Serial.type !== 'serialport') {
return false;
}
return SELECTED_BOARD?.nav?.burn;
},
callback: () => BU.initBurn(),

View File

@@ -2,6 +2,7 @@ goog.loadJs('common', () => {
goog.require('Mixly.Config');
goog.require('Mixly.Events');
goog.require('Mixly.Registry');
goog.require('Mixly.Nav');
goog.require('Mixly.Msg');
goog.provide('Mixly.Serial');
@@ -9,6 +10,7 @@ goog.provide('Mixly.Serial');
const {
Config,
Events,
Registry,
Nav,
Msg
} = Mixly;
@@ -19,6 +21,8 @@ const { SELECTED_BOARD } = Config;
class Serial {
static {
this.portsName = [];
this.portToNameRegistry = new Registry();
this.nameToPortRegistry = new Registry();
this.DEFAULT_CONFIG = {
ctrlCBtn: false,
ctrlDBtn: false,
@@ -42,6 +46,14 @@ class Serial {
return this.portsName;
}
this.refreshPorts = function () {
let portsName = [];
for (let name of Serial.nameToPortRegistry.keys()) {
portsName.push({ name });
}
Serial.renderSelectBox(portsName);
}
this.getConfig = function () {
let config = SELECTED_BOARD?.serial ?? {};
return {