Browse Source

Perform interrupt read flush as per serial open on BF1 devices.

nfactor-troky
Con Kolivas 11 years ago
parent
commit
1f74b2cdc4
  1. 4
      driver-bitfury.c
  2. 1
      usbutils.h

4
driver-bitfury.c

@ -29,6 +29,10 @@ static void bitfury_empty_buffer(struct cgpu_info *bitfury) @@ -29,6 +29,10 @@ static void bitfury_empty_buffer(struct cgpu_info *bitfury)
static void bitfury_open(struct cgpu_info *bitfury)
{
char buf[8];
int amount;
usb_read_ii(bitfury, 0, buf, 8, &amount, C_BF1_IFLUSH);
/* Magic open sequence */
usb_transfer(bitfury, 0x21, 0x22, 0x0003, 0, C_BF1_OPEN);
bitfury_empty_buffer(bitfury);

1
usbutils.h

@ -335,6 +335,7 @@ struct cg_usb_info { @@ -335,6 +335,7 @@ struct cg_usb_info {
USB_ADD_COMMAND(C_BF1_GETWORK, "BF1GetWork") \
USB_ADD_COMMAND(C_BF1_GETRES, "BF1GetResults") \
USB_ADD_COMMAND(C_BF1_FLUSH, "BF1Flush") \
USB_ADD_COMMAND(C_BF1_IFLUSH, "BF1InterruptFlush") \
USB_ADD_COMMAND(C_BF1_IDENTIFY, "BF1Identify")
/* Create usb_cmds enum from USB_PARSE_COMMANDS macro */

Loading…
Cancel
Save