From 896b9339b8869a1a76bfdaf8d7f55728d236486f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=AB=8B=E5=B8=AE?= <3294713004@qq.com> Date: Tue, 3 Sep 2024 09:18:23 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86linu?= =?UTF-8?q?x=E7=B3=BB=E7=BB=9F=E4=B8=8BsetDTRAndRTS=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mixly-modules/common/statusbar-serial.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/common/modules/mixly-modules/common/statusbar-serial.js b/common/modules/mixly-modules/common/statusbar-serial.js index 5ad5458b..79a35b4a 100644 --- a/common/modules/mixly-modules/common/statusbar-serial.js +++ b/common/modules/mixly-modules/common/statusbar-serial.js @@ -455,11 +455,15 @@ class StatusBarSerial extends PageBase { async open() { await this.#serial_.open(this.#config_.baud); await this.#serial_.sleep(200); - await this.#serial_.setDTRAndRTS(this.#config_.dtr, this.#config_.rts); + 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); await this.#serial_.interrupt(); - await this.#serial_.sleep(1000); + await this.#serial_.sleep(500); this.#valueTemp_ = ''; this.empty(); this.startRead(); @@ -479,7 +483,11 @@ class StatusBarSerial extends PageBase { } else { await this.#serial_.open(); await this.#serial_.sleep(200); - await this.#serial_.setDTRAndRTS(this.#config_.dtr, this.#config_.rts); + try { + await this.#serial_.setDTRAndRTS(this.#config_.dtr, this.#config_.rts); + } catch (error) { + Debug.error(error); + } this.startRead(); } }