1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-22 20:44:19 +00:00

if hash_count == 0; reinit avalon, fix the 0MHS bug

use the max value of temp1 and temp2 for fan control
This commit is contained in:
Xiangfu 2013-04-08 23:37:04 +08:00
parent 6c5c6e99a3
commit d57a4e0c27

View File

@ -744,7 +744,7 @@ static inline void record_temp_fan(struct avalon_info *info, struct avalon_resul
info->temp2 = 0 - ((~ar->temp2 & 0x7f) + 1);
}
*temp_avg = info->temp2;
*temp_avg = info->temp2 > info->temp1 ? info->temp2 : info->temp1;
if (info->temp0 > info->temp_max)
info->temp_max = info->temp0;
@ -929,7 +929,7 @@ static int64_t avalon_scanhash(struct thr_info *thr)
elapsed.tv_sec, elapsed.tv_usec);
}
}
if (result_wrong >= avalon_get_work_count) {
if (result_wrong >= avalon_get_work_count || hash_count == 0) {
/* This means FPGA controller gave all wrong results, so
* try to reset the Avalon */
do_avalon_close(thr);