Commit 7dc3485fc2a1bdbaef21658445fef99b6be47ebb

Con Kolivas 2013-05-26T13:39:42

Check for 2 stray bytes on avalon reset.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/driver-avalon.c b/driver-avalon.c
index d1dfb16..7eb3cb8 100644
--- a/driver-avalon.c
+++ b/driver-avalon.c
@@ -318,6 +318,11 @@ static int avalon_reset(struct cgpu_info *avalon, int fd)
 	nanosleep(&p, NULL);
 
 	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 &&
 	    buf[2] == 0xAA && buf[3] == 0x55) {
 		for (i = 4; i < 11; i++)