2007-05-01 Colin O'Flynn <coflynn@newae.com>

safemode.c: added verbose output


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@732 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Colin O Flynn 2007-05-02 22:36:04 +00:00
parent f4f6c8040c
commit bcf7c9d269
2 changed files with 51 additions and 0 deletions

View File

@ -1,3 +1,6 @@
2007-05-01 Colin O'Flynn <coflynn@newae.com>
* safemode.c: Added verbose output from safemode routines.
2007-03-25 Colin O'Flynn <coflynn@newae.com> 2007-03-25 Colin O'Flynn <coflynn@newae.com>
* stk500generic.c: Forgot to close the serial port before trying to * stk500generic.c: Forgot to close the serial port before trying to

View File

@ -108,15 +108,27 @@ int safemode_readfuses (unsigned char * lfuse, unsigned char * hfuse,
{ {
safemode_fuse = 1 + value; //failed - ensure they differ safemode_fuse = 1 + value; //failed - ensure they differ
} }
if (verbose > 2)
{
fprintf(stderr, "%s: safemode read 1, fuse value: %x\n",progname, safemode_fuse);
}
if(pgm->read_byte(pgm, p, m, 0, &value) != 0) if(pgm->read_byte(pgm, p, m, 0, &value) != 0)
{ {
value = 1 + safemode_fuse; //failed - ensure they differ value = 1 + safemode_fuse; //failed - ensure they differ
} }
if (verbose > 2)
{
fprintf(stderr, "%s: safemode read 2, fuse value: %x\n",progname, value);
}
if (value == safemode_fuse) { if (value == safemode_fuse) {
if (pgm->read_byte(pgm, p, m, 0, &value) != 0) if (pgm->read_byte(pgm, p, m, 0, &value) != 0)
{ {
value = 1 + safemode_fuse; value = 1 + safemode_fuse;
} }
if (verbose > 2)
{
fprintf(stderr, "%s: safemode read 3, fuse value: %x\n",progname, value);
}
if (value == safemode_fuse) if (value == safemode_fuse)
{ {
fusegood = 1; /* Fuse read OK three times */ fusegood = 1; /* Fuse read OK three times */
@ -145,15 +157,27 @@ int safemode_readfuses (unsigned char * lfuse, unsigned char * hfuse,
{ {
safemode_lfuse = 1 + value; safemode_lfuse = 1 + value;
} }
if (verbose > 2)
{
fprintf(stderr, "%s: safemode read 1, lfuse value: %x\n",progname, safemode_fuse);
}
if (pgm->read_byte(pgm, p, m, 0, &value) != 0) if (pgm->read_byte(pgm, p, m, 0, &value) != 0)
{ {
value = safemode_lfuse + 1; value = safemode_lfuse + 1;
} }
if (verbose > 2)
{
fprintf(stderr, "%s: safemode read 2, lfuse value: %x\n",progname, value);
}
if (value == safemode_lfuse) { if (value == safemode_lfuse) {
if (pgm->read_byte(pgm, p, m, 0, &value) != 0) if (pgm->read_byte(pgm, p, m, 0, &value) != 0)
{ {
value = safemode_lfuse + 1; value = safemode_lfuse + 1;
} }
if (verbose > 2)
{
fprintf(stderr, "%s: safemode read 3, lfuse value: %x\n",progname, value);
}
if (value == safemode_lfuse){ if (value == safemode_lfuse){
fusegood = 1; /* Fuse read OK three times */ fusegood = 1; /* Fuse read OK three times */
} }
@ -180,15 +204,27 @@ int safemode_readfuses (unsigned char * lfuse, unsigned char * hfuse,
{ {
safemode_hfuse = value + 1; safemode_hfuse = value + 1;
} }
if (verbose > 2)
{
fprintf(stderr, "%s: safemode read 1, hfuse value: %x\n",progname, safemode_fuse);
}
if (pgm->read_byte(pgm, p, m, 0, &value) != 0) if (pgm->read_byte(pgm, p, m, 0, &value) != 0)
{ {
value = safemode_hfuse + 1; value = safemode_hfuse + 1;
} }
if (verbose > 2)
{
fprintf(stderr, "%s: safemode read 2, hfuse value: %x\n",progname, value);
}
if (value == safemode_hfuse) { if (value == safemode_hfuse) {
if (pgm->read_byte(pgm, p, m, 0, &value) != 0) if (pgm->read_byte(pgm, p, m, 0, &value) != 0)
{ {
value = safemode_hfuse + 1; value = safemode_hfuse + 1;
} }
if (verbose > 2)
{
fprintf(stderr, "%s: safemode read 3, hfuse value: %x\n",progname, value);
}
if (value == safemode_hfuse){ if (value == safemode_hfuse){
fusegood = 1; /* Fuse read OK three times */ fusegood = 1; /* Fuse read OK three times */
} }
@ -215,15 +251,27 @@ int safemode_readfuses (unsigned char * lfuse, unsigned char * hfuse,
{ {
safemode_efuse = value + 1; safemode_efuse = value + 1;
} }
if (verbose > 2)
{
fprintf(stderr, "%s: safemode read 1, efuse value: %x\n",progname, safemode_fuse);
}
if (pgm->read_byte(pgm, p, m, 0, &value) != 0) if (pgm->read_byte(pgm, p, m, 0, &value) != 0)
{ {
value = safemode_efuse + 1; value = safemode_efuse + 1;
} }
if (verbose > 2)
{
fprintf(stderr, "%s: safemode read 2, efuse value: %x\n",progname, value);
}
if (value == safemode_efuse) { if (value == safemode_efuse) {
if (pgm->read_byte(pgm, p, m, 0, &value) != 0) if (pgm->read_byte(pgm, p, m, 0, &value) != 0)
{ {
value = safemode_efuse + 1; value = safemode_efuse + 1;
} }
if (verbose > 2)
{
fprintf(stderr, "%s: safemode read 3, efuse value: %x\n",progname, value);
}
if (value == safemode_efuse){ if (value == safemode_efuse){
fusegood = 1; /* Fuse read OK three times */ fusegood = 1; /* Fuse read OK three times */
} }