* avr910.c (avr910_paged_write_flash): Add code to send the 'm'

command ("issue page write" cmd) for each page.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@329 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Theodore A. Roth 2003-05-14 05:14:32 +00:00
parent 229481f5ac
commit 1fa0b23de1
2 changed files with 32 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2003-05-13 Theodore A. Roth <troth@openavr.org>
* avr910.c (avr910_paged_write_flash): Add code to send the 'm'
command ("issue page write" cmd) for each page.
2003-05-13 Theodore A. Roth <troth@openavr.org>
* avrdude.conf.in: Add pagel and bs2 entries for at90s1200 device.

View File

@ -501,22 +501,49 @@ static int avr910_paged_write_flash(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
unsigned char buf[2];
unsigned int addr = 0;
unsigned int max_addr = n_bytes;
unsigned int page_addr;
int page_bytes = page_size;
int page_wr_cmd_pending;
avr910_write_setup(pgm, p, m);
page_addr = addr;
avr910_set_addr(pgm, addr>>1);
while (addr < max_addr) {
page_wr_cmd_pending = 1;
buf[0] = cmd[addr & 0x01];
buf[1] = m->buf[addr];
avr910_send(pgm, buf, sizeof(buf));
avr910_vfy_cmd_sent(pgm, "write byte");
addr++;
page_bytes--;
if ((has_auto_incr_addr != 'Y') && ((addr & 0x01) == 0)) {
avr910_set_addr(pgm, addr>>1);
}
else if (m->paged && (page_bytes == 0)) {
/* Send the "Issue Page Write" if we have sent a whole page. */
avr910_set_addr(pgm, page_addr>>1);
avr910_send(pgm, "m", 1);
avr910_vfy_cmd_sent(pgm, "flush page");
/* Set page address for next page. */
page_addr = addr;
page_bytes = page_size;
}
}
/* If we didn't send the page wr cmd after the last byte written in the
loop, send it now. */
if (page_wr_cmd_pending) {
avr910_set_addr(pgm, page_addr>>1);
avr910_send(pgm, "m", 1);
avr910_vfy_cmd_sent(pgm, "flush final page");
}
return addr;