Fix -Y option. Reported by Joerg Wunsch.

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@153 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Brian S. Dean
2002-11-06 02:19:57 +00:00
parent 52f96a781a
commit f2604f3523
3 changed files with 14 additions and 11 deletions

12
main.c
View File

@@ -115,7 +115,7 @@ char ** modules[N_MODULES] = {
&term_version
};
char * version = "2.1.3";
char * version = "2.1.4";
char * main_version = "$Id$";
@@ -909,8 +909,8 @@ int main(int argc, char * argv [])
}
if (set_cycles != -1) {
cycles = avr_get_cycle_count(fd, p);
if (cycles != -1) {
rc = avr_get_cycle_count(fd, p, &cycles);
if (rc == 0) {
/*
* only attempt to update the cycle counter if we can actually
* read the old value
@@ -943,11 +943,11 @@ int main(int argc, char * argv [])
* repeat it if an erase was done. Also, don't display this if we
* set the cycle count (due to -Y).
*
* see if the cycle count in the last two bytes of eeprom seems
* see if the cycle count in the last four bytes of eeprom seems
* reasonable
*/
cycles = avr_get_cycle_count(fd, p);
if ((cycles != -1) && (cycles != 0x00ffff)) {
rc = avr_get_cycle_count(fd, p, &cycles);
if ((rc >= 0) && (cycles != 0xffffffff)) {
fprintf(stderr,
"%s: current erase-rewrite cycle count is %d%s\n",
progname, cycles,