Update: Arduino下自动根据代码中设置的串口波特率配置串口监视器 (#IAWTZG)

This commit is contained in:
王立帮
2024-10-14 20:24:05 +08:00
parent f82839e936
commit 3eec19ff4a
5 changed files with 98 additions and 65 deletions

View File

@@ -191,7 +191,9 @@ class WebSerial extends Serial {
async setBaudRate(baud) {
return new Promise((resolve, reject) => {
if (!this.isOpened() || this.getBaudRate() === baud) {
if (!this.isOpened()
|| this.getBaudRate() === baud
|| !this.baudRateIsLegal(baud)) {
resolve();
return;
}