Commit d56bb3df6585b141cf3e8ff37e97104221be3569

Con Kolivas 2014-02-04T20:09:18

Wait for 5 temperature updates in hfa before adjusting fanspeed.

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;