mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-23 04:54:26 +00:00
Tolerate new-format temperature readings
This commit is contained in:
parent
89ce1a4480
commit
cc08d95587
12
bitforce.c
12
bitforce.c
@ -204,7 +204,7 @@ static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint6
|
|||||||
unsigned char ob[61] = ">>>>>>>>12345678901234567890123456789012123456789012>>>>>>>>";
|
unsigned char ob[61] = ">>>>>>>>12345678901234567890123456789012123456789012>>>>>>>>";
|
||||||
int i;
|
int i;
|
||||||
char *pnoncebuf;
|
char *pnoncebuf;
|
||||||
char *pblkdata;
|
char *s;
|
||||||
uint32_t nonce;
|
uint32_t nonce;
|
||||||
|
|
||||||
BFwrite(fdDev, "ZDX", 3);
|
BFwrite(fdDev, "ZDX", 3);
|
||||||
@ -222,9 +222,9 @@ static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint6
|
|||||||
memcpy(ob + 8 + 32, work->data + 64, 12);
|
memcpy(ob + 8 + 32, work->data + 64, 12);
|
||||||
BFwrite(fdDev, ob, 60);
|
BFwrite(fdDev, ob, 60);
|
||||||
if (opt_debug) {
|
if (opt_debug) {
|
||||||
pblkdata = bin2hex(ob + 8, 44);
|
s = bin2hex(ob + 8, 44);
|
||||||
applog(LOG_DEBUG, "BitForce block data: %s", pblkdata);
|
applog(LOG_DEBUG, "BitForce block data: %s", s);
|
||||||
free(pblkdata);
|
free(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
BFgets(pdevbuf, sizeof(pdevbuf), fdDev);
|
BFgets(pdevbuf, sizeof(pdevbuf), fdDev);
|
||||||
@ -243,8 +243,8 @@ static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint6
|
|||||||
applog(LOG_ERR, "Error reading from BitForce (ZKX)");
|
applog(LOG_ERR, "Error reading from BitForce (ZKX)");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (!strncasecmp(pdevbuf, "TEMP:", 5)) {
|
if ((!strncasecmp(pdevbuf, "TEMP", 4)) && (s = strchr(pdevbuf + 4, ':'))) {
|
||||||
float temp = strtof(pdevbuf + 5, NULL);
|
float temp = strtof(s + 1, NULL);
|
||||||
if (temp > 0) {
|
if (temp > 0) {
|
||||||
bitforce->temp = temp;
|
bitforce->temp = temp;
|
||||||
if (temp > bitforce->cutofftemp) {
|
if (temp > bitforce->cutofftemp) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user