mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 10:04:33 +00:00
Create an avalon_wait_write function that is used before sending avalon idle command.
This commit is contained in:
parent
764f7cc403
commit
a640164381
@ -378,11 +378,24 @@ static void avalon_clear_readbuf(int fd)
|
|||||||
} while (ret > 0);
|
} while (ret > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Wait until the avalon says it's ready to receive a write, or 2 seconds has
|
||||||
|
* elapsed, whichever comes first. The status is updated by the ftdi device
|
||||||
|
* every 40ms. */
|
||||||
|
static void avalon_wait_write(int fd)
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
|
while (avalon_buffer_full(fd) && i++ < 40)
|
||||||
|
nmsleep(50);
|
||||||
|
}
|
||||||
|
|
||||||
static void avalon_idle(struct cgpu_info *avalon, int fd)
|
static void avalon_idle(struct cgpu_info *avalon, int fd)
|
||||||
{
|
{
|
||||||
struct avalon_info *info = avalon->device_data;
|
struct avalon_info *info = avalon->device_data;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
avalon_wait_write(fd);
|
||||||
|
|
||||||
for (i = 0; i < info->miner_count; i++) {
|
for (i = 0; i < info->miner_count; i++) {
|
||||||
struct avalon_task at;
|
struct avalon_task at;
|
||||||
int ret;
|
int ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user