Commit Graph

83 Commits

Author SHA1 Message Date
joerg_wunsch 8426fe578c Fix all "unused variable" warnings that were encountered.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1200 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-09-03 11:05:13 +00:00
joerg_wunsch 6341b31c6a Submitted by Travis Griggs:
bug #38307: Can't write usersig of an xmega256a3
* stk500v2.c (stk600_xprog_page_erase): allow erasing the usersig space.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1199 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-09-02 21:10:44 +00:00
joerg_wunsch b835ec2d6e bug #39794: warnings when building avrdude 6.0rc1 under CentOS 6.4
* buspirate.c: Turn the "cmd" argument of the various methods into
a "const unsigned char *"; while doing this, declare all arrays being
passed as arguments to be pointers rather than arrays, as the latter
obfuscates the way arrays are being passed to a callee in C.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1196 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-09-02 20:22:53 +00:00
joerg_wunsch cc0f65e60e bug #39893: Verification failure with AVRISPmkII and Xmega
* stk500v2.c (stk600_xprog_page_erase): Fix argument that is
passed to stk600_xprog_memtype()



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1188 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-08-30 06:49:40 +00:00
joerg_wunsch 9e321a0ead Submitted by "Malte" and John McCorquodale:
patch #7876 JTAGICE mkII fails to connect to attiny if debugwire
is enabled AND target has a very slow clock
* jtagmkII.c (jtagmkII_getsync): When leaving debugWIRE mode
temporarily, immediately retry with ISP, rather than leaving.
* stk500v2 (stk500v2_program_enable): Implemented similar logic
for the JTAGICE3.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1183 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-17 16:23:55 +00:00
joerg_wunsch 076e03472f * usbdefs.h (USBDEV_BULK_EP_WRITE_STK600)
(USBDEV_BULK_EP_READ_STK600): new define values
* stk500v2.c (stk600_open): use the STK600 EP values,
as they are different from AVRISPmkII



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1126 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-12-18 10:45:23 +00:00
joerg_wunsch 1f7b134420 * jtag3.c: Make jtag3_command() public
* jtag3.h: (Dito.)
* jtag3_private.h: Add two new commands
* stk500v2.c: Implement the "MonCon disable" hack that
allows temporarily falling back to ISP when trying to
talk to a part that has debugWIRE enabled



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1123 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-12-03 21:03:06 +00:00
joerg_wunsch 97357595b6 * pgm_type.c: Add "jtagice3_isp" programmer hook
* avrdude.conf.in: Add "jtag3isp" programmer
* jtag3.c: jtag3_setparm() is now public
* jtag3.h: (Dito)
* stk500v2_private.h: Command 0x1D is CMD_SPI_MULTI only
for STK500v2, AVRISPmkII, and JTAGICEmkII; for JTAGICE3,
it's CMD_SET_SCK now; also add CMD_GET_SCK
* avrpart.c (avr_get_output_index): New function
* avrpart.h: (Dito)
* stk500v2.c: Implement the pasthrough programmer glue logic
for JTAGICE3 in ISP mode
* stk500v2.h: (Dito)
* avrdude.1: Document the JTAGICE3 support.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1119 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-12-03 15:52:38 +00:00
joerg_wunsch 3fabed6ea5 Change all the USB details (endpoint numbers, max transfer size etc.)
to a per-programmer adjustable value.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1108 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-11-26 16:24:56 +00:00
joerg_wunsch 8fdf4d4071 Replace outdated FSF postal address by a reference to
the GPL info on their website.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1107 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-11-20 14:03:50 +00:00
joerg_wunsch dc38f7ca18 Xmega page erase implementation for XPROG (AVRISPmkII, STK600)
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1090 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-05-04 15:47:26 +00:00
joerg_wunsch 3fbb7642d2 Xmega page erase implementation for JTAGICEmkII
* jtagmkII.c: Handle flash pages sizes > 256 bytes, implement
page_erase() method
* avrdude.conf.in: Change flash pagesize for all Xmega devices
to 512 bytes
* avr.c: Implement auto_erase, using page_erase if available
* avr.h: Remove unused parameters from avr_read(), replace
unused parameter in avr_write)() by auto_erase
* stk500v2.c: Handle flash page sizes > 256 bytes
* update.c (do_op): Handle new updateflags parameter
* main.c: Implement auto_erase as page_erase if possible
* update.h (enum updateflags): New enum
* pgm.h (struct programmer_t): Add page_erase method



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1089 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-05-04 10:02:30 +00:00
joerg_wunsch 67060801c2 * stk500v2_private.h (struct pdata): add boot_start
* stk500v2.c: For the "flash" pseudo-memory of Xmega devices,
distinguish addresses between "application" and "boot" area.




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1081 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-04-19 13:32:34 +00:00
joerg_wunsch 069fb58779 bug #30451: Accessing some Xmega memory sections gives not
supported error
* stk500v2.c: Handle all Xmega memory sections (except
"prodsig" which is not documented in AVR079)
* fileio.c: Treat the "boot", "application", and "apptable"
regions (which are actually subregions of "flash") all as
being flash, i.e. suppress trailing 0xFF bytes when reading
them
* avr.c: (Dito.)



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1075 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-03-29 14:32:18 +00:00
rliebscher 751b96182c Parser does not need to know all programmer types now, new programmers
will update only the table in pgm_type.c.
  * config_gram.y, lexer.l: removed programmer type keywords,
    use now locate_programmer_type() function
  * pgm_type.[ch]: added new files for table of programmer types
  * main.c: allow list of programmer types by -c ?type
  * avrdude.conf.in: changed all type keywords to quoted strings
  * doc/avrdude.texi: changed description of type definition, list
    of valid types is now included from generated file
  * doc/Makefile.am: generate list of programmer types for doc
  * all programmers [hc]: add xxx_desc string for description of programmer


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1051 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-01-31 17:03:43 +00:00
rliebscher 9ccde79fde Fixed following findings reported by cppcheck
* avr910.c:625 (error) Possible null pointer dereference: cmd - otherwise it is redundant to check if cmd is null at line 624
	* avr910.c:626 (error) Possible null pointer dereference: cmd - otherwise it is redundant to check if cmd is null at line 624
	* avr910.c:168 (information) The scope of the variable 'devtype_1st' can be reduced
	* avr910.c:169 (information) The scope of the variable 'dev_supported' can be reduced
	* avrftdi.c:647 (error) Using sizeof for array given as function argument returns the size of pointer.
	* stk500v2.c:3347 (error) Memory leak: b
	* stk500v2.c:3452 (error) Memory leak: b
	* usbasp.c:554 (error) Using sizeof for array given as function argument returns the size of pointer.
	* usbasp.c:485 (information) The scope of the variable 'dly' can be reduced

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1035 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-01-08 17:09:40 +00:00
joerg_wunsch 8f807bd402 * stk500v2.c (stk600_xprog_paged_load, stk600_xprog_paged_write):
Fix regression in the AVRISPmkII/STK600 TPI handling introduced
by the USBasp's TPI implementation which added a pagesize even for
the minor memory regions of TPI devices.  Also fix wrong offset
introduced by the memory tagging patch.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1009 81a1dc3b-b13d-400b-aceb-764788c761c2
2011-09-15 13:04:36 +00:00
joerg_wunsch 95a42e16d5 Mega-commit to bring in memory tagging.
Each memory image byte is now tagged as it's being read from a file.
Only bytes read from a file will be written or verified (modulo page
granularity requirements).



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1007 81a1dc3b-b13d-400b-aceb-764788c761c2
2011-09-14 21:49:42 +00:00
joerg_wunsch 92952f3693 In stk500v2_command(), treat warnings as errors rather than success.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1006 81a1dc3b-b13d-400b-aceb-764788c761c2
2011-09-13 15:14:53 +00:00
joerg_wunsch 21983f7863 bug #34027: avrdude AT90S1200 Problem (part 2 - stk500v2 and relatives)
* stk500v2.c (stk500v2_initialize): For the AT90S1200, release
/RESET for a moment before reinitializing, as this is required by
its programming protocol.




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1004 81a1dc3b-b13d-400b-aceb-764788c761c2
2011-08-30 07:19:21 +00:00
joerg_wunsch b7c70ab98c Submitted by Brett Hagman:
Add support for the "Wiring" board/bootloader
* wiring.c: New file.
* wiring.h: (Ditto.)
* Makefile.am: Add new files.
* stk500v2_private.h: Reorganize so some functions and struct
pdata are globally known.
* stk500v2.c: (Ditto.)
* stk500v2.h: (Ditto.)
* lexer.l: Add new programmer keywords.
* config_gram.y: (Ditto.)
* avrdude.conf.in: Add "wiring" programmer entry.
* avrdude.1: Document the new programmer.
* doc/avrdude.texi: (Ditto.)
* AUTHORS: Add Brett Hagman.




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@987 81a1dc3b-b13d-400b-aceb-764788c761c2
2011-08-26 20:22:09 +00:00
joerg_wunsch b177acae71 bug #33114: Segfault after setting the DWEN fuse with Dragon
* jtagII.c (jtagmkII_getsync): Instead of exit()ing from
deep within the tree when detecting the "need debugWIRE"
situation, properly pass this up as a return code.
* jtagII_private.h (JTAGII_GETSYNC_FAIL_GRACEFUL): New constant.
* stk500v2.c (stk500v2_jtagmkII_open): Don't tell anything
anymore when receiving a JTAGII_GETSYNC_FAIL_GRACEFUL from
jtagmkII_getsync(); silently give up (all necessary has been
said already).



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@983 81a1dc3b-b13d-400b-aceb-764788c761c2
2011-08-26 10:05:09 +00:00
joerg_wunsch 5a6a357c8f bug #29636: AVRDude issues invalid CMD_CHECK_TARGET_CONNECTION
on the AVRISP-MKII
* stk500v2.c (stk500v2_program_enable): Rewrite the logic to
explain ISP activation failures.
* stk500v2_private.h: Fix the various STATUS_* constants;
AVR069 and AVR079 disagreed in their values, even though they
are apparently implementing the same logic behind.




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@972 81a1dc3b-b13d-400b-aceb-764788c761c2
2011-08-16 18:15:19 +00:00
joerg_wunsch 686d01b04d In stk500v2_command(), detect warning status codes.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@951 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-12-14 17:17:33 +00:00
springob fcce4d2de3 * serial_open() calls will now return -1 on error (no call to exit())
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@948 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-10-22 14:29:56 +00:00
joerg_wunsch d7c246d112 bug #30566: MinGW + Ubuntu 9.04
* stk500v2.c (stk500v2_open): use same condition to refer to the AVR
Doper support as used in the definition in ser_avrdoper.c.
(Thanks to Christian Starkjohann for the analysis of the problem.)



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@947 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-07-27 16:06:01 +00:00
joerg_wunsch 46715b4296 Implement TPI mode for AVRISPmkII/STK600.
Add ATtiny4/5/9/10 to avrdude.conf.in.
Document TPI and new device support.




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@916 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-01-15 16:36:13 +00:00
joerg_wunsch 1c96f227e8 Update STK600 routing and socket card data from XML
file.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@911 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-01-13 12:52:38 +00:00
joerg_wunsch 1429550f8e Cleanup the open/close handling to avoid accessing
unallocated memory (in the atexit handler) in case of bailing out.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@910 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-01-13 12:44:54 +00:00
joerg_wunsch 814ff25d79 Various fixes for Xmega devices.
* avrdude.conf.in: Correctly declare EEPROM page sizes for
all Xmega devices (0x20 instead of 0x100).
* avr.c: If a memory region has a page size declared, try
using the paged IO routines regardless of the target memory
name.  Xmega EEPROM requires to be written in paged mode.
Correctly use a long (rather than unsigned long) variable to
evaluate the success status of the paged mode write attempt.
* stk500v2.c: Don't apply TIF space offsets twice (bug #27995:
AVRDUDE 5.8svn fails to program and read XMEGA); use
stk500v2_loadaddr() prior to paged mode (EEPROM and flash) writes,
otherwise programming of flash areas will fail; while being there,
check the return value of stk500v2_loadaddr() everywhere; use the
correct write/erase mode bits (same as AVR Studio does).



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@907 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-01-12 15:42:40 +00:00
joerg_wunsch ad8b6a45da bug #28516: Linux/Dragon: Error message on exit
* stk500v2.c: Fix the "bad response to GO command:
RSP_ILLEGAL_EMULATOR_MODE" message.  jtagmkII_close()
has been called with the wrong pgm->cookie.  Wrap it
inside stk500v2_jtagmkII_close(), adjusting the cookie
data appropriately.




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@895 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-01-08 16:01:37 +00:00
joerg_wunsch 626ff0dd8b bug #27507: SIGSEGV when using avrdragon (avrdude 5.8)
* stk500v2.c (stk500v2_dragon_isp_initpgm): Use
stk500v2_jtagmkII_setup/stk500v2_jtagmkII_rather than their
jtagII counterparts, to get the private data properly
initialized.




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@887 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-01-07 15:53:50 +00:00
dhoerl 42c2863662 Cast in fprintf to remove warning on possible size mismatch
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@860 81a1dc3b-b13d-400b-aceb-764788c761c2
2009-10-10 22:10:58 +00:00
joerg_wunsch 162f815820 * jtagmkI.c (jtagmkI_send): Replace %zd format by %u since not all
implementations do understand the C99 formatting options (sigh).
* jtagmkII.c (jtagmkII_send): (Ditto.)
* stk500v2.c (stk500v2_recv): (Ditto.)



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@836 81a1dc3b-b13d-400b-aceb-764788c761c2
2009-07-10 22:39:37 +00:00
joerg_wunsch 4f753c3bd8 Fix a serious memory corruption problem resulting
out of the chaining of both, the stk500v2 and the jtagmkII
programmers for some programming hardware (JTAG ICE mkII and AVR
Dragon running in ISP, HVSP or PP mode), where both programmers
have to maintain their private programmer data.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@834 81a1dc3b-b13d-400b-aceb-764788c761c2
2009-07-06 22:10:20 +00:00
joerg_wunsch e3e7711e29 Handle writing fuse bytes (on the Xmega).
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@820 81a1dc3b-b13d-400b-aceb-764788c761c2
2009-06-24 21:18:36 +00:00
joerg_wunsch e248e5fab8 Submitted by Mikael Hermansson:
* avrdude.conf.in (ATxmega256A3): new device.
* stk500v2 (stk500v2_initialize): Enable the AVRISPmkII as a
PDI-capable device for ATxmega parts.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@809 81a1dc3b-b13d-400b-aceb-764788c761c2
2009-02-26 19:43:55 +00:00
joerg_wunsch 79f953d86d Turn all non-const static data into instance data.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@807 81a1dc3b-b13d-400b-aceb-764788c761c2
2009-02-25 09:20:38 +00:00
joerg_wunsch 4efcddea7f More fixes for Solaris, including fixes for the Sunpro compiler:
* avr.h: Remove stray semicolon.
* configure.ac: Add check for predefined types uint_t and ulong_t.
* confwin.c: Include "avrdude.h" on top to avoid empty translation
unit warning.
* ppwin.c: (Ditto.)
* ser_win32.c: (Ditto.)
* serbb_win32.c: (Ditto.)
* jtagmkII.c (jtagmkII_recv): remove unreachable "return".
* stk500.c (stk500_initialize): (Ditto.)
* par.c: Test for both, __sun__ and __sun to see whether we are
being compiled on Solaris.
* ppi.c: (Ditto.)
* stk500v2.c: Implement the DEBUG and DEBUGRECV macros in a way
that is compatible with the ISO C99 standard.
* usbtiny.c: Only typedef uint_t and ulong_t if they have not
been found already by the autoconf checks.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@804 81a1dc3b-b13d-400b-aceb-764788c761c2
2009-02-23 22:04:57 +00:00
joerg_wunsch fb4637904f bug #22882: Erase Cycle Counter does not work for stk500v2
* stk500v2.c (stk500v2_chip_erase,stk500hv_chip_erase): Return
the expected 0 for success rather than a protocol-dependant
number.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@785 81a1dc3b-b13d-400b-aceb-764788c761c2
2008-11-04 13:15:21 +00:00
joerg_wunsch b1f7fa0353 Fix a serious memory corruption that happened when using the JTAG ICE
mkII (or AVR Dragon) in ISP mode.  The wrong set of per-programmer
private data had been allocated (stk500v2 vs. jtagmkII) which was too
small to hold the actual data.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@781 81a1dc3b-b13d-400b-aceb-764788c761c2
2008-10-31 21:26:06 +00:00
joerg_wunsch e7808ca80f * stk500v2.c (stk600_xprog_paged_write): Fix a fatal miscalculation
of the number of bytes to be written which caused a malloc chunk
corruption.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@778 81a1dc3b-b13d-400b-aceb-764788c761c2
2008-07-29 08:39:15 +00:00
joerg_wunsch 15fc8af421 First implementation of ATxmega support. By now, only the
PDI mode of the STK600 is supported.  Single-byte EEPROM
(and flash) updates do not work yet.
* avr.c: "boot" memory is a candidate memory region for paged
operations, besides "flash" and "eeprom".
* avrdude.conf.in: add ATxmega128A1 and ATxmega128A1revD
* avrpart.h: add the AVRPART_HAS_PDI flag (used to distinguish
ATxmega parts from classic AVRs), the nvm_base part field, and
the offset field for a memory region.
* config_gram.y: add "has_pdi", "nvm_base", and "offset"
* lexer.l: (Ditto.)
* main.c: disable auto_erase for ATxmega parts
* stk500v2.c: implement the XPROG functionality, and divert to
this for ATxmega parts
* avrdude.1: Document the changes.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@777 81a1dc3b-b13d-400b-aceb-764788c761c2
2008-07-26 22:53:40 +00:00
joerg_wunsch 8b391a8150 Add initial support for the Atmel STK600, for
"classic" AVRs (AT90, ATtiny, ATmega) in both,
ISP and high-voltage programming modes.
* Makefile.am: Add -lm.
* avrdude.conf.in: Add stk600, stk600pp, and stk600hvsp.
* config_gram.y: Add support for the stk600* keywords.
* lexer.l: (Ditto.)
* pgm.h: Add the "chan" parameter to set_varef().
* stk500.c: (Ditto.)
* serial.h: Add USB endpoint support to struct filedescriptor.
* stk500v2.c: Implement the meat of the STK600 support.
* stk500v2.h: Add new prototypes for stk600*() programmers.
* stk500v2_private.h: Add new constants used in the STK600.
* term.c: Add AREF channel support.
* usb_libusb.c: Automatically determine the correct write
endpoint ID, the STK600 uses 0x83 while all other tools use
0x82.  Propagate the EP to use through struct filedescriptor.
* usbdevs.h: Add the STK600 USB product ID.
* tools/get-stk600-cards.xsl: XSL transformation for
targetboards.xml to obtain the list of socket and routing
card IDs, to be used in stk500v2.c (for displaying the
names).
* tools/get-stk600-devices.xsl: XSL transformation for
targetboards.xml to obtain the table of socket/routing cards
and their respective AVR device support for doc/avrdude.texi.
* avrdude.1: Document all the STK600 stuff.
* doc/avrdude.texi: Ditto.  Added a new chapter for
Programmer Specific Information.

