feat(core): micropython板卡烧录固件时支持调整波特率
This commit is contained in:
@@ -518,6 +518,9 @@ BU.burnByCmd = function (port, command) {
|
||||
const { mainStatusBarTabs } = Mixly;
|
||||
const statusBarTerminal = mainStatusBarTabs.getStatusBarById('output');
|
||||
statusBarTerminal.setValue(Msg.Lang['shell.burning'] + '...\n');
|
||||
command = MString.tpl(command, {
|
||||
baudrate: Boards.getSelectedBoardConfigParam('BurnSpeed') ?? '460800'
|
||||
});
|
||||
BU.runCmd('burn', port, command);
|
||||
}
|
||||
|
||||
|
||||
@@ -75,8 +75,6 @@ BU.progressLayer = new LayerProgress({
|
||||
cancelDisplay: false
|
||||
});
|
||||
|
||||
const BAUD = goog.platform() === 'darwin' ? 460800 : 921600;
|
||||
|
||||
if (['BBC micro:bit', 'Mithon CC'].includes(BOARD.boardType)) {
|
||||
FSWrapper.setupFilesystem(path.join(Env.boardDirPath, 'build'));
|
||||
}
|
||||
@@ -265,10 +263,11 @@ BU.burnWithEsptool = async (binFile, erase) => {
|
||||
let esploader = null;
|
||||
let transport = null;
|
||||
try {
|
||||
const baudrate = Boards.getSelectedBoardConfigParam('BurnSpeed') ?? '460800';
|
||||
transport = new Transport(port, false);
|
||||
esploader = new ESPLoader({
|
||||
transport,
|
||||
baudrate: BAUD,
|
||||
baudrate,
|
||||
terminal: {
|
||||
clean() {
|
||||
statusBarTerminal.setValue('');
|
||||
@@ -281,7 +280,7 @@ BU.burnWithEsptool = async (binFile, erase) => {
|
||||
}
|
||||
}
|
||||
});
|
||||
let chip = await esploader.main();
|
||||
await esploader.main();
|
||||
} catch (error) {
|
||||
Debug.error(error);
|
||||
statusBarTerminal.addValue(`\n${error.toString()}\n`);
|
||||
|
||||
Reference in New Issue
Block a user