mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-15 02:01:07 +00:00
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
This commit is contained in:
33
term.c
33
term.c
@@ -662,25 +662,42 @@ static int cmd_varef(PROGRAMMER * pgm, struct avrpart * p,
|
||||
int argc, char * argv[])
|
||||
{
|
||||
int rc;
|
||||
unsigned int chan;
|
||||
double v;
|
||||
char *endp;
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: varef <value>\n");
|
||||
if (argc != 2 && argc != 3) {
|
||||
fprintf(stderr, "Usage: varef [channel] <value>\n");
|
||||
return -1;
|
||||
}
|
||||
v = strtod(argv[1], &endp);
|
||||
if (endp == argv[1]) {
|
||||
fprintf(stderr, "%s (varef): can't parse voltage \"%s\"\n",
|
||||
progname, argv[1]);
|
||||
return -1;
|
||||
if (argc == 2) {
|
||||
chan = 0;
|
||||
v = strtod(argv[1], &endp);
|
||||
if (endp == argv[1]) {
|
||||
fprintf(stderr, "%s (varef): can't parse voltage \"%s\"\n",
|
||||
progname, argv[1]);
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
chan = strtoul(argv[1], &endp, 10);
|
||||
if (endp == argv[1]) {
|
||||
fprintf(stderr, "%s (varef): can't parse channel \"%s\"\n",
|
||||
progname, argv[1]);
|
||||
return -1;
|
||||
}
|
||||
v = strtod(argv[2], &endp);
|
||||
if (endp == argv[2]) {
|
||||
fprintf(stderr, "%s (varef): can't parse voltage \"%s\"\n",
|
||||
progname, argv[2]);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (pgm->set_varef == NULL) {
|
||||
fprintf(stderr, "%s (varef): the %s programmer cannot set V[aref]\n",
|
||||
progname, pgm->type);
|
||||
return -2;
|
||||
}
|
||||
if ((rc = pgm->set_varef(pgm, v)) != 0) {
|
||||
if ((rc = pgm->set_varef(pgm, chan, v)) != 0) {
|
||||
fprintf(stderr, "%s (varef): failed to set V[aref] (rc = %d)\n",
|
||||
progname, rc);
|
||||
return -3;
|
||||
|
||||
Reference in New Issue
Block a user