Some more STK500 vs. AVRISP cleanup: don't announce STK500-only

parameters on AVRISPs.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@615 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
joerg_wunsch 2006-08-19 21:02:45 +00:00
parent 94e7fb19b0
commit bfb042c7bc
1 changed files with 44 additions and 36 deletions

View File

@ -335,7 +335,7 @@ retry:
progname, resp + 3);
pgmtype = PGMTYPE_STK500;
}
if (verbose >= 2)
if (verbose >= 3)
fprintf(stderr,
"%s: stk500v2_getsync(): found %s programmer\n",
progname, pgmname[pgmtype]);
@ -600,8 +600,6 @@ static int stk500hvsp_program_enable(PROGRAMMER * pgm, AVRPART * p)
static int stk500v2_initialize(PROGRAMMER * pgm, AVRPART * p)
{
pgmtype = PGMTYPE_UNKNOWN;
return pgm->program_enable(pgm, p);
}
@ -671,8 +669,6 @@ static int stk500hv_initialize(PROGRAMMER * pgm, AVRPART * p, enum hvmode mode)
}
flash_pageaddr = eeprom_pageaddr = (unsigned long)-1L;
pgmtype = PGMTYPE_UNKNOWN;
return pgm->program_enable(pgm, p);
}
@ -799,6 +795,8 @@ static int stk500v2_open(PROGRAMMER * pgm, char * port)
*/
stk500v2_drain(pgm, 0);
pgmtype = PGMTYPE_UNKNOWN;
stk500v2_getsync(pgm);
stk500v2_drain(pgm, 0);
@ -1837,12 +1835,20 @@ static int stk500v2_setparm(PROGRAMMER * pgm, unsigned char parm, unsigned char
static void stk500v2_display(PROGRAMMER * pgm, char * p)
{
unsigned char maj, min, hdw, topcard;
const char *topcard_name;
const char *topcard_name, *pgmname;
stk500v2_getparm(pgm, PARAM_HW_VER, &hdw);
stk500v2_getparm(pgm, PARAM_SW_MAJOR, &maj);
stk500v2_getparm(pgm, PARAM_SW_MINOR, &min);
switch (pgmtype) {
case PGMTYPE_UNKNOWN: pgmname = "Unknown"; break;
case PGMTYPE_STK500: pgmname = "STK500"; break;
case PGMTYPE_AVRISP: pgmname = "AVRISP"; break;
case PGMTYPE_AVRISP_MKII: pgmname = "AVRISP mkII"; break;
default: pgmname = "None";
}
fprintf(stderr, "%sProgrammer Model: %s\n", p, pgmname);
fprintf(stderr, "%sHardware Version: %d\n", p, hdw);
fprintf(stderr, "%sFirmware Version: %d.%02d\n", p, maj, min);
@ -1870,12 +1876,13 @@ static void stk500v2_print_parms1(PROGRAMMER * pgm, char * p)
unsigned char vtarget, vadjust, osc_pscale, osc_cmatch, sck_duration;
stk500v2_getparm(pgm, PARAM_VTARGET, &vtarget);
stk500v2_getparm(pgm, PARAM_SCK_DURATION, &sck_duration);
fprintf(stderr, "%sVtarget : %.1f V\n", p, vtarget / 10.0);
if (pgmtype == PGMTYPE_STK500) {
stk500v2_getparm(pgm, PARAM_VADJUST, &vadjust);
stk500v2_getparm(pgm, PARAM_OSC_PSCALE, &osc_pscale);
stk500v2_getparm(pgm, PARAM_OSC_CMATCH, &osc_cmatch);
stk500v2_getparm(pgm, PARAM_SCK_DURATION, &sck_duration);
fprintf(stderr, "%sVtarget : %.1f V\n", p, vtarget / 10.0);
fprintf(stderr, "%sVaref : %.1f V\n", p, vadjust / 10.0);
fprintf(stderr, "%sOscillator : ", p);
if (osc_pscale == 0)
@ -1905,6 +1912,7 @@ static void stk500v2_print_parms1(PROGRAMMER * pgm, char * p)
unit = "Hz";
fprintf(stderr, "%.3f %s\n", f, unit);
}
}
if (is_mk2)
fprintf(stderr, "%sSCK period : %.2f us\n", p,
(float) 1000000 / avrispmkIIfreqs[sck_duration]);