Commit 3cb878d347a8d9d7e5bf95a5bc136c6f00ef6b17

Con Kolivas 2014-01-09T14:36:55

Export bitfury_checkresults in libbitfury

diff --git a/driver-bitfury.c b/driver-bitfury.c
index 8809e85..7305f70 100644
--- a/driver-bitfury.c
+++ b/driver-bitfury.c
@@ -747,24 +747,6 @@ static bool bitfury_prepare(struct thr_info *thr)
 	}
 }
 
-#define BT_OFFSETS 3
-const uint32_t bf_offsets[] = {-0x800000, 0, -0x400000};
-
-static bool bitfury_checkresults(struct thr_info *thr, struct work *work, uint32_t nonce)
-{
-	int i;
-
-	for (i = 0; i < BT_OFFSETS; i++) {
-		uint32_t noffset = nonce + bf_offsets[i];
-
-		if (test_nonce(work, noffset)) {
-			submit_tested_work(thr, work);
-			return true;
-		}
-	}
-	return false;
-}
-
 static int64_t bitfury_rate(struct bitfury_info *info)
 {
 	double nonce_rate;
diff --git a/libbitfury.c b/libbitfury.c
index 88beb45..97e784d 100644
--- a/libbitfury.c
+++ b/libbitfury.c
@@ -316,6 +316,24 @@ bool spi_txrx(struct cgpu_info *bitfury, struct bitfury_info *info)
 	return true;
 }
 
+#define BT_OFFSETS 3
+
+bool bitfury_checkresults(struct thr_info *thr, struct work *work, uint32_t nonce)
+{
+	const uint32_t bf_offsets[] = {-0x800000, 0, -0x400000};
+	int i;
+
+	for (i = 0; i < BT_OFFSETS; i++) {
+		uint32_t noffset = nonce + bf_offsets[i];
+
+		if (test_nonce(work, noffset)) {
+			submit_tested_work(thr, work);
+			return true;
+		}
+	}
+	return false;
+}
+
 bool libbitfury_sendHashData(struct thr_info *thr, struct cgpu_info *bitfury,
 			     struct bitfury_info *info)
 {
diff --git a/libbitfury.h b/libbitfury.h
index 639a29e..b2075ed 100644
--- a/libbitfury.h
+++ b/libbitfury.h
@@ -25,6 +25,7 @@ void spi_add_data(struct bitfury_info *info, uint16_t addr, const void *buf, int
 bool spi_detect_bitfury(struct cgpu_info *bitfury, struct bitfury_info *info);
 bool spi_reset(struct cgpu_info *bitfury, struct bitfury_info *info);
 bool spi_txrx(struct cgpu_info *bitfury, struct bitfury_info *info);
+bool bitfury_checkresults(struct thr_info *thr, struct work *work, uint32_t nonce);
 bool libbitfury_sendHashData(struct thr_info *thr, struct cgpu_info *bitfury,
 			     struct bitfury_info *info);