Commit f46c2b28a0d50a026354013ead0963ce4248ef4e

Xiangfu 2012-02-13T16:09:45

add icarus to cgminer.c

diff --git a/cgminer.c b/cgminer.c
index 8264db5..3bd4eb0 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -399,7 +399,7 @@ static char *set_int_1_to_10(const char *arg, int *i)
 	return set_int_range(arg, i, 1, 10);
 }
 
-#ifdef USE_BITFORCE
+#if defined(USE_BITFORCE) || defined(USE_ICARUS)
 static char *add_serial(char *arg)
 {
 	string_elist_add(arg, &scan_devices);
@@ -661,7 +661,7 @@ static struct opt_table opt_config_table[] = {
 	OPT_WITHOUT_ARG("--disable-gpu|-G",
 			opt_set_bool, &opt_nogpu,
 			"Disable GPU mining even if suitable devices exist"),
-#if defined(WANT_CPUMINE) && (defined(HAVE_OPENCL) || defined(USE_BITFORCE))
+#if defined(WANT_CPUMINE) && (defined(HAVE_OPENCL) || defined(USE_BITFORCE) || defined(USE_ICARUS))
 	OPT_WITHOUT_ARG("--enable-cpu|-C",
 			opt_set_bool, &opt_usecpu,
 			"Enable CPU mining with other mining (default: no CPU mining if other devices exist)"),
@@ -776,10 +776,10 @@ static struct opt_table opt_config_table[] = {
 	OPT_WITHOUT_ARG("--round-robin",
 		     set_rr, &pool_strategy,
 		     "Change multipool strategy from failover to round robin on failure"),
-#ifdef USE_BITFORCE
+#if defined(USE_BITFORCE) || defined(USE_ICARUS)
 	OPT_WITH_ARG("--scan-serial|-S",
 		     add_serial, NULL, NULL,
-		     "Serial port to probe for BitForce device"),
+		     "Serial port to probe for FPGA Mining device"),
 #endif
 	OPT_WITH_ARG("--scan-time|-s",
 		     set_int_0_to_9999, opt_show_intval, &opt_scantime,
@@ -961,6 +961,9 @@ static char *opt_verusage_and_exit(const char *extra)
 #ifdef USE_BITFORCE
 		"bitforce "
 #endif
+#ifdef USE_ICARUS
+		"icarus "
+#endif
 		"mining support.\n"
 		, packagename);
 	printf("%s", opt_usage(opt_argv0, extra));
@@ -4153,6 +4156,10 @@ struct device_api cpu_api = {
 extern struct device_api bitforce_api;
 #endif
 
+#ifdef USE_ICARUS
+extern struct device_api icarus_api;
+#endif
+
 
 static int cgminer_id_count = 0;
 
@@ -4307,6 +4314,10 @@ int main (int argc, char *argv[])
 	bitforce_api.api_detect();
 #endif
 
+#ifdef USE_ICARUS
+	icarus_api.api_detect();
+#endif
+
 #ifdef WANT_CPUMINE
 	cpu_api.api_detect();
 #endif