Fix: 修复在线版MicroPython ESP32S2下烧录固件时没有eraseFlash
This commit is contained in:
@@ -134,9 +134,9 @@ BU.initBurn = () => {
|
|||||||
BU.burnWithSpecialBin();
|
BU.burnWithSpecialBin();
|
||||||
} else {
|
} else {
|
||||||
if (boardKey.indexOf('micropython:esp32s2') !== -1) {
|
if (boardKey.indexOf('micropython:esp32s2') !== -1) {
|
||||||
BU.burnWithAdafruitEsptool(web.burn.binFile);
|
BU.burnWithAdafruitEsptool(web.burn.binFile, web.burn.erase);
|
||||||
} else {
|
} else {
|
||||||
BU.burnWithEsptool(web.burn.binFile);
|
BU.burnWithEsptool(web.burn.binFile, web.burn.erase);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -224,7 +224,7 @@ BU.burnByUSB = () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
BU.burnWithEsptool = async (binFile) => {
|
BU.burnWithEsptool = async (binFile, erase) => {
|
||||||
const { mainStatusBarTabs } = Mixly;
|
const { mainStatusBarTabs } = Mixly;
|
||||||
let portName = Serial.getSelectedPortName();
|
let portName = Serial.getSelectedPortName();
|
||||||
if (!portName) {
|
if (!portName) {
|
||||||
@@ -324,7 +324,9 @@ BU.burnWithEsptool = async (binFile) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
await esploader.eraseFlash();
|
if (erase) {
|
||||||
|
await esploader.eraseFlash();
|
||||||
|
}
|
||||||
await esploader.writeFlash(flashOptions);
|
await esploader.writeFlash(flashOptions);
|
||||||
layer.msg(Msg.Lang['shell.burnSucc'], { time: 1000 });
|
layer.msg(Msg.Lang['shell.burnSucc'], { time: 1000 });
|
||||||
statusBarTerminal.addValue(`==${Msg.Lang['shell.burnSucc']}==\n`);
|
statusBarTerminal.addValue(`==${Msg.Lang['shell.burnSucc']}==\n`);
|
||||||
@@ -341,7 +343,7 @@ BU.burnWithEsptool = async (binFile) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
BU.burnWithAdafruitEsptool = async (binFile) => {
|
BU.burnWithAdafruitEsptool = async (binFile, erase) => {
|
||||||
const { mainStatusBarTabs } = Mixly;
|
const { mainStatusBarTabs } = Mixly;
|
||||||
let portName = Serial.getSelectedPortName();
|
let portName = Serial.getSelectedPortName();
|
||||||
if (!portName) {
|
if (!portName) {
|
||||||
@@ -425,6 +427,9 @@ BU.burnWithAdafruitEsptool = async (binFile) => {
|
|||||||
let cancel = false;
|
let cancel = false;
|
||||||
$("#mixly-loader-btn").hide();
|
$("#mixly-loader-btn").hide();
|
||||||
try {
|
try {
|
||||||
|
if (erase) {
|
||||||
|
await espStub.eraseFlash();
|
||||||
|
}
|
||||||
for (let file of data) {
|
for (let file of data) {
|
||||||
await espStub.flashData(
|
await espStub.flashData(
|
||||||
file.data,
|
file.data,
|
||||||
|
|||||||
Reference in New Issue
Block a user