Commit Graph

34 Commits

Author SHA1 Message Date
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 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
Joerg Wunsch a8d23ba1e8 Fix build for GNU/kFreeBSD, fix FreeBSD
default serial port name.



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@925 81a1dc3b-b13d-400b-aceb-764788c761c2
2010-01-17 16:58:06 +00:00
Joerg Wunsch 8b35dc3620 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 5bf9e2d9f2 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 27e16e8371 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 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 dbe35b16f8 Submitted by someone who thinks he's called "Daper":
Fix bug #15013: Wrong use of PPICLAIM (kernel: ppdev0: claim the
port first)

* par.c: don't claim/release here (thus win_ppdev.h not needed
anymore)
* ppi.c: claim/release here.
* freebsd_ppi.h: ppi_claim/ppi_release now take an fd as parameter.
* solaris_ecpp.h: (Ditto.)
* linux_ppdev.h: (Ditto.)  (Also add copyright.)
* win_ppdev.h: Not needed anymore, remove.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@557 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-11-29 20:20:22 +00:00
Joerg Wunsch be5649c3fb Add a forgotten newline at EOF.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@553 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-11-27 21:20:48 +00:00
Colin O Flynn cdf291c5ef Fixed bug 15051, building for Windows breaks.
*par.c: ppi_claim and ppi_release definitions now in a Windows header file
*ppi.c: Only included if you are building for Windows
*win_ppdev.h: Initial Commit, see par.c

CV: ----------------------------------------------------------------------


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@549 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-11-25 14:46:43 +00:00
Joerg Wunsch b475eae63d Add ecpp(7D) (parallel port) for Solaris.
* configure.ac: add Solaris' default parallel port.
* linux_ppdev.h: change parallel port access to the new style.
* freebsd_ppi.h: New file, abstract FreeBSD's ppi(4).
* solaris_ecpp.h: New file, abstract Solaris' ecpp(7D).
* par.c: change header inclusion sequence.
* pgm.h: remove obsolete ppi_claim() and ppi_release() dummies.
* ppi.c: change header inclusion sequence, use new parport
abstraction, drop obsolete dummy implementation.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@542 81a1dc3b-b13d-400b-aceb-764788c761c2
2005-11-03 22:37:37 +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
Brian S. Dean c19e2f3cb7 Stub-out the ppi_* functions in ppi.c with empty wrappers that simply
return an error code when building on MacOS X.  This commit makes
AVRDUDE compile and run fine on my PowerMac G5 running MacOS X.  In
theory it would be possible to support parallel ports on the Mac using
a PCI multi-port card and/or USB<->Parallel converters.  If/when such
support is added we can flesh out these functions as needed, but for
now, only serial port programmers are currently supported.

Note that I tested avrdude on the G5/MacOS X with an STK500 programmer
and used a Keyspan model USA-19HS USB<->RS232 adapter device which
simply shows up in /dev as a POSIX serial port.  None of the serial
port handling needed any changes.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@415 81a1dc3b-b13d-400b-aceb-764788c761c2
2004-05-19 21:02:25 +00:00
Jan-Hinnerk Reichert a26bd26c9e *ppi.c: Major speed-tuning. Since ioctl() is expensive read from shadow-registers where possible.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@384 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-11-22 03:31:27 +00:00
Theodore A. Roth 2c7934a1ca These changes add basic support for a autoconf/automake based build system.
* .cvsignore: Ignore autoconf files.
	* AUTHORS: New file.
	* ChangeLog: New file.
	* Makefile: Removed file.
	* Makefile.am: New file.
	* NEWS: New file.
	* README: New file.
	* bootstrap: New file.
	* configure.ac: New file.
	* avr.c: Include ac_cfg.h (generated by autoconf).
	* config.c: Include ac_cfg.h.
	Include config_gram.h instead of y.tab.h.
	* config.h: If HAS_YYSTYPE is not defined, define YYSTYPE.
	* config_gram.y: Include ac_cfg.h.
	* fileio.c: Include ac_cfg.h.
	* lexer.l: Include config_gram.h instead of y.tab.h.
	* lists.c: Include ac_cfg.h.
	* main.c: Include ac_cfg.h.
	* par.c: Include ac_cfg.h.
	* pgm.c: Include ac_cfg.h.
	* ppi.c: Include ac_cfg.h.
	* stk500.c: Include ac_cfg.h.
	* term.c: Include ac_cfg.h.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@192 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-14 20:34:03 +00:00
Brian S. Dean 46233d2241 Split higher level parallel port programmer code off from ppi.c into
its own file par.c, leaving low level parallel port accessor routines
in ppi.c to help with portability.  Change the programmer type to
'PAR' now instead of 'PPI' - 'PAR' represents the parallel port
programmer type.

Be more liberal with 'static' function declarations within the
programmer implimentation files - these functions should never be
called directly - always use the programmer function references.

