1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-23 04:54:26 +00:00

Check for 2 stray bytes on avalon reset.

This commit is contained in:
Con Kolivas 2013-05-26 13:39:42 +10:00
parent 629feb5f3f
commit 7dc3485fc2

View File

@ -318,6 +318,11 @@ static int avalon_reset(struct cgpu_info *avalon, int fd)
nanosleep(&p, NULL); nanosleep(&p, NULL);
buf = (uint8_t *)&ar; buf = (uint8_t *)&ar;
/* We may also get 0x00 and 0x18 first */
if (buf[0] != 0xAA)
buf = &buf[1];
if (buf[0] != 0xAA)
buf = &buf[1];
if (buf[0] == 0xAA && buf[1] == 0x55 && if (buf[0] == 0xAA && buf[1] == 0x55 &&
buf[2] == 0xAA && buf[3] == 0x55) { buf[2] == 0xAA && buf[3] == 0x55) {
for (i = 4; i < 11; i++) for (i = 4; i < 11; i++)