feat(core): 在线版添加对web compiler的支持

This commit is contained in:
王立帮
2025-05-04 14:38:32 +08:00
parent b9c0574780
commit e3f5caf0ce
21 changed files with 641 additions and 498 deletions

View File

@@ -128,7 +128,7 @@ class WebSocketArduShell {
statusBarSerial.open()
.then(() => {
const baudRates = code.match(/(?<=Serial.begin[\s]*\([\s]*)[0-9]*(?=[\s]*\))/g);
if (!baudRates.length) {
if (!baudRates?.length) {
return statusBarSerial.setBaudRate(9600);
} else {
return statusBarSerial.setBaudRate(baudRates[0] - 0);