Commit Graph

35 Commits

Author SHA1 Message Date
Dawid Buchwald b6e72dce4c Implemented basic serial code refactoring for upcoming SerialUPDI implementation
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/branches/serial_refactoring@1511 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-12-18 15:25:27 +01:00
Joerg Wunsch 60f5885849 Submitted by Andrew D'Addesio:
bug #58078: [PATCH] buspirate: remove compound literals (fixes GCC>=9)
* buspirate.c (buspirate_start_mode_bin):
avoid propagating local scope compound literals



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1455 81a1dc3b-b13d-400b-aceb-764788c761c2
2021-11-06 22:34:29 +00:00
Joerg Wunsch 3f5e101f09 Fix various typos.
Submitted by Adrian Klieber
patch #9818: correct typos in SVN rev 1429



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1443 81a1dc3b-b13d-400b-aceb-764788c761c2
2020-09-16 21:31:19 +00:00
Rene Liebscher 58f509cb54 patch #8504 buspirate: Also support "cpufreq" extended parameter in binary mode
* buspirate.c: applied patch + switch off at disable (even when
a reset follows) + some general whitespace/tab cleanup

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1339 81a1dc3b-b13d-400b-aceb-764788c761c2
2014-11-13 13:53:47 +00:00
Rene Liebscher 8fd3870861 bug #42662 clang warnings under FreeBSD 10.x
* avrftdi.c: remove warnings
* buspirate.c: (Dito.)
* dfu.c: (Dito.)
* fileio.c: (Dito.)
* libavrdude.h: (Dito.)
* pickit2.c: (Dito.)
* safemode.c: (Dito.)
* ser_avrdoper.c: (Dito.)
* ser_posix.c: (Dito.)
* ser_win32.c: (Dito.)
* stk500v2.c: (Dito.)
* usb_libusb.c: (Dito.)
* usbasp.c: (Dito.)

* config_gram.y: fix problem when using parent part with usbpid lists
                 (existing list was extended not overwritten)



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1328 81a1dc3b-b13d-400b-aceb-764788c761c2
2014-07-16 20:02:01 +00:00
Axel Wachtler c6788bd795 added verbose level in avrdude_message()
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1321 81a1dc3b-b13d-400b-aceb-764788c761c2
2014-06-13 20:07:40 +00:00
Joerg Wunsch d09bc2e1fb Join the former "public" header files (avr.h avrpart.h pindefs.h
serial.h fileio.h safemode.h update.h pgm_type.h config.h confwin.h
lists.h) into a single header that can be included by anyone wanting
to link against the library.

Adapt everything to cope with this situation.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1311 81a1dc3b-b13d-400b-aceb-764788c761c2
2014-05-19 10:01:59 +00:00
Axel Wachtler eb5fcb581f Exchange of fprintf(stderr, ...) with avrdude_message(...).
This change was made for the shared library, since library functions
should not write to std-streams directly. Instead avrdude_message()
has to be implemented by the library user. For the avrdude application
this function is implemented in main.c.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1305 81a1dc3b-b13d-400b-aceb-764788c761c2
2014-05-18 08:41:46 +00:00
Joerg Wunsch 57903bdeb8 Replace all occurences of exit() in potential library code
by appropriate return values.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1301 81a1dc3b-b13d-400b-aceb-764788c761c2
2014-05-16 15:52:25 +00:00
Joerg Wunsch f80f51f6a9 Change the second parameter of the ser_open method from "baud" into a
"union pinfo", so the USB parameters can be passed without hacks.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1276 81a1dc3b-b13d-400b-aceb-764788c761c2
2014-02-21 13:44:11 +00:00
Rene Liebscher 1c401d5d08 Rework of bitbanging functions setpin, getpin, highpulsepin to make simplier use of new pindefs data in pgm structure
* linuxgpio.c, bitbang.c, buspirate.c, par.c, pgm.h, term.c, serbb_*.c: changed 
	  interface of setpin, getpin, highpulsepin to take pin function as parameter 
	  (not the real number, which can be found by pgm->pinno[function])

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1252 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-12-04 19:02:55 +00:00
Joerg Wunsch db1cce8bf4 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
Rene Liebscher 2d8c584c8c Create new pin definition data structures to support 0-based pin numbers, and mixed inverse/non-inverse pin lists.
* avrftdi.c,buspirate.c,linuxgpio.c,par.c,serbb_*.c: added function call 
          to fill old pinno entries from new pin definitions.
	* pindefs.[hc]: added data struct and helper functions for new pin definitions
	* avrdude.conf.in: pins in entries using ftdi_syncbb are now 0-based
	* config_gram.y: allow combinations of inverted and non-inverted pins in pin lists
	* ft245r.c: reworked to work directly with the new pin definitions,
          pins are now 0-based, inverse pins are supported, buff is supported
	* pgm.[ch]: added new pin definitions field to programmer structure, 
          adapted pin display functions

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1160 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-05-03 22:35:00 +00:00
Rene Liebscher db1419c93f patch #7724 Add TPI support for Bus Pirate using bitbang mode
* buspirate.[ch]: added support for BusPirate Bitbanging
	* avrdude.conf.in: added entry for buspirate_bb
	* pgm_type.c: added entry for buspirate_bb


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1138 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-01-30 21:15:39 +00:00
Rene Liebscher 67b1492b46 patch #7936 Patch to support BusPirate AVR Extended Commands mode
* buspirate.c: added support for BusPirate AVR Extended Commands mode
	* avrdude.1: added doc for nopagedread parameter
	* doc/avrdude.texi: added doc for nopagedread parameter


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1137 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-01-30 18:56:31 +00:00
Rene Liebscher fa4ab4941f patch #7723 Bus Pirate “raw-wire” mode which can run down to 5 kHz
* buspirate.c: added raw wire mode
	* avrdude.1: added doc for rawfreq parameter
	* doc/avrdude.texi: added doc for rawfreq parameter

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1136 81a1dc3b-b13d-400b-aceb-764788c761c2
2013-01-30 17:58:48 +00:00
Joerg Wunsch 147137a218 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
Rene Liebscher 673f43f37d * lexer.l,config_gram.y,config.[hc]: changed reading of numbers to integers except of default_bitclock which is the only real number.
No signs are allowed as negative values do not make sense for current config values.
* buspirate.c: include own header file buspirate.h
* doc/.cvsignore: add programmers.texi to ignore list

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1105 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-11-04 17:18:59 +00:00
Rene Liebscher fa5e2bb849 patch #7437 modifications to Bus Pirate module
patch #7686 Updating buspirate ascii mode to current firmware, use AUX
            as clock generator, and setting of serial receive timeout
  * buspirate.c: added paged_write, changed binary mode setup/detection,
                 added clock output on AUX pin
  * avrdude.1: updated documentation
  * doc/avrdude.texi: updated documentation


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1052 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-01-31 19:01:00 +00:00
Rene Liebscher c1095de822 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
Rene Liebscher 0a84dcee24 bug #34302: Feature request : device configuration with parent classes
* config_gram.y: if memory section is overwritten old entry is removed
        
