Improved chances for successful sync

This commit is contained in:
2025-09-25 12:06:30 +02:00
parent 62dadc65d0
commit 276ae61783

View File

@@ -37,7 +37,6 @@ impl PhysicalTarget {
}
pub fn resync_target(&mut self) -> Result<(), Error> {
self.port.discard_buffers()?;
self.port.set_dtr(true)?;
self.port.set_rts(true)?;
std::thread::sleep(Duration::from_millis(10));
@@ -45,6 +44,8 @@ impl PhysicalTarget {
std::thread::sleep(Duration::from_millis(100));
for i in (0..5).rev() {
self.port.discard_buffers()?;
std::thread::sleep(Duration::from_millis(10));
self.port.write(b"U")?;
let mut buf = [0u8; 1];