Thanks to Eirik Rasmussen from Atmel Norway for his support in
getting this code running within that short amount of time!


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@768 81a1dc3b-b13d-400b-aceb-764788c761c2
2008-03-14 13:00:08 +00:00
joerg_wunsch a2b4d753da stk500v2_recv(): Make length computation unsigned so
it cannot accidentally become negative.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@767 81a1dc3b-b13d-400b-aceb-764788c761c2
2008-01-26 08:01:51 +00:00
joerg_wunsch 7d70684811 main.c, pgm.c, pgm.h: Add setup and teardown hooks to the programmer
definition.  If present, call the setup hook immediately after finding
the respective programmer object, and schedule the teardown hook to be
called upon exit.  This allows the programmer implementation to
dynamically allocate private programmer data.

avr910.c, butterfly.c, jtagmkI.c, jtagmkII.c, stk500v2.c, usbasp.c,
usbtiny.c: Convert static programmer data into dynamically allocated
data.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@764 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-11-07 20:36:12 +00:00
joerg_wunsch 817a1ce552 safemode.c: Obtain progname from avrdude.h rather than trying to roll our
own (duplicate) copy of it.

other files: Constify char pointers.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@725 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-30 13:41:54 +00:00
joerg_wunsch 07c1079415 Major code cleanup.
- Make all internal functions "static".
- Make sure each module's header and implementation file match.
- Remove all library-like functionality from main.c, so only
  the actual frontend remains in main.c.
- Add C++ brackets to all header files.

That effectively leaves the various module C files as something like
an "avrdude library", with main.c being the currently only frontend
program for that library.  In theory, it should be possible to write
different frontends using the same library backend functions though.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@722 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-24 22:43:46 +00:00
joerg_wunsch 1cae809b9b Something I always wanted to do: replace all those private "extern"
declarations in each file by a central header file "avrdude.h".


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@721 81a1dc3b-b13d-400b-aceb-764788c761c2
2007-01-24 21:07:54 +00:00
joerg_wunsch 26e8bc656a Submitted by Christian Starkjohann:
patch #5507: Support for AVR-Doper USB programmer in HID mode

* configure.ac: Add hooks to detect the Win32 HID library,
as well as the existence of <ddk/hidsdi.h>.
* Makefile.am: Add new files.
* my_ddk_hidsdi.h: (New file.)
* ser_avrdoper.c: (New file.)
* serial.h: Add declaration for avrdoper_serdev.
* stk500v2.c: Add hook to divert to the AVR Doper code.
* avrdude.1: Document the AVR Doper support.
* doc/avrdude.texi: (Ditto.)


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@704 81a1dc3b-b13d-400b-aceb-764788c761c2
2006-12-20 23:43:34 +00:00