Skip to content

Commit

Permalink
catch an error when we do the second pass reset attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
obra committed Jan 17, 2024
1 parent 0cd1e09 commit 2658e08
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/api/focus.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,13 @@ class Focus {

// If we reach this point, then either `device.reset` isn't available, or it
// failed to reboot the device. Try the 1200 baud tickle.
await baudUpdate();
await dtrToggle(true);
await dtrToggle(false);
try {
await baudUpdate();
await dtrToggle(true);
await dtrToggle(false);
} catch (e) {
console.log("Unable to baud-update and dtr toggle. This is probably because the orginal reboot worked", e);
}
}

async find(...device_descriptors) {
Expand Down

0 comments on commit 2658e08

Please sign in to comment.