1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 15:27:53 +00:00

Add complete close sequence to bf1 as it happens on serial.

This commit is contained in:
Con Kolivas 2013-09-25 00:23:50 +10:00
parent 4fb802fc58
commit f6e475d4fb

View File

@ -14,18 +14,6 @@
struct device_drv bitfury_drv; struct device_drv bitfury_drv;
static void bitfury_open(struct cgpu_info *bitfury)
{
/* Magic open sequence */
usb_transfer(bitfury, 0x21, 0x22, 0x0003, 0, C_BFO_OPEN);
}
static void bitfury_close(struct cgpu_info *bitfury)
{
/* Magic close sequence */
usb_transfer(bitfury, 0x21, 0x22, 0, 0, C_BFO_CLOSE);
}
static void bitfury_empty_buffer(struct cgpu_info *bitfury) static void bitfury_empty_buffer(struct cgpu_info *bitfury)
{ {
char buf[512]; char buf[512];
@ -36,6 +24,22 @@ static void bitfury_empty_buffer(struct cgpu_info *bitfury)
} while (amount); } while (amount);
} }
static void bitfury_open(struct cgpu_info *bitfury)
{
/* Magic open sequence */
usb_transfer(bitfury, 0x21, 0x22, 0x0003, 0, C_BFO_OPEN);
bitfury_empty_buffer(bitfury);
}
static void bitfury_close(struct cgpu_info *bitfury)
{
/* Magic close sequence */
usb_transfer(bitfury, 0x21, 0x22, 0, 0, C_BFO_CLOSE);
bitfury_empty_buffer(bitfury);
usb_transfer(bitfury, 0x23, 0x08, 0x9053, 1, C_BFO_CLOSE);
bitfury_empty_buffer(bitfury);
}
static void bitfury_identify(struct cgpu_info *bitfury) static void bitfury_identify(struct cgpu_info *bitfury)
{ {
int amount; int amount;
@ -64,7 +68,6 @@ static bool bitfury_detect_one(struct libusb_device *dev, struct usb_find_device
quit(1, "Failed to calloc info in bitfury_detect_one"); quit(1, "Failed to calloc info in bitfury_detect_one");
bitfury->device_data = info; bitfury->device_data = info;
bitfury_empty_buffer(bitfury);
usb_buffer_enable(bitfury); usb_buffer_enable(bitfury);
bitfury_open(bitfury); bitfury_open(bitfury);