mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Send only a single byte reset.
This commit is contained in:
parent
e2c4379290
commit
4794ce702e
@ -421,6 +421,7 @@ static void avalon_idle(struct cgpu_info *avalon, int fd)
|
|||||||
static int avalon_reset(struct cgpu_info *avalon, int fd)
|
static int avalon_reset(struct cgpu_info *avalon, int fd)
|
||||||
{
|
{
|
||||||
struct avalon_result ar;
|
struct avalon_result ar;
|
||||||
|
char reset = 0xad;
|
||||||
uint8_t *buf;
|
uint8_t *buf;
|
||||||
int ret, i = 0;
|
int ret, i = 0;
|
||||||
struct timespec p;
|
struct timespec p;
|
||||||
@ -431,7 +432,7 @@ static int avalon_reset(struct cgpu_info *avalon, int fd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Reset once, then send command to go idle */
|
/* Reset once, then send command to go idle */
|
||||||
ret = avalon_write(fd, "ad", 2);
|
ret = avalon_write(fd, &reset, 1);
|
||||||
if (unlikely(ret == AVA_SEND_ERROR))
|
if (unlikely(ret == AVA_SEND_ERROR))
|
||||||
return -1;
|
return -1;
|
||||||
/* Ignore first result as it may be corrupt with old work */
|
/* Ignore first result as it may be corrupt with old work */
|
||||||
@ -447,7 +448,7 @@ static int avalon_reset(struct cgpu_info *avalon, int fd)
|
|||||||
applog(LOG_ERR, "Avalon: Idle");
|
applog(LOG_ERR, "Avalon: Idle");
|
||||||
|
|
||||||
/* Reset again, then check result */
|
/* Reset again, then check result */
|
||||||
ret = avalon_write(fd, "ad", 2);
|
ret = avalon_write(fd, &reset, 1);
|
||||||
if (unlikely(ret == AVA_SEND_ERROR))
|
if (unlikely(ret == AVA_SEND_ERROR))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user