Don't call the programmer's 'paged_write' routine unless the memory
itself is paged as it doesn't appear to work otherwise. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@259 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
parent
21c0c54028
commit
6e9bdf2a6e
4
avr.c
4
avr.c
|
@ -687,9 +687,11 @@ int avr_write(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size,
|
|||
if (m->paged) {
|
||||
return pgm->paged_write(pgm, p, m, m->page_size, size);
|
||||
}
|
||||
#if 0
|
||||
else {
|
||||
return pgm->paged_write(pgm, p, m, pgm->page_size, size);
|
||||
return pgm->paged_write(pgm, p, m, 32 /*pgm->page_size*/, size);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
15
stk500.c
15
stk500.c
|
@ -878,6 +878,12 @@ static int stk500_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
|||
int tries;
|
||||
unsigned int n;
|
||||
|
||||
if (page_size == 0) {
|
||||
fprintf(stderr, "%s: stk500_paged_write(): invalid page size = %d\n",
|
||||
progname, page_size);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (strcmp(m->desc, "flash") == 0) {
|
||||
memtype = 'F';
|
||||
}
|
||||
|
@ -906,6 +912,15 @@ static int stk500_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
fprintf(stderr,
|
||||
"n_bytes = %d\n"
|
||||
"n = %u\n"
|
||||
"a_div = %d\n"
|
||||
"page_size = %d\n",
|
||||
n_bytes, n, a_div, page_size);
|
||||
#endif
|
||||
|
||||
for (addr = 0; addr < n; addr += page_size) {
|
||||
fprintf(stderr, "\r \r%6u", addr);
|
||||
tries = 0;
|
||||
|
|
Loading…
Reference in New Issue