Update: 在线版打开串口时不再自动设置dtr和rts (实验性)

This commit is contained in:
王立帮
2025-03-09 12:04:27 +08:00
parent 405cc2339c
commit c18326aca4
2 changed files with 38 additions and 55 deletions

View File

@@ -458,11 +458,13 @@ class StatusBarSerial extends PageBase {
async open() {
await this.#serial_.open(this.#config_.baud);
await this.#serial_.sleep(200);
try {
await this.#serial_.setDTRAndRTS(this.#config_.dtr, this.#config_.rts);
} catch (error) {
Debug.error(error);
if (goog.isElectron || Env.hasSocketServer) {
await this.#serial_.sleep(200);
try {
await this.#serial_.setDTRAndRTS(this.#config_.dtr, this.#config_.rts);
} catch (error) {
Debug.error(error);
}
}
if (SELECTED_BOARD?.serial?.ctrlCBtn) {
await this.#serial_.sleep(500);