#define OUR_VID 0x9ac4\r
#define OUR_PID 0x4b8f\r
\r
+int offline = 0;\r
HANDLE UsbHandle;\r
\r
static void ShowError(void)\r
int main(int argc, char **argv)\r
{\r
int i = 0;\r
-\r
+ \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
+ printf(" %s offline\n", argv[0]);\r
return -1;\r
}\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
}\r
- i++;\r
- Sleep(5);\r
}\r
-\r
+ \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
}\r
} else if(strcmp(argv[1], "gui")==0) {\r
ShowGui();\r
+ } else if(strcmp(argv[1], "offline")==0) {\r
+ offline = 1;\r
+ ShowGui();\r
} else if(strcmp(argv[1], "cmd")==0) {\r
if(argc != 3) {\r
printf("Need command.\n");\r