Add ability to enter ANU frequency as a multiple of 25 from 150-500.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
diff --git a/cgminer.c b/cgminer.c
index fd700b6..c843e7b 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -161,6 +161,7 @@ static bool no_work;
#ifdef USE_ICARUS
char *opt_icarus_options = NULL;
char *opt_icarus_timing = NULL;
+int opt_anu_freq = 200;
#endif
bool opt_worktime;
#ifdef USE_AVALON
@@ -1035,6 +1036,20 @@ static char *set_icarus_timing(const char *arg)
return NULL;
}
+
+static char *set_int_150_to_500(const char *arg, int *i)
+{
+ char *err = set_int_range(arg, i, 150, 500);
+ int mult;
+
+ if (err)
+ return err;
+ mult = *i / 25;
+ mult *= 25;
+ if (mult != *i)
+ return "Frequency must be a multiple of 25";
+ return NULL;
+}
#endif
#ifdef USE_AVALON
@@ -1096,6 +1111,11 @@ static char *set_null(const char __maybe_unused *arg)
/* These options are available from config file or commandline */
static struct opt_table opt_config_table[] = {
+#ifdef USE_ICARUS
+ OPT_WITH_ARG("--anu-freq",
+ set_int_150_to_500, &opt_show_intval, &opt_anu_freq,
+ "Set AntminerU1 frequency in hex, range 150-500"),
+#endif
OPT_WITH_ARG("--api-allow",
set_api_allow, NULL, NULL,
"Allow API access only to the given list of [G:]IP[/Prefix] addresses[/subnets]"),
diff --git a/miner.h b/miner.h
index 8d1d733..9d89f9a 100644
--- a/miner.h
+++ b/miner.h
@@ -951,8 +951,11 @@ extern bool opt_api_network;
extern bool opt_delaynet;
extern time_t last_getwork;
extern bool opt_restart;
+#ifdef USE_ICARUS
extern char *opt_icarus_options;
extern char *opt_icarus_timing;
+extern int opt_anu_freq;
+#endif
extern bool opt_worktime;
#ifdef USE_AVALON
extern char *opt_avalon_options;