Browse Source

Implement and document "-S noauto" to inhibit autoscanning without specifying a serial device

Luke Dashjr 13 years ago
parent
commit
0f74ba059e
3 changed files with 9 additions and 5 deletions
  1. 5 4
      README
  2. 3 0
      driver-bitforce.c
  3. 1 1
      driver-icarus.c

+ 5 - 4
README

@@ -205,10 +205,11 @@ FPGA mining boards(BitForce, Icarus) only options:
 --scan-serial|-S <arg> Serial port to probe for FPGA mining device
 --scan-serial|-S <arg> Serial port to probe for FPGA mining device
 
 
      By default, cgminer will scan for autodetected FPGAs unless at least one
      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 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

+ 3 - 0
driver-bitforce.c

@@ -216,6 +216,9 @@ static void bitforce_detect()
 			s += 9;
 			s += 9;
 		if (!strcmp(s, "auto"))
 		if (!strcmp(s, "auto"))
 			autoscan = true;
 			autoscan = true;
+		else
+		if (!strcmp(s, "noauto"))
+			found = true;
 		else if (bitforce_detect_one(s)) {
 		else if (bitforce_detect_one(s)) {
 			string_elist_del(iter);
 			string_elist_del(iter);
 			found = true;
 			found = true;

+ 1 - 1
driver-icarus.c

@@ -246,7 +246,7 @@ static void icarus_detect()
 		s = iter->string;
 		s = iter->string;
 		if (!strncmp("icarus:", iter->string, 7))
 		if (!strncmp("icarus:", iter->string, 7))
 			s += 7;
 			s += 7;
-		if (!strcmp(s, "auto"))
+		if (!strcmp(s, "auto") || !strcmp(s, "noauto"))
 			continue;
 			continue;
 		if (icarus_detect_one(s))
 		if (icarus_detect_one(s))
 			string_elist_del(iter);
 			string_elist_del(iter);