Fix micronucleus bootloader to check for unresponsive USB devices
This commit is contained in:
parent
a4c9fcdcd7
commit
3bdf138721
|
@ -744,6 +744,19 @@ static int micronucleus_open(PROGRAMMER* pgm, char* port)
|
|||
{
|
||||
avrdude_message(MSG_INFO, "%s: ERROR: Failed to open USB device: %s\n", progname, usb_strerror());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Send a dummy request to check for a unresponsive USB device.
|
||||
int result = micronucleus_get_bootloader_info(pdata);
|
||||
if (result < 0)
|
||||
{
|
||||
avrdude_message(MSG_NOTICE, "%s: WARNING: Failed to probe device (error %d), skipping...\n",
|
||||
progname, result);
|
||||
|
||||
usb_close(pdata->usb_handle);
|
||||
pdata->usb_handle = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue