From 167c6e9e30173775e141db9d4e2fef34a616cec2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E7=AB=8B=E5=B8=AE?= <3294713004@qq.com>
Date: Sat, 13 Sep 2025 22:56:12 +0800
Subject: [PATCH] =?UTF-8?q?feat(core):=20micropython=E6=9D=BF=E5=8D=A1?=
=?UTF-8?q?=E7=83=A7=E5=BD=95=E5=9B=BA=E4=BB=B6=E6=97=B6=E6=94=AF=E6=8C=81?=
=?UTF-8?q?=E8=B0=83=E6=95=B4=E6=B3=A2=E7=89=B9=E7=8E=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
boards/default_src/micropython/export.js | 7 +
boards/default_src/micropython/language/en.js | 9 ++
.../micropython/language/zh-hans.js | 9 ++
.../micropython/language/zh-hant.js | 9 ++
.../template/board-config-message.html | 14 ++
.../default_src/micropython_educore/index.js | 10 +-
.../micropython_educore/origin/config.json | 35 ++++-
boards/default_src/micropython_esp32/index.js | 10 +-
.../micropython_esp32/origin/config.json | 124 ++++++++++++++++--
.../default_src/micropython_esp32c2/index.js | 10 +-
.../micropython_esp32c2/origin/config.json | 66 +++++++++-
.../default_src/micropython_esp32c3/index.js | 10 +-
.../micropython_esp32c3/origin/config.json | 124 ++++++++++++++++--
.../default_src/micropython_esp32s2/index.js | 10 +-
.../micropython_esp32s2/origin/config.json | 70 ++++++++--
.../default_src/micropython_esp32s3/index.js | 10 +-
.../micropython_esp32s3/origin/config.json | 93 ++++++++++++-
boards/default_src/micropython_robot/index.js | 10 +-
.../micropython_robot/origin/config.json | 93 ++++++++++++-
.../mixly-modules/electron/burn-upload.js | 3 +
.../modules/mixly-modules/web/burn-upload.js | 7 +-
21 files changed, 676 insertions(+), 57 deletions(-)
create mode 100644 boards/default_src/micropython/language/en.js
create mode 100644 boards/default_src/micropython/language/zh-hans.js
create mode 100644 boards/default_src/micropython/language/zh-hant.js
create mode 100644 boards/default_src/micropython/template/board-config-message.html
diff --git a/boards/default_src/micropython/export.js b/boards/default_src/micropython/export.js
index 52ac4d9e..c95f5751 100644
--- a/boards/default_src/micropython/export.js
+++ b/boards/default_src/micropython/export.js
@@ -54,6 +54,10 @@ import * as MicroPythonSerialGenerators from './generators/serial';
import * as MicroPythonSystemGenerators from './generators/system';
import * as MicroPythonWeatherGenerators from './generators/weather';
+import * as MicroPythonZhHans from './language/zh-hans';
+import * as MicroPythonZhHant from './language/zh-hant';
+import * as MicroPythonEn from './language/en';
+
import { Python } from './python_generator';
export {
@@ -111,5 +115,8 @@ export {
MicroPythonSerialGenerators,
MicroPythonSystemGenerators,
MicroPythonWeatherGenerators,
+ MicroPythonZhHans,
+ MicroPythonZhHant,
+ MicroPythonEn,
Python
};
\ No newline at end of file
diff --git a/boards/default_src/micropython/language/en.js b/boards/default_src/micropython/language/en.js
new file mode 100644
index 00000000..031db7f0
--- /dev/null
+++ b/boards/default_src/micropython/language/en.js
@@ -0,0 +1,9 @@
+import * as Mixly from 'mixly';
+import TEMPLATE from '../template/board-config-message.html';
+
+const { XML } = Mixly;
+
+export const MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED = XML.render(TEMPLATE, {
+ title: 'Burn Speed',
+ message: 'To select the flashing speed, change the Burn Speed. This value will be used for flashing the code to the device. If you have issues while flashing the device at high speed, try to decrease this value. This could be due to the external serial-to-USB chip limitations.'
+});
\ No newline at end of file
diff --git a/boards/default_src/micropython/language/zh-hans.js b/boards/default_src/micropython/language/zh-hans.js
new file mode 100644
index 00000000..f89ce7b8
--- /dev/null
+++ b/boards/default_src/micropython/language/zh-hans.js
@@ -0,0 +1,9 @@
+import * as Mixly from 'mixly';
+import TEMPLATE from '../template/board-config-message.html';
+
+const { XML } = Mixly;
+
+export const MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED = XML.render(TEMPLATE, {
+ title: '烧录速度',
+ message: '要选择烧录速度,请更改“Burn Speed”,此值将用于向设备烧录代码。如果在用较高的烧录速度时出现问题,请尝试减小此值,这可能是由于外部串行到USB芯片的限制。'
+});
\ No newline at end of file
diff --git a/boards/default_src/micropython/language/zh-hant.js b/boards/default_src/micropython/language/zh-hant.js
new file mode 100644
index 00000000..2ed6d2f0
--- /dev/null
+++ b/boards/default_src/micropython/language/zh-hant.js
@@ -0,0 +1,9 @@
+import * as Mixly from 'mixly';
+import TEMPLATE from '../template/board-config-message.html';
+
+const { XML } = Mixly;
+
+export const MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED = XML.render(TEMPLATE, {
+ title: '燒錄速度',
+ message: '要選擇燒錄速度,請更改“Burn Speed”,此值將用於向設備燒錄程式碼。如果在用較高的燒錄速度時出現問題,請嘗試减小此值,這可能是由於外部串列到USB晶片的限制。'
+});
\ No newline at end of file
diff --git a/boards/default_src/micropython/template/board-config-message.html b/boards/default_src/micropython/template/board-config-message.html
new file mode 100644
index 00000000..1debec4d
--- /dev/null
+++ b/boards/default_src/micropython/template/board-config-message.html
@@ -0,0 +1,14 @@
+
+
{{-d.title}}
+
+ {{# if (d.message) { }}
+
+ {{-d.message}}
+
+ {{# } }}
+
+
\ No newline at end of file
diff --git a/boards/default_src/micropython_educore/index.js b/boards/default_src/micropython_educore/index.js
index 0aa26821..4801527e 100644
--- a/boards/default_src/micropython_educore/index.js
+++ b/boards/default_src/micropython_educore/index.js
@@ -71,7 +71,10 @@ import {
MicroPythonSensorOnBoardGenerators,
MicroPythonSerialGenerators,
MicroPythonSystemGenerators,
- MicroPythonWeatherGenerators
+ MicroPythonWeatherGenerators,
+ MicroPythonZhHans,
+ MicroPythonZhHant,
+ MicroPythonEn
} from '@mixly/micropython';
import {
@@ -90,6 +93,11 @@ import './css/color_esp32c3_mixgocc.css';
Object.assign(Blockly.Variables, Variables);
Object.assign(Blockly.Procedures, Procedures);
+
+Object.assign(Blockly.Lang.ZhHans, MicroPythonZhHans);
+Object.assign(Blockly.Lang.ZhHant, MicroPythonZhHant);
+Object.assign(Blockly.Lang.En, MicroPythonEn);
+
Blockly.Python = Python;
Blockly.generator = Python;
diff --git a/boards/default_src/micropython_educore/origin/config.json b/boards/default_src/micropython_educore/origin/config.json
index 896b07e3..2eec80a7 100644
--- a/boards/default_src/micropython_educore/origin/config.json
+++ b/boards/default_src/micropython_educore/origin/config.json
@@ -1,21 +1,48 @@
{
"board": {
- "mpython": "micropython:educore:educore"
+ "mpython": {
+ "key": "micropython:educore:educore",
+ "config": [
+ {
+ "key": "BurnSpeed",
+ "label": "Burn Speed",
+ "messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
+ "options": [
+ {
+ "key": "460800",
+ "label": "460800"
+ },
+ {
+ "key": "115200",
+ "label": "115200"
+ },
+ {
+ "key": "230400",
+ "label": "230400"
+ },
+ {
+ "key": "921600",
+ "label": "921600"
+ }
+ ]
+ }
+ ]
+ }
},
"language": "MicroPython",
"burn": {
"type": "command",
"portSelect": "all",
"micropython:educore:educore": {
- "command": "\"{esptool}\" --chip esp32c2 --port {com} --baud 115200 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32c2 --port {com} --baud 460800 --after=no_reset_stub write_flash 0x0 \"{indexPath}/build/Mixgo_Mini_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\"",
+ "command": "\"{esptool}\" --chip esp32c2 --port {com} --baud {baudrate} --after=no_reset_stub write_flash -e 0x0 \"{indexPath}/build/Mixgo_Mini_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\"",
"special": [
{
"name": "Firmware No Ble With SSL",
- "command": "\"{esptool}\" --chip esp32c2 --port {com} --baud 115200 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32c2 --port {com} --baud 460800 --after=no_reset_stub write_flash 0x0 \"{indexPath}/build/Mixgo_Mini_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
+ "command": "\"{esptool}\" --chip esp32c2 --port {com} --baud {baudrate} --after=no_reset_stub write_flash -e 0x0 \"{indexPath}/build/Mixgo_Mini_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
{
"name": "Firmware With Ble No SSL",
- "command": "\"{esptool}\" --chip esp32c2 --port {com} --baud 115200 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32c2 --port {com} --baud 460800 --after=no_reset_stub write_flash 0x0 \"{indexPath}/build/Mixgo_Mini_lib_ble-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
+ "command": "\"{esptool}\" --chip esp32c2 --port {com} --baud {baudrate} --after=no_reset_stub write_flash -e 0x0 \"{indexPath}/build/Mixgo_Mini_lib_ble-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
}
]
}
diff --git a/boards/default_src/micropython_esp32/index.js b/boards/default_src/micropython_esp32/index.js
index e865436e..1ccd4aed 100644
--- a/boards/default_src/micropython_esp32/index.js
+++ b/boards/default_src/micropython_esp32/index.js
@@ -69,7 +69,10 @@ import {
MicroPythonSensorOnBoardGenerators,
MicroPythonSerialGenerators,
MicroPythonSystemGenerators,
- MicroPythonWeatherGenerators
+ MicroPythonWeatherGenerators,
+ MicroPythonZhHans,
+ MicroPythonZhHant,
+ MicroPythonEn
} from '@mixly/micropython';
import {
@@ -82,6 +85,11 @@ import './css/color_esp32_mixgo.css';
Object.assign(Blockly.Variables, Variables);
Object.assign(Blockly.Procedures, Procedures);
+
+Object.assign(Blockly.Lang.ZhHans, MicroPythonZhHans);
+Object.assign(Blockly.Lang.ZhHant, MicroPythonZhHant);
+Object.assign(Blockly.Lang.En, MicroPythonEn);
+
Blockly.Python = Python;
Blockly.generator = Python;
diff --git a/boards/default_src/micropython_esp32/origin/config.json b/boards/default_src/micropython_esp32/origin/config.json
index f4391b76..2c6ae0b3 100644
--- a/boards/default_src/micropython_esp32/origin/config.json
+++ b/boards/default_src/micropython_esp32/origin/config.json
@@ -1,25 +1,133 @@
{
"board": {
- "MixGo": "micropython:esp32:mixgo",
- "MixGo PE": "micropython:esp32:mixgo_pe",
- "mPython": "micropython:esp32:mpython",
- "ESP32 Generic(4MB)": "micropython:esp32:generic"
+ "MixGo": {
+ "key": "micropython:esp32:mixgo",
+ "config": [
+ {
+ "key": "BurnSpeed",
+ "label": "Burn Speed",
+ "messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
+ "options": [
+ {
+ "key": "460800",
+ "label": "460800"
+ },
+ {
+ "key": "115200",
+ "label": "115200"
+ },
+ {
+ "key": "230400",
+ "label": "230400"
+ },
+ {
+ "key": "921600",
+ "label": "921600"
+ }
+ ]
+ }
+ ]
+ },
+ "MixGo PE": {
+ "key": "micropython:esp32:mixgo_pe",
+ "config": [
+ {
+ "key": "BurnSpeed",
+ "label": "Burn Speed",
+ "messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
+ "options": [
+ {
+ "key": "460800",
+ "label": "460800"
+ },
+ {
+ "key": "115200",
+ "label": "115200"
+ },
+ {
+ "key": "230400",
+ "label": "230400"
+ },
+ {
+ "key": "921600",
+ "label": "921600"
+ }
+ ]
+ }
+ ]
+ },
+ "mPython": {
+ "key": "micropython:esp32:mpython",
+ "config": [
+ {
+ "key": "BurnSpeed",
+ "label": "Burn Speed",
+ "messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
+ "options": [
+ {
+ "key": "460800",
+ "label": "460800"
+ },
+ {
+ "key": "115200",
+ "label": "115200"
+ },
+ {
+ "key": "230400",
+ "label": "230400"
+ },
+ {
+ "key": "921600",
+ "label": "921600"
+ }
+ ]
+ }
+ ]
+ },
+ "ESP32 Generic(4MB)": {
+ "key": "micropython:esp32:generic",
+ "config": [
+ {
+ "key": "BurnSpeed",
+ "label": "Burn Speed",
+ "messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
+ "options": [
+ {
+ "key": "460800",
+ "label": "460800"
+ },
+ {
+ "key": "115200",
+ "label": "115200"
+ },
+ {
+ "key": "230400",
+ "label": "230400"
+ },
+ {
+ "key": "921600",
+ "label": "921600"
+ }
+ ]
+ }
+ ]
+ }
},
"language": "MicroPython",
"burn": {
"type": "command",
"portSelect": "all",
"micropython:esp32:mixgo": {
- "command": "\"{esptool}\" --chip esp32 --port {com} --baud 460800 erase_flash && \"{esptool}\" --port {com} --baud 460800 write_flash 0x1000 \"{indexPath}/build/Mixgo_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
+ "command": "\"{esptool}\" --port {com} --baud {baudrate} write_flash -e 0x1000 \"{indexPath}/build/Mixgo_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
"micropython:esp32:mixgo_pe": {
- "command": "\"{esptool}\" --chip esp32 --port {com} --baud 460800 erase_flash && \"{esptool}\" --port {com} --baud 460800 write_flash 0x1000 \"{indexPath}/build/Mixgo_PE_lib-v1.25.0.bin\" 0x700000 \"{indexPath}/../micropython/build/HZK12.bin\""
+ "command": "\"{esptool}\" --port {com} --baud {baudrate} write_flash -e 0x1000 \"{indexPath}/build/Mixgo_PE_lib-v1.25.0.bin\" 0x700000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
"micropython:esp32:generic": {
- "command": "\"{esptool}\" --chip esp32 --port {com} --baud 460800 erase_flash && \"{esptool}\" --port {com} --baud 460800 write_flash 0x1000 \"{indexPath}/build/Generic_ESP32_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
+ "command": "\"{esptool}\" --port {com} --baud {baudrate} write_flash -e 0x1000 \"{indexPath}/build/Generic_ESP32_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
"micropython:esp32:mpython": {
- "command": "\"{esptool}\" --chip esp32 --port {com} --baud 460800 erase_flash && \"{esptool}\" --port {com} --baud 460800 write_flash 0x1000 \"{indexPath}/build/mPython_lib-v1.25.0.bin\" 0x700000 \"{indexPath}/../micropython/build/HZK12.bin\""
+ "command": "\"{esptool}\" --port {com} --baud {baudrate} write_flash -e 0x1000 \"{indexPath}/build/mPython_lib-v1.25.0.bin\" 0x700000 \"{indexPath}/../micropython/build/HZK12.bin\""
}
},
"upload": {
diff --git a/boards/default_src/micropython_esp32c2/index.js b/boards/default_src/micropython_esp32c2/index.js
index a306c323..799f3fbc 100644
--- a/boards/default_src/micropython_esp32c2/index.js
+++ b/boards/default_src/micropython_esp32c2/index.js
@@ -73,7 +73,10 @@ import {
MicroPythonSensorOnBoardGenerators,
MicroPythonSerialGenerators,
MicroPythonSystemGenerators,
- MicroPythonWeatherGenerators
+ MicroPythonWeatherGenerators,
+ MicroPythonZhHans,
+ MicroPythonZhHant,
+ MicroPythonEn
} from '@mixly/micropython';
import {
@@ -93,6 +96,11 @@ import './css/color_esp32c3_mixgocc.css';
Object.assign(Blockly.Variables, Variables);
Object.assign(Blockly.Procedures, Procedures);
+
+Object.assign(Blockly.Lang.ZhHans, MicroPythonZhHans);
+Object.assign(Blockly.Lang.ZhHant, MicroPythonZhHant);
+Object.assign(Blockly.Lang.En, MicroPythonEn);
+
Blockly.Python = Python;
Blockly.generator = Python;
diff --git a/boards/default_src/micropython_esp32c2/origin/config.json b/boards/default_src/micropython_esp32c2/origin/config.json
index 4191c7d7..009d8743 100644
--- a/boards/default_src/micropython_esp32c2/origin/config.json
+++ b/boards/default_src/micropython_esp32c2/origin/config.json
@@ -1,27 +1,81 @@
{
"board": {
- "MixGo MINI": "micropython:esp32c2:mixgo_mini",
- "ESP32C2 Generic(4M)": "micropython:esp32c2:generic_4M"
+ "MixGo MINI": {
+ "key": "micropython:esp32c2:mixgo_mini",
+ "config": [
+ {
+ "key": "BurnSpeed",
+ "label": "Burn Speed",
+ "messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
+ "options": [
+ {
+ "key": "460800",
+ "label": "460800"
+ },
+ {
+ "key": "115200",
+ "label": "115200"
+ },
+ {
+ "key": "230400",
+ "label": "230400"
+ },
+ {
+ "key": "921600",
+ "label": "921600"
+ }
+ ]
+ }
+ ]
+ },
+ "ESP32C2 Generic(4M)": {
+ "key": "micropython:esp32c2:generic_4M",
+ "config": [
+ {
+ "key": "BurnSpeed",
+ "label": "Burn Speed",
+ "messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
+ "options": [
+ {
+ "key": "460800",
+ "label": "460800"
+ },
+ {
+ "key": "115200",
+ "label": "115200"
+ },
+ {
+ "key": "230400",
+ "label": "230400"
+ },
+ {
+ "key": "921600",
+ "label": "921600"
+ }
+ ]
+ }
+ ]
+ }
},
"language": "MicroPython",
"burn": {
"type": "command",
"portSelect": "all",
"micropython:esp32c2:mixgo_mini": {
- "command": "\"{esptool}\" --chip esp32c2 --port {com} --baud 115200 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32c2 --port {com} --baud 460800 --after=no_reset_stub write_flash 0x0 \"{indexPath}/build/Mixgo_Mini_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\"",
+ "command": "\"{esptool}\" --chip esp32c2 --port {com} --baud {baudrate} --after=no_reset_stub write_flash -e 0x0 \"{indexPath}/build/Mixgo_Mini_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\"",
"special": [
{
"name": "Firmware For General Application",
- "command": "\"{esptool}\" --chip esp32c2 --port {com} --baud 115200 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32c2 --port {com} --baud 460800 --after=no_reset_stub write_flash 0x0 \"{indexPath}/build/Mixgo_Mini_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
+ "command": "\"{esptool}\" --chip esp32c2 --port {com} --baud {baudrate} --after=no_reset_stub write_flash -e 0x0 \"{indexPath}/build/Mixgo_Mini_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
{
"name": "Firmware Optimize For V2.x Board",
- "command": "\"{esptool}\" --chip esp32c2 --port {com} --baud 115200 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32c2 --port {com} --baud 460800 --after=no_reset_stub write_flash 0x0 \"{indexPath}/build/Mixgo_Mini_v2_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
+ "command": "\"{esptool}\" --chip esp32c2 --port {com} --baud {baudrate} --after=no_reset_stub write_flash -e 0x0 \"{indexPath}/build/Mixgo_Mini_v2_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
}
]
},
"micropython:esp32c2:generic_2M": {
- "command": "\"{esptool}\" --chip esp32c2 --port {com} --baud 460800 erase_flash && \"{esptool}\" --chip esp32c2 --port {com} --baud 460800 write_flash 0x0 \"{indexPath}/build/Generic_C2_lib-v1.25.0.bin\" "
+ "command": "\"{esptool}\" --chip esp32c2 --port {com} --baud {baudrate} write_flash -e 0x0 \"{indexPath}/build/Generic_C2_lib-v1.25.0.bin\""
}
},
"upload": {
diff --git a/boards/default_src/micropython_esp32c3/index.js b/boards/default_src/micropython_esp32c3/index.js
index b8039b3d..07fa1f6a 100644
--- a/boards/default_src/micropython_esp32c3/index.js
+++ b/boards/default_src/micropython_esp32c3/index.js
@@ -71,7 +71,10 @@ import {
MicroPythonSensorOnBoardGenerators,
MicroPythonSerialGenerators,
MicroPythonSystemGenerators,
- MicroPythonWeatherGenerators
+ MicroPythonWeatherGenerators,
+ MicroPythonZhHans,
+ MicroPythonZhHant,
+ MicroPythonEn
} from '@mixly/micropython';
import {
@@ -88,6 +91,11 @@ import './css/color_esp32c3_mixgocc.css';
Object.assign(Blockly.Variables, Variables);
Object.assign(Blockly.Procedures, Procedures);
+
+Object.assign(Blockly.Lang.ZhHans, MicroPythonZhHans);
+Object.assign(Blockly.Lang.ZhHant, MicroPythonZhHant);
+Object.assign(Blockly.Lang.En, MicroPythonEn);
+
Blockly.Python = Python;
Blockly.generator = Python;
diff --git a/boards/default_src/micropython_esp32c3/origin/config.json b/boards/default_src/micropython_esp32c3/origin/config.json
index 31c7cc1c..2be0e9e1 100644
--- a/boards/default_src/micropython_esp32c3/origin/config.json
+++ b/boards/default_src/micropython_esp32c3/origin/config.json
@@ -1,25 +1,133 @@
{
"board": {
- "MixGo ME": "micropython:esp32c3:mixgo_me",
- "MixGo CC": "micropython:esp32c3:mixgo_cc",
- "MixGo Car 4.2": "micropython:esp32c3:mixgocar_c3",
- "ESP32C3 Generic(UART)": "micropython:esp32c3:generic"
+ "MixGo ME": {
+ "key": "micropython:esp32c3:mixgo_me",
+ "config": [
+ {
+ "key": "BurnSpeed",
+ "label": "Burn Speed",
+ "messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
+ "options": [
+ {
+ "key": "460800",
+ "label": "460800"
+ },
+ {
+ "key": "115200",
+ "label": "115200"
+ },
+ {
+ "key": "230400",
+ "label": "230400"
+ },
+ {
+ "key": "921600",
+ "label": "921600"
+ }
+ ]
+ }
+ ]
+ },
+ "MixGo CC": {
+ "key": "micropython:esp32c3:mixgo_cc",
+ "config": [
+ {
+ "key": "BurnSpeed",
+ "label": "Burn Speed",
+ "messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
+ "options": [
+ {
+ "key": "460800",
+ "label": "460800"
+ },
+ {
+ "key": "115200",
+ "label": "115200"
+ },
+ {
+ "key": "230400",
+ "label": "230400"
+ },
+ {
+ "key": "921600",
+ "label": "921600"
+ }
+ ]
+ }
+ ]
+ },
+ "MixGo Car 4.2": {
+ "key": "micropython:esp32c3:mixgocar_c3",
+ "config": [
+ {
+ "key": "BurnSpeed",
+ "label": "Burn Speed",
+ "messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
+ "options": [
+ {
+ "key": "460800",
+ "label": "460800"
+ },
+ {
+ "key": "115200",
+ "label": "115200"
+ },
+ {
+ "key": "230400",
+ "label": "230400"
+ },
+ {
+ "key": "921600",
+ "label": "921600"
+ }
+ ]
+ }
+ ]
+ },
+ "ESP32C3 Generic(UART)": {
+ "key": "micropython:esp32c3:generic",
+ "config": [
+ {
+ "key": "BurnSpeed",
+ "label": "Burn Speed",
+ "messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
+ "options": [
+ {
+ "key": "460800",
+ "label": "460800"
+ },
+ {
+ "key": "115200",
+ "label": "115200"
+ },
+ {
+ "key": "230400",
+ "label": "230400"
+ },
+ {
+ "key": "921600",
+ "label": "921600"
+ }
+ ]
+ }
+ ]
+ }
},
"language": "MicroPython",
"burn": {
"type": "command",
"portSelect": "all",
"micropython:esp32c3:mixgo_cc": {
- "command": "\"{esptool}\" --chip esp32c3 --port {com} --baud 460800 erase_flash && \"{esptool}\" --chip esp32c3 --port {com} --baud 460800 write_flash 0x0 \"{indexPath}/build/Mixgo_CC_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
+ "command": "\"{esptool}\" --chip esp32c3 --port {com} --baud {baudrate} write_flash -e 0x0 \"{indexPath}/build/Mixgo_CC_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
"micropython:esp32c3:mixgo_me": {
- "command": "\"{esptool}\" --chip esp32c3 --port {com} --baud 460800 erase_flash && \"{esptool}\" --chip esp32c3 --port {com} --baud 460800 write_flash 0x0 \"{indexPath}/build/Mixgo_ME_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
+ "command": "\"{esptool}\" --chip esp32c3 --port {com} --baud {baudrate} write_flash -e 0x0 \"{indexPath}/build/Mixgo_ME_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
"micropython:esp32c3:mixgocar_c3": {
- "command": "\"{esptool}\" --chip esp32c3 --port {com} --baud 460800 erase_flash && \"{esptool}\" --chip esp32c3 --port {com} --baud 460800 write_flash 0x0 \"{indexPath}/build/Mixgo_Car_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
+ "command": "\"{esptool}\" --chip esp32c3 --port {com} --baud {baudrate} write_flash -e 0x0 \"{indexPath}/build/Mixgo_Car_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
"micropython:esp32c3:generic": {
- "command": "\"{esptool}\" --chip esp32c3 --port {com} --baud 460800 erase_flash && \"{esptool}\" --chip esp32c3 --port {com} --baud 460800 write_flash 0x0 \"{indexPath}/build/Generic_C3_UART_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
+ "command": "\"{esptool}\" --chip esp32c3 --port {com} --baud {baudrate} write_flash -e 0x0 \"{indexPath}/build/Generic_C3_UART_lib-v1.23.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
}
},
"upload": {
diff --git a/boards/default_src/micropython_esp32s2/index.js b/boards/default_src/micropython_esp32s2/index.js
index 936d3f2c..72235c08 100644
--- a/boards/default_src/micropython_esp32s2/index.js
+++ b/boards/default_src/micropython_esp32s2/index.js
@@ -73,7 +73,10 @@ import {
MicroPythonSensorOnBoardGenerators,
MicroPythonSerialGenerators,
MicroPythonSystemGenerators,
- MicroPythonWeatherGenerators
+ MicroPythonWeatherGenerators,
+ MicroPythonZhHans,
+ MicroPythonZhHant,
+ MicroPythonEn
} from '@mixly/micropython';
import {
@@ -88,6 +91,11 @@ import './css/color_esp32s2_mixgoce.css';
Object.assign(Blockly.Variables, Variables);
Object.assign(Blockly.Procedures, Procedures);
+
+Object.assign(Blockly.Lang.ZhHans, MicroPythonZhHans);
+Object.assign(Blockly.Lang.ZhHant, MicroPythonZhHant);
+Object.assign(Blockly.Lang.En, MicroPythonEn);
+
Blockly.Python = Python;
Blockly.generator = Python;
diff --git a/boards/default_src/micropython_esp32s2/origin/config.json b/boards/default_src/micropython_esp32s2/origin/config.json
index f7da70ad..debb55cc 100644
--- a/boards/default_src/micropython_esp32s2/origin/config.json
+++ b/boards/default_src/micropython_esp32s2/origin/config.json
@@ -1,35 +1,89 @@
{
"board": {
- "MixGo CE": "micropython:esp32s2:mixgo_ce",
- "ESP32S2 Generic": "micropython:esp32s2:generic"
+ "MixGo CE": {
+ "key": "micropython:esp32s2:mixgo_ce",
+ "config": [
+ {
+ "key": "BurnSpeed",
+ "label": "Burn Speed",
+ "messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
+ "options": [
+ {
+ "key": "460800",
+ "label": "460800"
+ },
+ {
+ "key": "115200",
+ "label": "115200"
+ },
+ {
+ "key": "230400",
+ "label": "230400"
+ },
+ {
+ "key": "921600",
+ "label": "921600"
+ }
+ ]
+ }
+ ]
+ },
+ "ESP32S2 Generic": {
+ "key": "micropython:esp32s2:generic",
+ "config": [
+ {
+ "key": "BurnSpeed",
+ "label": "Burn Speed",
+ "messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
+ "options": [
+ {
+ "key": "460800",
+ "label": "460800"
+ },
+ {
+ "key": "115200",
+ "label": "115200"
+ },
+ {
+ "key": "230400",
+ "label": "230400"
+ },
+ {
+ "key": "921600",
+ "label": "921600"
+ }
+ ]
+ }
+ ]
+ }
},
"language": "MicroPython",
"burn": {
"type": "command",
"portSelect": "all",
"micropython:esp32s2:mixgo_ce": {
- "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x1000 \"{indexPath}/build/Mixgo_CE_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\"",
+ "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud {baudrate} --after=no_reset write_flash -e 0x1000 \"{indexPath}/build/Mixgo_CE_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\"",
"special": [
{
"name": "Default",
- "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x1000 \"{indexPath}/build/Mixgo_CE_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
+ "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud {baudrate} --after=no_reset write_flash -e 0x1000 \"{indexPath}/build/Mixgo_CE_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
{
"name": "ESP-AT-mode",
- "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x0000 \"{indexPath}/build/MixGo-CE_AT-T17_R18.bin\""
+ "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud {baudrate} --after=no_reset write_flash -e 0x0000 \"{indexPath}/build/MixGo-CE_AT-T17_R18.bin\""
}
]
},
"micropython:esp32s2:generic": {
- "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x1000 \"{indexPath}/build/Generic_S2_lib-v1.25.0.bin\"",
+ "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud {baudrate} --after=no_reset write_flash -e 0x1000 \"{indexPath}/build/Generic_S2_lib-v1.25.0.bin\"",
"special": [
{
"name": "Default",
- "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x1000 \"{indexPath}/build/Generic_S2_lib-v1.25.0.bin\""
+ "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud {baudrate} --after=no_reset write_flash -e 0x1000 \"{indexPath}/build/Generic_S2_lib-v1.25.0.bin\""
},
{
"name": "ESP-AT-mode",
- "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s2 --port {com} --baud 460800 --after=no_reset write_flash 0x0000 \"{indexPath}/build/MixGo-CE_AT-T17_R18.bin\""
+ "command": "\"{esptool}\" --chip esp32s2 --port {com} --baud {baudrate} --after=no_reset write_flash -e 0x0000 \"{indexPath}/build/MixGo-CE_AT-T17_R18.bin\""
}
]
}
diff --git a/boards/default_src/micropython_esp32s3/index.js b/boards/default_src/micropython_esp32s3/index.js
index 6e0f4125..4f430753 100644
--- a/boards/default_src/micropython_esp32s3/index.js
+++ b/boards/default_src/micropython_esp32s3/index.js
@@ -73,7 +73,10 @@ import {
MicroPythonSensorOnBoardGenerators,
MicroPythonSerialGenerators,
MicroPythonSystemGenerators,
- MicroPythonWeatherGenerators
+ MicroPythonWeatherGenerators,
+ MicroPythonZhHans,
+ MicroPythonZhHant,
+ MicroPythonEn
} from '@mixly/micropython';
import {
@@ -90,6 +93,11 @@ import './css/color_esp32s2_mixgoce.css';
Object.assign(Blockly.Variables, Variables);
Object.assign(Blockly.Procedures, Procedures);
+
+Object.assign(Blockly.Lang.ZhHans, MicroPythonZhHans);
+Object.assign(Blockly.Lang.ZhHant, MicroPythonZhHant);
+Object.assign(Blockly.Lang.En, MicroPythonEn);
+
Blockly.Python = Python;
Blockly.generator = Python;
diff --git a/boards/default_src/micropython_esp32s3/origin/config.json b/boards/default_src/micropython_esp32s3/origin/config.json
index 3c7ad8c7..4a8b393e 100644
--- a/boards/default_src/micropython_esp32s3/origin/config.json
+++ b/boards/default_src/micropython_esp32s3/origin/config.json
@@ -1,21 +1,102 @@
{
"board": {
- "元控青春": "micropython:esp32s3:mixgo_nova",
- "元控自强": "micropython:esp32s3:mixgo_sant",
- "S3_generic":"micropython:esp32s3:generic"
+ "元控青春": {
+ "key": "micropython:esp32s3:mixgo_nova",
+ "config": [
+ {
+ "key": "BurnSpeed",
+ "label": "Burn Speed",
+ "messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
+ "options": [
+ {
+ "key": "460800",
+ "label": "460800"
+ },
+ {
+ "key": "115200",
+ "label": "115200"
+ },
+ {
+ "key": "230400",
+ "label": "230400"
+ },
+ {
+ "key": "921600",
+ "label": "921600"
+ }
+ ]
+ }
+ ]
+ },
+ "元控自强": {
+ "key": "micropython:esp32s3:mixgo_sant",
+ "config": [
+ {
+ "key": "BurnSpeed",
+ "label": "Burn Speed",
+ "messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
+ "options": [
+ {
+ "key": "460800",
+ "label": "460800"
+ },
+ {
+ "key": "115200",
+ "label": "115200"
+ },
+ {
+ "key": "230400",
+ "label": "230400"
+ },
+ {
+ "key": "921600",
+ "label": "921600"
+ }
+ ]
+ }
+ ]
+ },
+ "S3_generic": {
+ "key": "micropython:esp32s3:generic",
+ "config": [
+ {
+ "key": "BurnSpeed",
+ "label": "Burn Speed",
+ "messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
+ "options": [
+ {
+ "key": "460800",
+ "label": "460800"
+ },
+ {
+ "key": "115200",
+ "label": "115200"
+ },
+ {
+ "key": "230400",
+ "label": "230400"
+ },
+ {
+ "key": "921600",
+ "label": "921600"
+ }
+ ]
+ }
+ ]
+ }
},
"language": "MicroPython",
"burn": {
"type": "command",
"portSelect": "all",
"micropython:esp32s3:mixgo_sant": {
- "command": "\"{esptool}\" --chip esp32s3 --port {com} --baud 460800 --before default_reset --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s3 --port {com} --baud 460800 --after hard_reset write_flash 0x0 \"{indexPath}/build/Mixgo_Sant_lib-v1.13.0.bin\" 0xE00000 \"{indexPath}/../micropython/build/HZK16_GBK.bin\""
+ "command": "\"{esptool}\" --chip esp32s3 --port {com} --baud {baudrate} --after hard_reset write_flash -e 0x0 \"{indexPath}/build/Mixgo_Sant_lib-v1.13.0.bin\" 0xE00000 \"{indexPath}/../micropython/build/HZK16_GBK.bin\""
},
"micropython:esp32s3:mixgo_nova": {
- "command": "\"{esptool}\" --chip esp32s3 --port {com} --baud 460800 --before default_reset --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s3 --port {com} --baud 460800 --after hard_reset write_flash 0x0 \"{indexPath}/build/Mixgo_Nova_lib-v1.21.0.bin\" 0x700000 \"{indexPath}/../micropython/build/HZK12.bin\""
+ "command": "\"{esptool}\" --chip esp32s3 --port {com} --baud {baudrate} --after hard_reset write_flash -e 0x0 \"{indexPath}/build/Mixgo_Nova_lib-v1.21.0.bin\" 0x700000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
"micropython:esp32s3:generic": {
- "command": "\"{esptool}\" --chip esp32s3 --port {com} --baud 460800 --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s3 --port {com} --baud 460800 --after=no_reset write_flash 0x0 \"{indexPath}/build/Generic_S3_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
+ "command": "\"{esptool}\" --chip esp32s3 --port {com} --baud {baudrate} --after=no_reset write_flash -e 0x0 \"{indexPath}/build/Generic_S3_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
}
},
"upload": {
diff --git a/boards/default_src/micropython_robot/index.js b/boards/default_src/micropython_robot/index.js
index acc4d1f4..2c265e79 100644
--- a/boards/default_src/micropython_robot/index.js
+++ b/boards/default_src/micropython_robot/index.js
@@ -67,7 +67,10 @@ import {
MicroPythonSensorOnBoardGenerators,
MicroPythonSerialGenerators,
MicroPythonSystemGenerators,
- MicroPythonWeatherGenerators
+ MicroPythonWeatherGenerators,
+ MicroPythonZhHans,
+ MicroPythonZhHant,
+ MicroPythonEn
} from '@mixly/micropython';
import {
@@ -80,6 +83,11 @@ import './css/color_esp32_mixgo.css';
Object.assign(Blockly.Variables, Variables);
Object.assign(Blockly.Procedures, Procedures);
+
+Object.assign(Blockly.Lang.ZhHans, MicroPythonZhHans);
+Object.assign(Blockly.Lang.ZhHant, MicroPythonZhHant);
+Object.assign(Blockly.Lang.En, MicroPythonEn);
+
Blockly.Python = Python;
Blockly.generator = Python;
diff --git a/boards/default_src/micropython_robot/origin/config.json b/boards/default_src/micropython_robot/origin/config.json
index eefcc469..37f4037c 100644
--- a/boards/default_src/micropython_robot/origin/config.json
+++ b/boards/default_src/micropython_robot/origin/config.json
@@ -1,21 +1,102 @@
{
"board": {
- "飞乙": "micropython:esp32c3:feiyi",
- "超霸大师": "micropython:esp32:mixbot",
- "机器人大师": "micropython:esp32:rm_e1"
+ "飞乙": {
+ "key": "micropython:esp32c3:feiyi",
+ "config": [
+ {
+ "key": "BurnSpeed",
+ "label": "Burn Speed",
+ "messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
+ "options": [
+ {
+ "key": "460800",
+ "label": "460800"
+ },
+ {
+ "key": "115200",
+ "label": "115200"
+ },
+ {
+ "key": "230400",
+ "label": "230400"
+ },
+ {
+ "key": "921600",
+ "label": "921600"
+ }
+ ]
+ }
+ ]
+ },
+ "超霸大师": {
+ "key": "micropython:esp32:mixbot",
+ "config": [
+ {
+ "key": "BurnSpeed",
+ "label": "Burn Speed",
+ "messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
+ "options": [
+ {
+ "key": "460800",
+ "label": "460800"
+ },
+ {
+ "key": "115200",
+ "label": "115200"
+ },
+ {
+ "key": "230400",
+ "label": "230400"
+ },
+ {
+ "key": "921600",
+ "label": "921600"
+ }
+ ]
+ }
+ ]
+ },
+ "机器人大师": {
+ "key": "micropython:esp32:rm_e1",
+ "config": [
+ {
+ "key": "BurnSpeed",
+ "label": "Burn Speed",
+ "messageId": "MICROPYTHON_CONFIG_MESSAGE_BURN_SPEED",
+ "options": [
+ {
+ "key": "460800",
+ "label": "460800"
+ },
+ {
+ "key": "115200",
+ "label": "115200"
+ },
+ {
+ "key": "230400",
+ "label": "230400"
+ },
+ {
+ "key": "921600",
+ "label": "921600"
+ }
+ ]
+ }
+ ]
+ }
},
"language": "MicroPython",
"burn": {
"type": "command",
"portSelect": "all",
"micropython:esp32c3:feiyi": {
- "command": "\"{esptool}\" --chip esp32c3 --port {com} --baud 460800 erase_flash && \"{esptool}\" --chip esp32c3 --port {com} --baud 460800 write_flash 0x0 \"{indexPath}/build/Mixgo_FeiYi_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
+ "command": "\"{esptool}\" --chip esp32c3 --port {com} --baud {baudrate} write_flash -e 0x0 \"{indexPath}/build/Mixgo_FeiYi_lib-v1.25.0.bin\" 0X3A0000 \"{indexPath}/../micropython/build/HZK12.bin\""
},
"micropython:esp32:rm_e1": {
- "command": "\"{esptool}\" --chip esp32 --port {com} --baud 460800 erase_flash && \"{esptool}\" --port {com} --baud 460800 write_flash 0x1000 \"{indexPath}/build/RM_E1_lib-v1.25.0.bin\""
+ "command": "\"{esptool}\" --port {com} --baud {baudrate} write_flash -e 0x1000 \"{indexPath}/build/RM_E1_lib-v1.25.0.bin\""
},
"micropython:esp32:mixbot": {
- "command": "\"{esptool}\" --chip esp32 --port {com} --baud 460800 erase_flash && \"{esptool}\" --port {com} --baud 460800 write_flash 0x1000 \"{indexPath}/build/MixBot_lib-v1.25.0.bin\""
+ "command": "\"{esptool}\" --port {com} --baud {baudrate} write_flash -e 0x1000 \"{indexPath}/build/MixBot_lib-v1.25.0.bin\""
}
},
"upload": {
diff --git a/common/modules/mixly-modules/electron/burn-upload.js b/common/modules/mixly-modules/electron/burn-upload.js
index f0f567a6..142df732 100644
--- a/common/modules/mixly-modules/electron/burn-upload.js
+++ b/common/modules/mixly-modules/electron/burn-upload.js
@@ -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);
}
diff --git a/common/modules/mixly-modules/web/burn-upload.js b/common/modules/mixly-modules/web/burn-upload.js
index c4f8f01a..9d5bfffc 100644
--- a/common/modules/mixly-modules/web/burn-upload.js
+++ b/common/modules/mixly-modules/web/burn-upload.js
@@ -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`);