From 0404e2efdc14586e4b7cd183528e5283048d6f5d Mon Sep 17 00:00:00 2001 From: Dean Cording Date: Fri, 24 Jan 2014 00:53:17 +1000 Subject: [PATCH] Fix for handling Uno reboot when serial port opened. --- Programmer/Programmer.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Programmer/Programmer.pl b/Programmer/Programmer.pl index 29092f3..939cab5 100755 --- a/Programmer/Programmer.pl +++ b/Programmer/Programmer.pl @@ -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) { @@ -48,6 +50,8 @@ chomp; last if /DONE/; + + print SERIAL "GO\n" if /READY/; if (/OK/) { $_ = ;