Skip to content

Commit

Permalink
Fix api display
Browse files Browse the repository at this point in the history
* Fix ver
* Fix dna
* Fix TC, TF
  • Loading branch information
qinfengling committed Jul 20, 2015
1 parent 6332e3d commit 1883a1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions driver-avalon-miner.c
Expand Up @@ -122,6 +122,9 @@ static float convert_temp(uint32_t adc)
{
float ret, resistance;

if (adc >= 1023)
return -273.15;

resistance = (1023.0 / adc) - 1;
resistance = R_REF / resistance;
ret = resistance / R0;
Expand Down Expand Up @@ -402,6 +405,7 @@ static struct cgpu_info *avalonm_detect_one(struct libusb_device *dev, struct us
info->thr = NULL;
memcpy(info->dna, ar.data, AVAM_MM_DNA_LEN);
memcpy(info->ver, ar.data + AVAM_MM_DNA_LEN, AVAM_MM_VER_LEN);
info->ver[AVAM_MM_VER_LEN] = '\0';
memcpy(&info->asic_cnts, ar.data + AVAM_MM_DNA_LEN + AVAM_MM_VER_LEN, 4);
info->asic_cnts = be32toh(info->asic_cnts);
if (opt_avalonm_ntime_offset >= info->asic_cnts)
Expand Down
4 changes: 2 additions & 2 deletions driver-avalon-miner.h
Expand Up @@ -91,8 +91,8 @@ struct avalonm_info {
uint32_t delay_ms;
int power_on;

char dna[AVAM_MM_DNA_LEN];
char ver[AVAM_MM_VER_LEN];
unsigned char dna[AVAM_MM_DNA_LEN];
unsigned char ver[AVAM_MM_VER_LEN + 1];
uint32_t asic_cnts;
uint32_t set_frequency[AVAM_DEFAULT_ASIC_COUNT][3];
uint32_t opt_freq[AVAM_DEFAULT_ASIC_COUNT][3];
Expand Down

0 comments on commit 1883a1a

Please sign in to comment.