chore(core): ESPTool 调整为 esptooljs

This commit is contained in:
王立帮
2025-05-09 16:50:42 +08:00
parent 3b10f7742c
commit fb5303c311
5 changed files with 19 additions and 18 deletions

View File

@@ -233,7 +233,7 @@
"require": []
}, {
"path": "modules/web-modules/esptool.min.js",
"provide": ["ESPTool"],
"provide": ["esptooljs"],
"require": []
}, {
"path": "modules/web-modules/adafruit-esptool/index.js",

View File

@@ -1566,7 +1566,7 @@
"FSWrapper",
"DAPWrapper",
"PartialFlashing",
"ESPTool",
"esptooljs",
"AdafruitESPTool",
"CryptoJS",
"Mixly.Env",
@@ -1729,7 +1729,7 @@
"require": [
"layui",
"avrbro",
"ESPTool",
"esptooljs",
"AdafruitESPTool",
"CryptoJS",
"dayjs.duration",

View File

@@ -2,7 +2,7 @@ goog.loadJs('web', () => {
goog.require('layui');
goog.require('avrbro');
goog.require('ESPTool');
goog.require('esptooljs');
goog.require('AdafruitESPTool');
goog.require('CryptoJS');
goog.require('dayjs.duration');
@@ -29,7 +29,7 @@ const {
const { Serial } = Web;
const { layer } = layui;
const { ESPLoader, Transport } = ESPTool;
const { ESPLoader, Transport } = esptooljs;
function hexToBinaryString (hex) {
@@ -98,7 +98,6 @@ class WebCompilerArduShell {
statusBarTerminal.setValue(`${Msg.Lang['shell.compiling']}...\n`);
this.shell.compile(code)
.then((info) => {
console.log(info)
this.endCallback(info.code, info.time);
})
.catch((error) => {
@@ -271,7 +270,6 @@ class WebCompilerArduShell {
}
async uploadWithEsptool(port, files) {
console.log(port, files)
const { mainStatusBarTabs } = Mixly;
const statusBarTerminal = mainStatusBarTabs.getStatusBarById('output');
let esploader = null;

View File

@@ -5,7 +5,7 @@ goog.require('BoardId');
goog.require('FSWrapper');
goog.require('DAPWrapper');
goog.require('PartialFlashing');
goog.require('ESPTool');
goog.require('esptooljs');
goog.require('AdafruitESPTool');
goog.require('CryptoJS');
goog.require('Mixly.Env');
@@ -51,7 +51,7 @@ const { BOARD, SELECTED_BOARD } = Config;
const {
ESPLoader,
Transport
} = ESPTool;
} = esptooljs;
BU.uploading = false;
BU.burning = false;
@@ -332,6 +332,9 @@ BU.burnWithEsptool = async (binFile, erase) => {
};
try {
await esploader.writeFlash(flashOptions);
await transport.setDTR(false);
await new Promise((resolve) => setTimeout(resolve, 100));
await transport.setDTR(true);
BU.progressLayer.hide();
layer.msg(Msg.Lang['shell.burnSucc'], { time: 1000 });
statusBarTerminal.addValue(`==${Msg.Lang['shell.burnSucc']}==\n`);

File diff suppressed because one or more lines are too long