1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 07:17:58 +00:00

making sure original Avalon is unaffected by BitBurner changes

This commit is contained in:
Chris Chua 2013-08-16 17:00:56 +00:00
parent 2b932ccb81
commit be0d899b74
2 changed files with 11 additions and 3 deletions

View File

@ -923,8 +923,12 @@ static void *avalon_get_results(void *userdata)
static void avalon_rotate_array(struct cgpu_info *avalon) static void avalon_rotate_array(struct cgpu_info *avalon)
{ {
int array_size = AVALON_ARRAY_SIZE;
if (usb_ident(avalon) == IDENT_BTB)
array_size = BITBURNER_ARRAY_SIZE;
avalon->queued = 0; avalon->queued = 0;
if (++avalon->work_array >= AVALON_ARRAY_SIZE) if (++avalon->work_array >= array_size)
avalon->work_array = 0; avalon->work_array = 0;
} }
@ -1090,10 +1094,13 @@ static bool avalon_prepare(struct thr_info *thr)
{ {
struct cgpu_info *avalon = thr->cgpu; struct cgpu_info *avalon = thr->cgpu;
struct avalon_info *info = avalon->device_data; struct avalon_info *info = avalon->device_data;
int array_size = AVALON_ARRAY_SIZE;
if (usb_ident(avalon) == IDENT_BTB)
array_size = BITBURNER_ARRAY_SIZE;
free(avalon->works); free(avalon->works);
avalon->works = calloc(info->miner_count * sizeof(struct work *), avalon->works = calloc(info->miner_count * sizeof(struct work *),
AVALON_ARRAY_SIZE); array_size);
if (!avalon->works) if (!avalon->works)
quit(1, "Failed to calloc avalon works in avalon_prepare"); quit(1, "Failed to calloc avalon works in avalon_prepare");

View File

@ -146,7 +146,8 @@ struct avalon_info {
#define AVALON_WRITE_SIZE (sizeof(struct avalon_task)) #define AVALON_WRITE_SIZE (sizeof(struct avalon_task))
#define AVALON_READ_SIZE (sizeof(struct avalon_result)) #define AVALON_READ_SIZE (sizeof(struct avalon_result))
#define AVALON_ARRAY_SIZE 4 #define AVALON_ARRAY_SIZE 3
#define BITBURNER_ARRAY_SIZE 4
#define AVA_GETS_ERROR -1 #define AVA_GETS_ERROR -1
#define AVA_GETS_OK 0 #define AVA_GETS_OK 0