1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-22 20:44:19 +00:00

Create an avalon_wait_write function that is used before sending avalon idle command.

This commit is contained in:
Con Kolivas 2013-05-25 14:42:38 +10:00
parent 764f7cc403
commit a640164381

View File

@ -378,11 +378,24 @@ static void avalon_clear_readbuf(int fd)
} 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)
{
struct avalon_info *info = avalon->device_data;
int i;
avalon_wait_write(fd);
for (i = 0; i < info->miner_count; i++) {
struct avalon_task at;
int ret;