Wait for 5 temperature updates in hfa before adjusting fanspeed.
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
diff --git a/driver-hashfast.c b/driver-hashfast.c
index 84107ed..e019a55 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -705,7 +705,7 @@ static void hfa_update_die_status(struct cgpu_info *hashfast, struct hashfast_in
// XXX Convert board phase currents, voltage, temperature
}
if (die == info->asic_count - 1) {
- info->temp_update = true;
+ info->temp_updates++;
/* We have a full set of die temperatures, find the highest
* current die temp. */
die_temperature = 0;
@@ -1061,9 +1061,9 @@ static void hfa_temp_clock(struct cgpu_info *hashfast, struct hashfast_info *inf
}
/* Find the direction of temperature change since we last checked */
- if (!info->temp_update)
+ if (info->temp_updates < 5)
goto fan_only;
- info->temp_update = false;
+ info->temp_updates = 0;
temp_change = info->max_temp - info->last_max_temp;
info->last_max_temp = info->max_temp;
diff --git a/driver-hashfast.h b/driver-hashfast.h
index 6dfd845..8465f70 100644
--- a/driver-hashfast.h
+++ b/driver-hashfast.h
@@ -123,7 +123,7 @@ struct hashfast_info {
int overheat;
double max_temp;
int last_max_temp;
- bool temp_update;
+ int temp_updates;
int fanspeed; // Fanspeed in percent
pthread_t read_thr;