Added START_IN_DFU to host and xcore code

This commit is contained in:
Ross Owen
2017-05-25 10:24:38 +01:00
parent 8e861e0a5e
commit 1a729e8eb7
2 changed files with 10 additions and 3 deletions

View File

@@ -351,7 +351,8 @@ int main(int argc, char **argv) {
fprintf(stderr, "failed to initialise libusb\n");
return -1;
}
//#define START_IN_DFU 1
#ifndef START_IN_DFU
r = find_xmos_device(0, listdev);
if (r < 0)
{
@@ -369,6 +370,7 @@ int main(int argc, char **argv) {
return -1;
}
printf("XMOS DFU application started - Interface %d claimed\n", XMOS_DFU_IF);
#endif
/* Dont go into DFU mode for save/restore */
if(save)
@@ -382,17 +384,18 @@ int main(int argc, char **argv) {
else if(!listdev)
{
#ifndef START_IN_DFU
printf("Detaching device from application mode.\n");
xmos_dfu_resetintodfu(XMOS_DFU_IF);
libusb_release_interface(devh, XMOS_DFU_IF);
libusb_close(devh);
printf("Waiting for device to restart and enter DFU mode...\n");
// Wait for device to enter dfu mode and restart
system("sleep 20");
#endif
// NOW IN DFU APPLICATION MODE