1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 15:27:53 +00:00

Make the bf1 getinfo size a macro

This commit is contained in:
Con Kolivas 2013-10-08 23:26:23 +11:00
parent e05bfddc74
commit bdbe9dd5fe

View File

@ -16,6 +16,7 @@
/* Wait longer 1/3 longer than it would take for a full nonce range */ /* Wait longer 1/3 longer than it would take for a full nonce range */
#define BF1WAIT 1600 #define BF1WAIT 1600
#define BF1MSGSIZE 7 #define BF1MSGSIZE 7
#define BF1INFOSIZE 14
static void bitfury_empty_buffer(struct cgpu_info *bitfury) static void bitfury_empty_buffer(struct cgpu_info *bitfury)
{ {
@ -75,15 +76,15 @@ static bool bitfury_getinfo(struct cgpu_info *bitfury, struct bitfury_info *info
bitfury->drv->name, bitfury->device_id); bitfury->drv->name, bitfury->device_id);
return false; return false;
} }
err = usb_read(bitfury, buf, 14, &amount, C_BF1_GETINFO); err = usb_read(bitfury, buf, BF1INFOSIZE, &amount, C_BF1_GETINFO);
if (err) { if (err) {
applog(LOG_INFO, "%s %d: Failed to read GETINFO", applog(LOG_INFO, "%s %d: Failed to read GETINFO",
bitfury->drv->name, bitfury->device_id); bitfury->drv->name, bitfury->device_id);
return false; return false;
} }
if (amount != 14) { if (amount != BF1INFOSIZE) {
applog(LOG_INFO, "%s %d: Getinfo received %d bytes instead of 14", applog(LOG_INFO, "%s %d: Getinfo received %d bytes instead of %d",
bitfury->drv->name, bitfury->device_id, amount); bitfury->drv->name, bitfury->device_id, amount, BF1INFOSIZE);
return false; return false;
} }
info->version = buf[1]; info->version = buf[1];