Yea, more hacks to avrdude are fine. If we can just include a reset parameter in a new programmer definition in the config file, that would be awesome. Otherwise, whatever you think is the best approach is probably fine.
I'm not sure why I have the explicit DTR flipping in the IDE source. It may be because there are certain situations (e.g. if you set or unset HUPCL the previous time you opened the port), in which the board won't reset just from the port being opened. Although even then, when we open the port to flush it, it should reset HUPCL, so the board should reset when avrdude opens the port. Honestly, I probably just wasn't thinking.
no problem, i dont like to do much thinking either. it hurts the brains.
here is the plan, i would to fix the two-bootloader problem because a lot of people seem to want extra chips but i dont want to have to deal with carrying two kinds of chips. thus it would be good to have one bootloader that works with both NG and diecimilas. i also want this bootloader to work w/my clones. i also want to shink the bootloader down to under 1K which is certainly possible. it would also be good if this bootloading system could cope with future chips as i i know that is already in the worx. therefore, here is my PLAN: (<= note the planningness of this plan)
1. bootloader will be changed so it has two timeouts. one while its waiting for first serial character (3 seconds) and one after its received at least one valid bootloading directive (7-10 seconds)
2. avrdude will be modded so that it uses either RTS or DTR (or whichever pin indictaed in the .conf)
3. when users clicks "upload" the software uses avrdude to read the sig and fuses*. software then compiles sketch then hands off .hex to avrdude again for uploading.
4. avrdude will also be modded so RTS and DTR are not twiddled automatically whenever the port is opened/closed, if possible. i -think- under linux/mac the ioctls are in charge of this.
5. bootloader starts sketch immediately upon recieving "done programming" command ('Q') if and only if it has at some point also executed a flash-write command ('d')
i -believe- this will solve the problem for any OS user and any Arduino user combo. in the worst case the wait time will be 3 seconds. NG users will have to click the upload button within that same time period after pressing reset.
i can write the code and maybe some people can try it out. it certainly doesnt have to be the default diecimila bootloader that comes with the device, but may be a good intermediate bootloader.
only question im not sure of is if java can get avrdude to execute within a few seconds to do the first fuse/sigbyte read. im pretty sure it can as exec() is a pretty low level command, but it will require some testing.
let me know what you think! is this a pipe dream??
* reading the fuses before compilation is part of a grander scheme in which the software uses the fuse data to calculate the size and location of the bootloader thus the max-sketch size, and the signature to verify the chip selected is correct. it can also tell if you're using a lilypad because it would read the internal 8mhz oscillator fuse, may be very useful!