Fix: 修复部分linux系统下setDTRAndRTS报错
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user