Browse Source

cairnsmore: There's no set hashrate like Icarus, so always use short timing mode by default

Luke Dashjr 13 years ago
parent
commit
7b40d59fe2
2 changed files with 19 additions and 11 deletions
  1. 6 1
      driver-cairnsmore.c
  2. 13 10
      driver-icarus.c

+ 6 - 1
driver-cairnsmore.c

@@ -12,6 +12,8 @@
 #include "miner.h"
 #include "miner.h"
 
 
 #define CAIRNSMORE1_IO_SPEED 115200
 #define CAIRNSMORE1_IO_SPEED 115200
+
+// This is a general ballpark
 #define CAIRNSMORE1_HASH_TIME 0.0000000024484
 #define CAIRNSMORE1_HASH_TIME 0.0000000024484
 
 
 struct device_api cairnsmore_api;
 struct device_api cairnsmore_api;
@@ -27,6 +29,8 @@ static bool cairnsmore_detect_one(const char *devpath)
 	info->fpga_count = 2;
 	info->fpga_count = 2;
 	info->quirk_reopen = false;
 	info->quirk_reopen = false;
 	info->Hs = CAIRNSMORE1_HASH_TIME;
 	info->Hs = CAIRNSMORE1_HASH_TIME;
+	info->timing_mode = MODE_SHORT;
+	info->do_icarus_timing = true;
 
 
 	if (!icarus_detect_custom(devpath, &cairnsmore_api, info)) {
 	if (!icarus_detect_custom(devpath, &cairnsmore_api, info)) {
 		free(info);
 		free(info);
@@ -55,7 +59,8 @@ void convert_icarus_to_cairnsmore(struct cgpu_info *cm1)
 	struct ICARUS_INFO *info = cm1->cgpu_data;
 	struct ICARUS_INFO *info = cm1->cgpu_data;
 	info->Hs = CAIRNSMORE1_HASH_TIME;
 	info->Hs = CAIRNSMORE1_HASH_TIME;
 	info->fullnonce = info->Hs * (((double)0xffffffff) + 1);
 	info->fullnonce = info->Hs * (((double)0xffffffff) + 1);
-	info->read_count = (int)(info->fullnonce * TIME_FACTOR) - 1;
+	info->timing_mode = MODE_SHORT;
+	info->do_icarus_timing = true;
 	cm1->api = &cairnsmore_api;
 	cm1->api = &cairnsmore_api;
 	renumber_cgpu(cm1);
 	renumber_cgpu(cm1);
 }
 }

+ 13 - 10
driver-icarus.c

@@ -356,17 +356,19 @@ static void set_timing_mode(int this_option_offset, struct cgpu_info *icarus)
 		if ((eq = strchr(buf, '=')) != NULL)
 		if ((eq = strchr(buf, '=')) != NULL)
 			info->read_count = atoi(eq+1);
 			info->read_count = atoi(eq+1);
 
 
-		if (icarus->api == &icarus_api) {
-			info->do_default_detection = 0x10;
-			if (info->read_count < 1)
-				info->read_count = ICARUS_READ_COUNT_TIMING;
-		} else {
-			if (info->read_count < 1)
-				info->read_count = (int)(info->fullnonce * TIME_FACTOR) - 1;
-		}
+		int def_read_count = ICARUS_READ_COUNT_TIMING;
 
 
-		info->timing_mode = MODE_DEFAULT;
-		info->do_icarus_timing = false;
+		if (info->timing_mode == MODE_DEFAULT) {
+			if (icarus->api == &icarus_api) {
+				info->do_default_detection = 0x10;
+			} else {
+				def_read_count = (int)(info->fullnonce * TIME_FACTOR) - 1;
+			}
+
+			info->do_icarus_timing = false;
+		}
+		if (info->read_count < 1)
+			info->read_count = def_read_count;
 	}
 	}
 
 
 	info->min_data_count = MIN_DATA_COUNT;
 	info->min_data_count = MIN_DATA_COUNT;
@@ -619,6 +621,7 @@ static bool icarus_detect_one(const char *devpath)
 	info->fpga_count = 2;
 	info->fpga_count = 2;
 	info->quirk_reopen = 1;
 	info->quirk_reopen = 1;
 	info->Hs = ICARUS_REV3_HASH_TIME;
 	info->Hs = ICARUS_REV3_HASH_TIME;
+	info->timing_mode = MODE_DEFAULT;
 
 
 	if (!icarus_detect_custom(devpath, &icarus_api, info)) {
 	if (!icarus_detect_custom(devpath, &icarus_api, info)) {
 		free(info);
 		free(info);