Merge pull request #425 from BitSyncom/avalon fliter out the wrong result from adjust fan code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
diff --git a/driver-avalon.c b/driver-avalon.c
index 7e14a21..94502d9 100644
--- a/driver-avalon.c
+++ b/driver-avalon.c
@@ -948,20 +948,22 @@ static int64_t avalon_scanhash(struct thr_info *thr)
avalon_rotate_array(avalon);
- record_temp_fan(info, &ar, &(avalon->temp));
- applog(LOG_INFO,
- "Avalon: Fan1: %d/m, Fan2: %d/m, Fan3: %d/m\t"
- "Temp1: %dC, Temp2: %dC, Temp3: %dC, TempMAX: %dC",
- info->fan0, info->fan1, info->fan2,
- info->temp0, info->temp1, info->temp2, info->temp_max);
- info->temp_history_index++;
- info->temp_sum += avalon->temp;
- applog(LOG_DEBUG, "Avalon: temp_index: %d, temp_count: %d, temp_old: %d",
- info->temp_history_index, info->temp_history_count, info->temp_old);
- if (info->temp_history_index == info->temp_history_count) {
- adjust_fan(info);
- info->temp_history_index = 0;
- info->temp_sum = 0;
+ if (hash_count) {
+ record_temp_fan(info, &ar, &(avalon->temp));
+ applog(LOG_INFO,
+ "Avalon: Fan1: %d/m, Fan2: %d/m, Fan3: %d/m\t"
+ "Temp1: %dC, Temp2: %dC, Temp3: %dC, TempMAX: %dC",
+ info->fan0, info->fan1, info->fan2,
+ info->temp0, info->temp1, info->temp2, info->temp_max);
+ info->temp_history_index++;
+ info->temp_sum += avalon->temp;
+ applog(LOG_DEBUG, "Avalon: temp_index: %d, temp_count: %d, temp_old: %d",
+ info->temp_history_index, info->temp_history_count, info->temp_old);
+ if (info->temp_history_index == info->temp_history_count) {
+ adjust_fan(info);
+ info->temp_history_index = 0;
+ info->temp_sum = 0;
+ }
}
/* This hashmeter is just a utility counter based on returned shares */