Turns out I only need to do this (source: Martinec)
This commit is contained in:
@@ -92,10 +92,9 @@ impl Monitor {
|
|||||||
if key == KeyCode::Char('r') && mods == KeyModifiers::CONTROL {
|
if key == KeyCode::Char('r') && mods == KeyModifiers::CONTROL {
|
||||||
stdout.write_all(b"\r\n*** Reboot ***\r\n")?;
|
stdout.write_all(b"\r\n*** Reboot ***\r\n")?;
|
||||||
port.set_dtr(true)?;
|
port.set_dtr(true)?;
|
||||||
port.set_rts(true)?;
|
port.set_rts(false)?;
|
||||||
std::thread::sleep(Duration::from_millis(10));
|
std::thread::sleep(Duration::from_millis(10));
|
||||||
port.set_dtr(false)?;
|
port.set_dtr(false)?;
|
||||||
port.set_rts(false)?;
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -244,10 +244,9 @@ impl Target for PhysicalTarget {
|
|||||||
impl Drop for PhysicalTarget {
|
impl Drop for PhysicalTarget {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
let _ = self.port.set_dtr(true);
|
let _ = self.port.set_dtr(true);
|
||||||
let _ = self.port.set_rts(true);
|
let _ = self.port.set_rts(false);
|
||||||
std::thread::sleep(Duration::from_millis(100));
|
std::thread::sleep(Duration::from_millis(100));
|
||||||
let _ = self.port.set_dtr(false);
|
let _ = self.port.set_dtr(false);
|
||||||
let _ = self.port.set_rts(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user