Commit Graph

16 Commits

Author SHA1 Message Date
Joerg Wunsch 7e20e7571f Make the code compile warning-free:
- declare a dummy "struct timezone" for some Win32 systems (MinGW)
- fix a few printf() argument types
- get rid off the prevailing "all filedescriptors are of type int"
  attitude

The last item required a large sweep across the code, in order to
replace all "int fd"s by "struct filedescriptor *fd"s, and pass
pointers (as we cannot pass a union directly).  In return, the
code is now supposed to be fully 64-bit safe, rather than relying
on a 64-bit pointer being converted to a (32-bit) int and back
to a pointer as we did previously.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@694 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-11 12:47:35 +00:00
Joerg Wunsch afb13a9936 Replace the fallback of avr_read_byte() and avr_write_byte() to
avr_read_byte_default() and avr_write_byte_default (resp.) by directly
calling the latter functions from within all programmers that don't
implement their own read_byte()/write_byte() methods.  In turn, make the
read_byte() and write_byte() methods mandatory, and the cmd() method
(direct ISP command) optional instead (it's effectively mandatory for
any programmer using avr_read_byte_default()/avr_write_byte_default()
though).  Remove all the pointless cmd() method stubs from those programmers
that don't need it.

Eliminate avr_read_byte() as it was now completely identical to
pgm->read_byte().


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@684 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-11-20 15:04:09 +00:00
Joerg Wunsch 4a55a6583a * butterfly.c: Remove the device support decision based on
the old AVR910 device codes; we've got signature verification
now so better rely on that.

* avr910.c: Revert the signature bytes returned, as it already
happened in butterfly.c.  This closes bug #14998: Signature Bytes
read in wrong order (avr910 mode)


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@638 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-09-01 10:03:12 +00:00
Joerg Wunsch 8ce2ee704c Fix for bug #16627: Butterfly programmer does not reset after programming
Wait for the device's response after sending an "E" command.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@634 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-08-31 11:02:25 +00:00
Joerg Wunsch f0decfde12 Fix yet another sign extension bug introduced by renaming "unsigned char"
to "char".


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@538 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-10-20 11:36:19 +00:00
Joerg Wunsch 3fd20e7edd Use a slightly different approach to avoid the signed/unsigned warning.
Pointed out by: Brian Dean


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@518 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-09-20 04:53:09 +00:00
Joerg Wunsch 7b099972b5 Make the device code received unsigned, so it wouldn't sign-extend if
it is beyond 0x80.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@517 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-09-19 14:22:30 +00:00
Joerg Wunsch 90db0f17c6 Improve the initializion sequence of the butterfly so it is more likely
to synchronize with the device.

bug #9787 overview: avrdude 4.4.0 correct butterfly interface


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@496 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-09-16 14:54:55 +00:00
Brian S. Dean e623fea507 Eliminate compiler warnings. GCC 4.x elicits many signedness warnings
when passing unsigned char * when char * is in the prototype and vice
versa.  Clean these up along with a few others.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@491 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-08-30 01:30:05 +00:00
Joerg Wunsch 975d7b786a Extend the butterfly code to fully support AVR109 boot loaders. Notable
changes to butterfly.c include:

. do not exit for unsupported devices but return -1 from the init function
  instead; that way the -F option can be used to continue anyway

. honor the -b option as arbitrary bootloaders could be implemented with
  any baud rate, not just the fixed 19200 Bd used by the butterfly

. implement functionality to read the fuse and lock bits, and write the
  (boot) lock bits, resp.

. fix the signature byte order

The remaining files document the new functionality.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@486 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-07-28 16:06:35 +00:00
Joerg Wunsch c2abd46745 Revert the serial_recv() timeout handling as it used to be before my
yesterday's changes (i.e. before rev. 1.10 of ser_posix.c), that is,
exit(1) in case of a timeout.  Previously, the upper layers didn't see
the timeout at all.

Quite possible that some of these drivers could handle a timeout more
intelligently though.  At least for the rather sophisticated STK500v2
protocol, I think it should be possible to retry the request.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@460 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-05-11 17:09:22 +00:00
Brian S. Dean 6249f94515 Update code copyrights.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@438 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-12-22 01:52:45 +00:00
kiwi64ajs be4f46c49e merged in changes to allow native Win32 build with no cygwin DLL dependancy
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@419 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-06-24 11:05:07 +00:00
Jan-Hinnerk Reichert 4f6c8867b5 * pgm.c, main.c, avr910.c, butterfly.c, stk500.c: Changed default for powerup, powerdown and LED-commands to do nothing and return OK. Then removed these commands from avr910, butterfly and stk500.
* pgm.c: Fixed wrong type for default_open introduced by the cleanup yesterday.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@409 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-01-29 13:23:59 +00:00
Jan-Hinnerk Reichert 51491c6916 * pgm.[ch], main.c, par.c, avr910.c, butterfly.c, stk500.c:
Move save/restore-functionality into open/close.
	* par.c: open/close now saves/restores PPICTRL, too.
	* TODO: exitspecs don't work if RESET is in PPICTRL.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@407 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-01-28 20:01:44 +00:00
Brian S. Dean bceb249858 Add support for the Atmel Butterfly board which talks to the
Butterfly's supplied bootloader firmware.

Contributed by: Michael Mayer <michael-mayer@gmx.de>


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@387 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-11-30 15:16:48 +00:00