Skip to content

Commit

Permalink
fix: 在原装的daplink上自动复位有问题
Browse files Browse the repository at this point in the history
  • Loading branch information
HalfSweet committed Jan 1, 2024
1 parent 758b12f commit 29f8316
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "AirISP-next"
version = "0.1.4"
version = "0.1.5"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
5 changes: 4 additions & 1 deletion src/peripheral/general_uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,18 +398,21 @@ impl Pp for GeneralUart<'_> {
// 硬件复位
"hard_reset" => {
match self.air_isp.get_before().as_str() {
// 使用异或电路
"direct_connect" => {
self.handle.write_request_to_send(true).unwrap();
self.handle.write_data_terminal_ready(true).unwrap();
std::thread::sleep(Duration::from_millis(20));
self.handle.write_request_to_send(false).unwrap();
self.handle.write_data_terminal_ready(true).unwrap();
},
// 使用异或电路
"default_reset" | _ => {
self.handle.write_request_to_send(true).unwrap();
self.handle.write_data_terminal_ready(false).unwrap();

std::thread::sleep(Duration::from_millis(20));
self.handle.write_request_to_send(false).unwrap();
self.handle.write_data_terminal_ready(false).unwrap();
}
}

Expand Down

0 comments on commit 29f8316

Please sign in to comment.