Commit 40e6dd7cc51993dada19bc9036e6f45ff255cf95

Con Kolivas 2012-04-21T22:47:46

Merge pull request #173 from luke-jr/bugfix_noauto "-S noauto" option, to inhibit FPGA autoscanning

diff --git a/README b/README
index 6344846..faa0e14 100644
--- a/README
+++ b/README
@@ -205,13 +205,14 @@ FPGA mining boards(BitForce, Icarus) only options:
 --scan-serial|-S <arg> Serial port to probe for FPGA mining device
 
      By default, cgminer will scan for autodetected FPGAs unless at least one
-     -S is specified. If you specify -S and still want cgminer to scan, you
-     must also use "-S auto". Note that presently, autodetection only works
-     on Linux, and might only detect one device depending on the version of
-     udev being used.
+     -S is specified for that driver. If you specify -S and still want cgminer
+     to scan, you must also use "-S auto". If you want to prevent cgminer from
+     scanning without specifying a device, you can use "-S noauto". Note that
+     presently, autodetection only works on Linux, and might only detect one
+     device depending on the version of udev being used.
 
      On linux <arg> is usually of the format /dev/ttyUSBn
-     On windows <arg> is usually of the format COMn
+     On windows <arg> is usually of the format \\.\COMn
        (where n = the correct device number for the FPGA device)
 
 
diff --git a/driver-bitforce.c b/driver-bitforce.c
index f93eb87..d7f7d8b 100644
--- a/driver-bitforce.c
+++ b/driver-bitforce.c
@@ -216,6 +216,9 @@ static void bitforce_detect()
 			s += 9;
 		if (!strcmp(s, "auto"))
 			autoscan = true;
+		else
+		if (!strcmp(s, "noauto"))
+			found = true;
 		else if (bitforce_detect_one(s)) {
 			string_elist_del(iter);
 			found = true;
diff --git a/driver-icarus.c b/driver-icarus.c
index 334dc11..87c5fbc 100644
--- a/driver-icarus.c
+++ b/driver-icarus.c
@@ -246,6 +246,8 @@ static void icarus_detect()
 		s = iter->string;
 		if (!strncmp("icarus:", iter->string, 7))
 			s += 7;
+		if (!strcmp(s, "auto") || !strcmp(s, "noauto"))
+			continue;
 		if (icarus_detect_one(s))
 			string_elist_del(iter);
 	}