Commit d5d18b426aa864164237c415b84e4d91d3d544ae

Con Kolivas 2014-07-20T14:16:31

Add hashratio frequency command line

diff --git a/cgminer.c b/cgminer.c
index 4b5653a..3739118 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -226,6 +226,9 @@ static char *opt_set_avalon2_freq;
 static char *opt_set_avalon2_fan;
 static char *opt_set_avalon2_voltage;
 #endif
+#ifdef USE_HASHRATIO
+#include "driver-hashratio.h"
+#endif
 #ifdef USE_KLONDIKE
 char *opt_klondike_options = NULL;
 #endif
@@ -1323,6 +1326,11 @@ static struct opt_table opt_config_table[] = {
 		     set_int_0_to_200, opt_show_intval, &opt_hfa_target,
 		     "Set the hashfast target temperature (0 to disable)"),
 #endif
+#ifdef USE_HASHRATIO
+	OPT_WITH_CBARG("--hro-freq",
+		       set_hashratio_freq, opt_show_intval, &opt_hashratio_freq,
+		       "Set the hashratio clock frequency"),
+#endif
 	OPT_WITH_ARG("--hotplug",
 		     set_int_0_to_9999, NULL, &hotplug_time,
 #ifdef USE_USBUTILS
diff --git a/driver-hashratio.h b/driver-hashratio.h
index fad1df4..21e37bf 100644
--- a/driver-hashratio.h
+++ b/driver-hashratio.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013 Con Kolivas <kernel@kolivas.org>
+ * Copyright 2013-2014 Con Kolivas <kernel@kolivas.org>
  * Copyright 2012-2014 Xiangfu <xiangfu@openmobilefree.com>
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -15,6 +15,7 @@
 #include "util.h"
 
 #ifdef USE_HASHRATIO
+int opt_hashratio_freq;
 
 #define HRTO_MINER_THREADS	1
 
@@ -94,8 +95,6 @@ struct hashratio_info {
 	int temp_sum;
 	int temp_old;
 
-	int first;
-
 	struct timeval last_stratum;
 	struct pool pool;
 	int pool_no;