(not in original patch)
* config_gram.y: if programmer or part is defined twice, a warning is
  output and the first instance is removed
        
General cleanup and free functions, so valgrind does not report any lost
blocks at program end.
* avrpart.[hc]: added avr_free_(opcode|mem|part) functions
* pgm.[hc]: added pgm_free function
* update.[hc]: added free_update functions
* config.[hc]: added cleanup_config function, use yylex_destroy to reset
  the lexer after usage. (So it can be reused.)
* main.c: add cleanup_main function which is called by atexit() (This 
  frees all lists so that at program exit only really lost memory is 
  reported by valgrind.)
* usbasp.c: added libusb_free_device_list() and libusb_exit() calls to
  avoid lost memory
* buspirate.c: moved memory allocation from initpgm to setup and added 
  free in teardown
* configure.ac: add definition of HAVE_YYLEX_DESTROY if $LEX is flex.
* Makefile.am: added . in front of SUBDIRS to build avrdude before trying
  to use it for creating the part list for the docs.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1041 81a1dc3b-b13d-400b-aceb-764788c761c2
2012-01-17 20:56:37 +00:00
Nils Springob 0c603e4791 * 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
Michal Ludvig 60e15f2666 * buspirate.c: Added compatibility with BusPirate "NewUI" firmware 5.x
(contributed by Kari Knuuttila)



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@946 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-07-18 13:15:07 +00:00
Joerg Wunsch d427db8e3a Replace printf() by fprintf(stderr)
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@939 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-03-05 08:28:42 +00:00
Michal Ludvig 3b92d6eb15 * buspirate.c: Initialise firmware version to v0.0
prior to parsing the buspirate banner.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@906 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-01-12 09:52:40 +00:00
Michal Ludvig 1b16aa8140 * buspirate.c: If the BusPirate doesn't respond
to a standard a reset command assume it was in binmode
	and attempt to exit to text mode first.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@901 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-01-11 12:19:15 +00:00
Joerg Wunsch 31aa649153 * bitbang.c: Fix Win32 build error: move freq up to the file
level.
* buspirate.c: Fix Win32 build warning: include <malloc.h> to
to get a declaration for alloca().




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@898 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-01-08 20:02:35 +00:00
Joerg Wunsch 2110c28be5 Cosmetics: adjust for 8-column hard tabs, remove UTF-8 dashes.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@886 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-01-07 13:30:44 +00:00
Joerg Wunsch bcb6be967d Add $Id$ line.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@883 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-01-07 13:16:38 +00:00
Joerg Wunsch f7cb1f53ea Fix a few warnings that came up recently (some of them only triggered
by recent GCC versions).
* config_gram.y (parse_cmdbits): "brkt possibly used uninitialized"
(GCC errs here)
* jtagmkII.c (jtagmkII_reset32): "status possibly used uninitialized"
(I think GCC errs, too)
* buspirate.c: "pointers differ in signedness" (mismatch between
string processing and the use of "unsigned char" throughought the
AVRDUDE API)



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@882 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-01-07 13:13:02 +00:00
Michal Ludvig d64741e5a2 * buspirate.c: Implemented reset= and speed= extended parameters.
* avrdude.1: Document the change.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@879 81a1dc3b-b13d-400b-aceb-764788c761c2
2009-11-09 02:18:40 +00:00
Michal Ludvig da6d670faf * buspirate.c: Implemented 'BinMode' support for
firmware 2.7 and higher.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@876 81a1dc3b-b13d-400b-aceb-764788c761c2
2009-11-04 03:14:17 +00:00
Michal Ludvig 61ce206272 * buspirate.c: Replace GNU-only %as with %s in sscanf call.
* ser_win32.c(ser_set_dtr_rts): Fixed typo in parameter name.
	* NEWS: Announce BusPirate.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@865 81a1dc3b-b13d-400b-aceb-764788c761c2
2009-10-12 06:51:53 +00:00
Michal Ludvig b7766d1400 * buspirate.c: Optimised buspirate_cmd() - reading 1kB EEPROM now
takes only 14 sec instead of almost 2 mins with the original
  implementation.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@844 81a1dc3b-b13d-400b-aceb-764788c761c2
2009-10-08 05:00:41 +00:00
Michal Ludvig bcce066a1c Added support for the BusPirate programmer.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@842 81a1dc3b-b13d-400b-aceb-764788c761c2
2009-10-08 02:05:03 +00:00