Skip to content

Commit

Permalink
Fix for handling Uno reboot when serial port opened.
Browse files Browse the repository at this point in the history
  • Loading branch information
DeanCording committed Jan 23, 2014
1 parent 5997992 commit 0404e2e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Programmer/Programmer.pl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
open(HEX, "<", $ARGV[0]) or die "Cannot open $ARGV[0]: $!";
open(SERIAL, "+<", $ARGV[1]) or die "Cannot open $ARGV[1]: $!";

sleep 1; # Wait for Arduino to reboot

print SERIAL "GO\n";

while (1) {
Expand All @@ -48,6 +50,8 @@
chomp;

last if /DONE/;

print SERIAL "GO\n" if /READY/;

if (/OK/) {
$_ = <HEX>;
Expand Down

0 comments on commit 0404e2e

Please sign in to comment.