mirror of
https://github.com/GOSTSec/sgminer
synced 2025-08-26 22:02:09 +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);
|
cgtime(&tv_now);
|
||||||
ms_diff = 600 - ms_tdiff(&tv_now, &info->tv_start);
|
ms_diff = 600 - ms_tdiff(&tv_now, &info->tv_start);
|
||||||
if (ms_diff > 0) {
|
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;
|
info->tot += amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -261,7 +261,7 @@ static int64_t bitfury_scanwork(struct thr_info *thr)
|
|||||||
ms_diff = BF1WAIT - ms_tdiff(&tv_now, &info->tv_start);
|
ms_diff = BF1WAIT - ms_tdiff(&tv_now, &info->tv_start);
|
||||||
if (unlikely(ms_diff < 10))
|
if (unlikely(ms_diff < 10))
|
||||||
ms_diff = 10;
|
ms_diff = 10;
|
||||||
usb_read_once_timeout(bitfury, info->buf + info->tot, BF1MSGSIZE,
|
usb_read_once_timeout_cancellable(bitfury, info->buf + info->tot, BF1MSGSIZE,
|
||||||
&amount, ms_diff, C_BF1_GETRES);
|
&amount, ms_diff, C_BF1_GETRES);
|
||||||
info->tot += amount;
|
info->tot += amount;
|
||||||
while (amount) {
|
while (amount) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user