mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-16 02:31:06 +00:00
* avr.c (avr_read_byte): If pgm->read_byte method fails, retry with
avr_read_byte_default. * avr.c (avr_write_byte): If pgm->write_byte method fails, retry with avr_write_byte_default. * avr910.c (avr910_cmd): Implement using universal command. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@364 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
20
avr910.c
20
avr910.c
@@ -324,13 +324,25 @@ static void avr910_enable(PROGRAMMER * pgm)
|
||||
static int avr910_cmd(PROGRAMMER * pgm, unsigned char cmd[4],
|
||||
unsigned char res[4])
|
||||
{
|
||||
int i;
|
||||
unsigned char buf[5];
|
||||
|
||||
no_show_func_info();
|
||||
|
||||
for (i=0; i<4; i++) {
|
||||
fprintf(stderr, "cmd[%d] = 0x%02x\n", i, cmd[i]);
|
||||
}
|
||||
/* FIXME: Insert version check here */
|
||||
|
||||
buf[0] = '.'; /* New Universal Command */
|
||||
buf[1] = cmd[0];
|
||||
buf[2] = cmd[1];
|
||||
buf[3] = cmd[2];
|
||||
buf[4] = cmd[3];
|
||||
|
||||
avr910_send (pgm, buf, 5);
|
||||
avr910_recv (pgm, buf, 2);
|
||||
|
||||
res[0] = 0x00; /* Dummy value */
|
||||
res[1] = cmd[0];
|
||||
res[2] = cmd[1];
|
||||
res[3] = buf[0];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user