Commit 703079578171bb6cf43d2c4dc82c8be44a75e5ff

Con Kolivas 2014-02-14T21:41:37

Allow hotplug interval to be changed from the USB menu.

diff --git a/cgminer.c b/cgminer.c
index 4d8f0b3..6491a26 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -5196,6 +5196,7 @@ retry:
 	wlogprint("[L]ist all known devices\n");
 	wlogprint("[B]lacklist current device from current instance of cgminer\n");
 	wlogprint("[W]hitelist previously blacklisted device\n");
+	wlogprint("[H]otplug interval (0 to disable)\n");
 	wlogprint("Select an option or any other key to return\n");
 	logwin_update();
 	input = getch();
@@ -5324,6 +5325,14 @@ retry:
 		}
 		whitelist_cgpu(cgpu);
 		goto retry;
+	} else if (!strncasecmp(&input, "h", 1)) {
+		selected = curses_int("Select hotplug interval in seconds (0 to disable)");
+		if (selected < 0 || selected > 9999)  {
+			wlogprint("Invalid value\n");
+			goto retry;
+		}
+		hotplug_time = selected;
+		goto retry;
 	} else if (!strncasecmp(&input, "l", 1)) {
 		usb_all(0);
 		goto retry;