2003-04-07 Theodore A. Roth * avr910.c: Reading a 16 bit word in paged load needs to swap the bytes since the 'R' command returns MSB first and the internal buffer stores LSB first. Index: avr910.c =================================================================== RCS file: /cvsroot/avrdude/avrdude/avr910.c,v retrieving revision 1.6 diff -u -r1.6 avr910.c --- avr910.c 6 Apr 2003 07:10:44 -0000 1.6 +++ avr910.c 7 Apr 2003 16:40:08 -0000 @@ -572,6 +572,7 @@ int rd_size; unsigned int addr = 0; unsigned int max_addr; + unsigned char buf[2]; if (strcmp(m->desc, "flash") == 0) { cmd = 'R'; @@ -591,7 +592,16 @@ while (addr < max_addr) { avr910_send(pgm, &cmd, 1); - avr910_recv(pgm, &m->buf[addr], rd_size); + if (cmd == 'R') { + /* The 'R' command returns two bytes, MSB first, we need to put the data + into the memory buffer LSB first. */ + avr910_recv(pgm, buf, 2); + m->buf[addr*2] = buf[1]; /* LSB */ + m->buf[addr*2+1] = buf[0]; /* MSB */ + } + else { + avr910_recv(pgm, &m->buf[addr], 1); + } addr++;