Browse Source

Merge pull request #344 from wizkid057/bfgminer

Make hashbuster serial number output match formatting on physical board
Luke-Jr 12 years ago
parent
commit
71bb64b777
1 changed files with 4 additions and 4 deletions
  1. 4 4
      driver-hashbuster2.c

+ 4 - 4
driver-hashbuster2.c

@@ -185,12 +185,12 @@ bool hashbuster2_lowl_probe(const struct lowlevel_device_info * const info)
 	hashbuster2_io(ep, INPacket, OUTPacket);
 	hashbuster2_io(ep, INPacket, OUTPacket);
 	if (!memcmp(INPacket, "\x20\0", 2))
 	if (!memcmp(INPacket, "\x20\0", 2))
 	{
 	{
-		// 64-bit LE serial number
+		// 64-bit BE serial number
 		uint64_t sernum = 0;
 		uint64_t sernum = 0;
-		for (j = 2; j < 10; ++j)
-			sernum = (sernum << 8) | INPacket[j];
+		for (j = 0; j < 8; ++j)
+			sernum |= (uint64_t)INPacket[j + 2] << (j * 8);
 		serial = malloc((8 * 2) + 1);
 		serial = malloc((8 * 2) + 1);
-		sprintf(serial, "%08"PRIx64, sernum);
+		sprintf(serial, "%08"PRIX64, sernum);
 	}
 	}
 	else
 	else
 		serial = maybe_strdup(info->serial);
 		serial = maybe_strdup(info->serial);