There are still a few places in 'main.c' that directly reference the
parallel programmer explicitly (par_getpinmask).  These should be
fixed somehow.

Axe a few unused functions.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@190 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-13 19:27:50 +00:00
Theodore A. Roth be8e278739 * linux_ppdev.h: New file.
* ppi.c: Include system dependant parallel port interface file.
(ppi_open): Add call to ppi_claim().
(ppi_close): Add call to ppi_release().
* ppi.h: Define ppi_claim() and ppi_release() as NOPs if not previously
    defined.
* stk500.c: Include inttypes header to quell compiler warning.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@184 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-11 23:50:31 +00:00
Joerg Wunsch 15431a8210 Fix some implicit declaration warnings.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@183 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-11 21:58:07 +00:00
Brian S. Dean ee8bf2d5fc Makefile: include a target to automatically generate the dependency
list.

All others


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@177 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-08 04:17:25 +00:00
Brian S. Dean 08e8c6e8ee Re-license using the GNU GPL. Thanks to Ted Roth for the patch.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@172 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-06 19:08:33 +00:00
Brian S. Dean 1e0c4f8756 Get rid of the verbose printing of individual file CVS version ids.
This was intended to be used for identifying code in the field for
incoming bug reports, but I've never really found it all that useful.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@171 81a1dc3b-b13d-400b-aceb-764788c761c2
2003-02-06 05:45:06 +00:00
Brian S. Dean dcca02ebbf Add basic support for STK500.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@160 81a1dc3b-b13d-400b-aceb-764788c761c2
2002-12-01 04:30:01 +00:00
Brian S. Dean a193330803 Seperate programmer operations out into a driver-like interface so
that programmers other than the direct parallel port connection can be
supported.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@159 81a1dc3b-b13d-400b-aceb-764788c761c2
2002-11-30 14:09:12 +00:00
Brian S. Dean fbbd6ce36e Update version number. Update copyright.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@118 81a1dc3b-b13d-400b-aceb-764788c761c2
2002-01-12 01:51:35 +00:00
Brian S. Dean f1af5d3981 Add support for ATMega163.
Add support for reading/writing ATMega163 lock and fuse bits.
Unfortunately, in looking at the specs for other ATMega parts, they
use entirely different instruction formats for these commands.  Thus,
these routines won't work for the ATMega103, for example.

Add support for sending raw command bytes via the interactive terminal
interface.  This allows one to execute any programming instruction on
the target device, whether or not avrprog supports it explicitly or
not.  Thus, one can use this feature to program fuse / lock bits, or
access any other feature of a current or future device that avrprog
does not know how to do.

Add in comments, an experimental instruction format in the
configuration file.  If this works out, it would allow supporting new
parts and non-orthoganal instructions across existing parts without
making avrprog code changes.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@99 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-11-19 17:44:24 +00:00
Brian S. Dean cad52aae90 Get ppi.h from /usr/include, not /sys.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@96 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-11-05 01:41:08 +00:00
Brian S. Dean f73b0f9eba Style fixes.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@77 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-10-13 03:13:13 +00:00
Brian S. Dean 88b4c8c41f Remove debugging code - it served its purpose.
Update copyrights.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@72 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-10-01 14:04:46 +00:00
Brian S. Dean 26223415e6 Add a -V option to display the version information about each
component module.  This is intended for support purposes, so that I
can tell unambiguously what version a binary out in the field is.

Additionally, display a revision timestamp along with the version
number.  This also is intended for aiding in support and is the Unix
time of the latest component module.  Having this, should allow me to
do a "cvs co -D timestamp avrprog" and get exactly the source of the
version that is being reported.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@55 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-01-26 20:34:08 +00:00
Brian S. Dean eff6750e5c Move pin definitions to their own file.
First pass at providing feedback via the optionally connected leds.  I
don't actually have any of these attached to my programmer, so I can
only guess as whether this is toggling them on and off correctly.

Also, enable and disable the optional 74367 buffer.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@50 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-01-24 19:10:34 +00:00
Brian S. Dean fc56e6b4f9 Rearrange the pinout for the programmer to be a little more logical.
Provide hooks to support a buffered programmer, pin 6 is now used to
enable a buffer that can be used to isolate the target system from the
parallel port pins.  This is important when programming the target
in-system.

Totally change the way the pin definitions are defined.  Actually
set/clear pins based on the way more intuitive pin number, instead of
PPI data register, bit number combination.  A table of pin data is
used so that any hardware inversion done by the parallel port is
accounted for, what you set is actually what appears at the pin.
Retain the old method for handling Vcc, however, because the hold
method is much easier to use when setting / retrieving multiple pins
simultaneously.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@49 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-01-24 18:45:58 +00:00
Brian S. Dean 4265bfa150 The program was getting too large for a single file. Split it up into
more modular pieces.

Also, accept command abbreviations as long as they are not ambiguous.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@38 81a1dc3b-b13d-400b-aceb-764788c761c2
2001-01-19 02:46:50 +00:00