1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 07:17:58 +00:00

Check for work restart, breaking out early after usb reads in BF1.

This commit is contained in:
Con Kolivas 2013-09-25 23:54:37 +10:00
parent ff4c4779f7
commit f97e1ad25f

View File

@ -181,6 +181,8 @@ static int64_t bitfury_scanhash(struct thr_info *thr, struct work *work,
* look for the results to prev work. */
usb_read_timeout(bitfury, info->buf, 512, &amount, 600, C_BFO_GETRES);
info->tot += amount;
if (unlikely(thr->work_restart))
goto cascade;
/* Now look for the bulk of the previous work results, they will come
* in a batch following the first data. */
@ -191,6 +193,9 @@ static int64_t bitfury_scanhash(struct thr_info *thr, struct work *work,
info->tot += amount;
};
if (unlikely(thr->work_restart))
goto cascade;
/* Send work */
usb_write(bitfury, buf, 45, &amount, C_BFO_REQWORK);
/* Get response acknowledging work */