Commit 5c4112287de18c3a3029a1a6a55aee348f63ff5d

Angus Gratton 2013-12-09T15:25:57

Fix compilation clashes with Drillbit & Bitfury driver, allow both to be compiled in at once

diff --git a/driver-drillbit.c b/driver-drillbit.c
index 297b258..69d1635 100644
--- a/driver-drillbit.c
+++ b/driver-drillbit.c
@@ -580,15 +580,15 @@ static uint32_t decnonce(uint32_t in)
 	return out;
 }
 
-#define BT_OFFSETS 3
-const uint32_t bf_offsets[] = {-0x800000, 0, -0x400000};
+#define BF_OFFSETS 3
+static const uint32_t bf_offsets[] = {-0x800000, 0, -0x400000};
 
 static bool drillbit_checkresults(struct thr_info *thr, struct work *work, uint32_t nonce)
 {
 	int i;
 
         nonce = decnonce(nonce);
-	for (i = 0; i < BT_OFFSETS; i++) {
+	for (i = 0; i < BF_OFFSETS; i++) {
 		if (test_nonce(work, nonce + bf_offsets[i])) {
 			submit_tested_work(thr, work);
 			return true;
diff --git a/usbutils.c b/usbutils.c
index 86db57d..6aa3551 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -134,9 +134,9 @@ static struct usb_epinfo bfu1_epinfos[] = {
 };
 
 /* Default to interface 1 */
-static struct usb_intinfo bf1_ints[] = {
-	USB_EPS(1,  bf1_bulk_epinfos),
-	USB_EPS(0,  bf1_int_epinfos)
+static struct usb_intinfo bfu_ints[] = {
+	USB_EPS(1,  bfu1_epinfos),
+	USB_EPS(0,  bfu0_epinfos)
 };
 #endif
 
@@ -350,9 +350,9 @@ static struct usb_find_devices find_dev[] = {
 		.config = 1,
 		.timeout = BITFURY_TIMEOUT_MS,
 		.latency = LATENCY_UNUSED,
-		.iManufacturer = "BPMC",
+		//.iManufacturer = "BPMC",
 		.iProduct = "Bitfury BF1",
-		INTINFO(bf1_ints)
+		INTINFO(bfu_ints)
 	},
 #endif
 #ifdef USE_DRILLBIT
@@ -3113,7 +3113,7 @@ void usb_cleanup(void)
 			case DRIVER_bflsc:
 			case DRIVER_bitforce:
 			case DRIVER_bitfury:
-                        case DRIVER_drillbit:
+			case DRIVER_drillbit:
 			case DRIVER_modminer:
 			case DRIVER_icarus:
 			case DRIVER_avalon: