mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 10:04:33 +00:00
Check for avalon_wait_write before sending reset command.
This commit is contained in:
parent
0e071c98f6
commit
18710b14d2
@ -400,11 +400,6 @@ static void avalon_idle(struct cgpu_info *avalon, int fd)
|
||||
struct avalon_info *info = avalon->device_data;
|
||||
int i;
|
||||
|
||||
if (!avalon_wait_write(fd)) {
|
||||
applog(LOG_WARNING, "Avalon not ready for writes in avalon_idle");
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < info->miner_count; i++) {
|
||||
struct avalon_task at;
|
||||
int ret;
|
||||
@ -433,6 +428,11 @@ static int avalon_reset(struct cgpu_info *avalon, int fd)
|
||||
int ret, i = 0;
|
||||
struct timespec p;
|
||||
|
||||
if (!avalon_wait_write(fd)) {
|
||||
applog(LOG_WARNING, "Avalon not ready for writes in avalon_reset");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Reset once, then send command to go idle */
|
||||
ret = avalon_write(fd, "ad", 2);
|
||||
if (unlikely(ret == AVA_SEND_ERROR))
|
||||
|
Loading…
x
Reference in New Issue
Block a user