forked from PAWPAW-Mirror/lib_xua
Added START_IN_DFU to host and xcore code
This commit is contained in:
@@ -351,7 +351,8 @@ int main(int argc, char **argv) {
|
|||||||
fprintf(stderr, "failed to initialise libusb\n");
|
fprintf(stderr, "failed to initialise libusb\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
//#define START_IN_DFU 1
|
||||||
|
#ifndef START_IN_DFU
|
||||||
r = find_xmos_device(0, listdev);
|
r = find_xmos_device(0, listdev);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
{
|
{
|
||||||
@@ -369,6 +370,7 @@ int main(int argc, char **argv) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
printf("XMOS DFU application started - Interface %d claimed\n", XMOS_DFU_IF);
|
printf("XMOS DFU application started - Interface %d claimed\n", XMOS_DFU_IF);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Dont go into DFU mode for save/restore */
|
/* Dont go into DFU mode for save/restore */
|
||||||
if(save)
|
if(save)
|
||||||
@@ -382,17 +384,18 @@ int main(int argc, char **argv) {
|
|||||||
else if(!listdev)
|
else if(!listdev)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#ifndef START_IN_DFU
|
||||||
printf("Detaching device from application mode.\n");
|
printf("Detaching device from application mode.\n");
|
||||||
xmos_dfu_resetintodfu(XMOS_DFU_IF);
|
xmos_dfu_resetintodfu(XMOS_DFU_IF);
|
||||||
|
|
||||||
libusb_release_interface(devh, XMOS_DFU_IF);
|
libusb_release_interface(devh, XMOS_DFU_IF);
|
||||||
libusb_close(devh);
|
libusb_close(devh);
|
||||||
|
|
||||||
|
|
||||||
printf("Waiting for device to restart and enter DFU mode...\n");
|
printf("Waiting for device to restart and enter DFU mode...\n");
|
||||||
|
|
||||||
// Wait for device to enter dfu mode and restart
|
// Wait for device to enter dfu mode and restart
|
||||||
system("sleep 20");
|
system("sleep 20");
|
||||||
|
#endif
|
||||||
|
|
||||||
// NOW IN DFU APPLICATION MODE
|
// NOW IN DFU APPLICATION MODE
|
||||||
|
|
||||||
|
|||||||
@@ -339,7 +339,11 @@ int DFUReportResetState(chanend ?c_user_cmd)
|
|||||||
unsigned flag;
|
unsigned flag;
|
||||||
flag = GetDFUFlag();
|
flag = GetDFUFlag();
|
||||||
|
|
||||||
//if (DFU_reset_override == 0x11042011)
|
//#define START_IN_DFU 1
|
||||||
|
#ifdef START_IN_DFU
|
||||||
|
flag = 0x11042011;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (flag == 0x11042011)
|
if (flag == 0x11042011)
|
||||||
{
|
{
|
||||||
unsigned int cmd_data[16];
|
unsigned int cmd_data[16];
|
||||||
|
|||||||
Reference in New Issue
Block a user