Browse Source

dualminer: Initialise opt_pll_freq along with opt_sha2_units

Nate Woolls 12 years ago
parent
commit
c16b0de6d8
2 changed files with 14 additions and 1 deletions
  1. 13 0
      driver-dualminer.c
  2. 1 1
      gc3355.c

+ 13 - 0
driver-dualminer.c

@@ -45,6 +45,9 @@
 #define DUALMINER_0_9V_SHA2_UNITS  60
 #define DUALMINER_0_9V_SHA2_UNITS  60
 #define DUALMINER_1_2V_SHA2_UNITS   0
 #define DUALMINER_1_2V_SHA2_UNITS   0
 
 
+#define DUALMINER_DM_DEFAULT_FREQUENCY  550
+#define DUALMINER_SM_DEFAULT_FREQUENCY  850
+
 static
 static
 const char sha2_golden_ob[] =
 const char sha2_golden_ob[] =
 	"55aa0f00a08701004a548fe471fa3a9a"
 	"55aa0f00a08701004a548fe471fa3a9a"
@@ -148,6 +151,16 @@ void dualminer_set_defaults(int fd)
 		else
 		else
 			opt_sha2_units = DUALMINER_0_9V_SHA2_UNITS;  // dip-switch in B position
 			opt_sha2_units = DUALMINER_0_9V_SHA2_UNITS;  // dip-switch in B position
 	}
 	}
+	
+	// set opt_pll_freq defaults depending on dip-switch
+	if (opt_pll_freq <= 0)
+	{
+		// get clear to send (CTS) status
+		if (gc3355_get_cts_status(fd) == 1)
+			opt_pll_freq = DUALMINER_SM_DEFAULT_FREQUENCY; // 1.2v - dip-switch in L position
+		else
+			opt_pll_freq = DUALMINER_DM_DEFAULT_FREQUENCY; // 0.9v - dip-switch in B position
+	}
 }
 }
 
 
 // ICARUS_INFO functions - icarus-common.h
 // ICARUS_INFO functions - icarus-common.h

+ 1 - 1
gc3355.c

@@ -29,6 +29,7 @@
 // options configurable by the end-user
 // options configurable by the end-user
 
 
 int opt_sha2_units = -1;
 int opt_sha2_units = -1;
+int opt_pll_freq = 0; // default is set in gc3355_set_pll_freq
 
 
 
 
 // SHA-2 commands
 // SHA-2 commands
@@ -226,7 +227,6 @@ const char *scrypt_only_init_cmd[] =
 	NULL
 	NULL
 };
 };
 
 
-int opt_pll_freq = 0; // default is set in gc3355_set_pll_freq
 bool opt_dual_mode = false;
 bool opt_dual_mode = false;
 
 
 void gc3355_reset_dtr(int fd)
 void gc3355_reset_dtr(int fd)