Fix compilation clashes with Drillbit & Bitfury driver, allow both to be compiled in at once
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
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: