aboutsummaryrefslogtreecommitdiff
path: root/bin/ard-reset-arduino
diff options
context:
space:
mode:
authorSudar <sudar@sudarmuthu.com>2013-07-02 08:41:19 +0530
committerSudar <sudar@sudarmuthu.com>2013-07-02 21:48:33 +0530
commit5abf12bdb2fa131e840d89a09fd11e8da0e2f433 (patch)
tree57bf716b5c76496ce5fd81a82f042b2a8325341f /bin/ard-reset-arduino
parent8a2e251e95205c6501932bf167fc763b1a5b574c (diff)
Move wait-for-reconnection logic inside ard-reset-arduino
When a Leonardo based board is reset, the port disappears and we need to wait till it comes back. Earlier this logic was handled by a separate shell script. Now the logic is moved inside the ard-reset-arduino perl script. This is done to reduce the number of binaries that are needed by the makefile. Fix #95
Diffstat (limited to 'bin/ard-reset-arduino')
-rwxr-xr-xbin/ard-reset-arduino13
1 files changed, 12 insertions, 1 deletions
diff --git a/bin/ard-reset-arduino b/bin/ard-reset-arduino
index 6269878..de5cf93 100755
--- a/bin/ard-reset-arduino
+++ b/bin/ard-reset-arduino
@@ -39,7 +39,18 @@ foreach my $dev (@ARGV)
$p->write_settings;
$p->close;
- print STDERR "Switching to 1200 baud on $dev\n"
+ print STDERR "Forcing reset using 1200bps open/close on port $dev\n"
+ if $Opt{verbose};
+
+ # wait for it to come back
+ sleep 1;
+ while( ! -e $dev ) {
+ print STDERR "Waiting for $dev to come back\n"
+ if $Opt{verbose};
+ sleep 1;
+ }
+
+ print STDERR "$dev has come back after reset\n"
if $Opt{verbose};
}
else