Skip to content

Commit

Permalink
esp-rs#349 Add UnixTight reset strategy.
Browse files Browse the repository at this point in the history
Clean experimental code
  • Loading branch information
AVee committed Jun 1, 2023
1 parent 5db203e commit 453fd16
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions espflash/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,29 +177,24 @@ impl Connection {

fn usb_jtag_reset(&mut self) -> Result<(), Error> {
info!("Attempting USB-JTAG reset...");
self.serial.write_dtr_rts(false, false)?;
// self.serial.write_data_terminal_ready(false)?;
// self.serial.write_request_to_send(false)?;
self.serial.write_data_terminal_ready(false)?;
self.serial.write_request_to_send(false)?;

sleep(Duration::from_millis(100));

self.serial.write_dtr_rts(true, false)?;
// self.serial.write_data_terminal_ready(true)?;
// self.serial.write_request_to_send(false)?;
self.serial.write_data_terminal_ready(true)?;
self.serial.write_request_to_send(false)?;

sleep(Duration::from_millis(100));

self.serial.write_dtr_rts(false, true)?;
// self.serial.write_request_to_send(true)?;
// self.serial.write_data_terminal_ready(false)?;
// self.serial.write_request_to_send(true)?;
self.serial.write_dtr_rts(false, true)?;
self.serial.write_request_to_send(true)?;
self.serial.write_data_terminal_ready(false)?;
self.serial.write_request_to_send(true)?;

sleep(Duration::from_millis(100));

// self.serial.write_data_terminal_ready(false)?;
// self.serial.write_request_to_send(false)?;
self.serial.write_dtr_rts(false, false)?;
self.serial.write_data_terminal_ready(false)?;
self.serial.write_request_to_send(false)?;
self.wait_for_connection()
}

Expand Down

0 comments on commit 453fd16

Please sign in to comment.