I found that the previous reset code did not work for Leonardo or Micro, nor did any reset code anywhere on the internet.
An examination of the Arduino IDE source code (and the JNI code behind its serial implementation) shows that it holds RTS high and DTR low when doing the 1200 baud open/close. And it turns out that's exactly what's needed!
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
Micro can be reset using Leonardo reset functions itself. So call
Leonardo reset functions for Micro as well.
The reset function seems to have some issues for Micro and is not
100% reliable, like Leonardo. See comments in #30.
Fix#80Fix#83
ard-reset-leonardo which was used for reseting Leonardo was written in
Python. Now the logic is added inside the ard-reset-arduino perl script
itself.
Fix#62
Squashed commit of the following:
commit a63366980f
Author: Simon John <git@the-jedi.co.uk>
Date: Fri Jun 14 11:36:00 2013 +0200
who put a space in the shebangs?!
commit c798eb26ea
Author: Simon John <git@the-jedi.co.uk>
Date: Fri Jun 14 11:10:12 2013 +0200
replaced ard-reset-leonardo with an update to ard-reset-arduino
which is now called from Arduino.mk with the --leonardo flag
removed some trailing whitespace
upped version string in Arduino.mk