mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-27 15:04:17 +00:00
Use cancellable transfers on bitfury device.
This commit is contained in:
parent
d2feacdfb2
commit
eb5b611483
@ -248,7 +248,7 @@ static int64_t bitfury_scanwork(struct thr_info *thr)
|
||||
cgtime(&tv_now);
|
||||
ms_diff = 600 - ms_tdiff(&tv_now, &info->tv_start);
|
||||
if (ms_diff > 0) {
|
||||
usb_read_timeout(bitfury, info->buf, 512, &amount, ms_diff, C_BF1_GETRES);
|
||||
usb_read_timeout_cancellable(bitfury, info->buf, 512, &amount, ms_diff, C_BF1_GETRES);
|
||||
info->tot += amount;
|
||||
}
|
||||
|
||||
@ -261,8 +261,8 @@ static int64_t bitfury_scanwork(struct thr_info *thr)
|
||||
ms_diff = BF1WAIT - ms_tdiff(&tv_now, &info->tv_start);
|
||||
if (unlikely(ms_diff < 10))
|
||||
ms_diff = 10;
|
||||
usb_read_once_timeout(bitfury, info->buf + info->tot, BF1MSGSIZE,
|
||||
&amount, ms_diff, C_BF1_GETRES);
|
||||
usb_read_once_timeout_cancellable(bitfury, info->buf + info->tot, BF1MSGSIZE,
|
||||
&amount, ms_diff, C_BF1_GETRES);
|
||||
info->tot += amount;
|
||||
while (amount) {
|
||||
usb_read_once_timeout(bitfury, info->buf + info->tot, 512, &amount, 10, C_BF1_GETRES);
|
||||
|
Loading…
x
Reference in New Issue
Block a user