memset(&ov, 0, sizeof(ov));\r
WriteFile(UsbHandle, buf, 65, &written, &ov);\r
if(GetLastError() != ERROR_IO_PENDING) {\r
memset(&ov, 0, sizeof(ov));\r
WriteFile(UsbHandle, buf, 65, &written, &ov);\r
if(GetLastError() != ERROR_IO_PENDING) {\r
if(argc < 2) {\r
printf("Usage: %s bootrom file.s19\n", argv[0]);\r
printf(" %s load osimage.s19\n", argv[0]);\r
printf(" %s fpga fpgaimg.s19\n", argv[0]);\r
printf(" %s gui\n", argv[0]);\r
if(argc < 2) {\r
printf("Usage: %s bootrom file.s19\n", argv[0]);\r
printf(" %s load osimage.s19\n", argv[0]);\r
printf(" %s fpga fpgaimg.s19\n", argv[0]);\r
printf(" %s gui\n", argv[0]);\r
-\r
- for(;;) {\r
- if(UsbConnect()) {\r
- break;\r
- }\r
- if(i == 0) {\r
- printf("...no device connected, polling for it now\n");\r
- }\r
- if(i > 50000) {\r
- printf("Could not connect to USB device; exiting.\n");\r
- return -1;\r
+ \r
+ // Only do this if NOT in offline mode\r
+ if (strcmp(argv[1], "offline"))\r
+ {\r
+ for(;;) {\r
+ if(UsbConnect()) {\r
+ break;\r
+ }\r
+ if(i == 0) {\r
+ printf("...no device connected, polling for it now\n");\r
+ }\r
+ if(i > 50000) {\r
+ printf("Could not connect to USB device; exiting.\n");\r
+ return -1;\r
+ }\r
+ i++;\r
+ Sleep(5);\r
if(strcmp(argv[1], "bootrom")==0 || strcmp(argv[1], "load")==0 || strcmp(argv[1], "fpga")==0) {\r
if(argc != 3) {\r
printf("Need filename.\n");\r
if(strcmp(argv[1], "bootrom")==0 || strcmp(argv[1], "load")==0 || strcmp(argv[1], "fpga")==0) {\r
if(argc != 3) {\r
printf("Need filename.\n");\r
} else if(strcmp(argv[1], "cmd")==0) {\r
if(argc != 3) {\r
printf("Need command.\n");\r
} else if(strcmp(argv[1], "cmd")==0) {\r
if(argc != 3) {\r
printf("Need command.\n");\r