Browse Source

update fan pwm

Xiangfu 13 years ago
parent
commit
6274c5488b
2 changed files with 8 additions and 8 deletions
  1. 6 6
      driver-avalon.c
  2. 2 2
      driver-avalon.h

+ 6 - 6
driver-avalon.c

@@ -676,14 +676,14 @@ static inline void adjust_temp(struct avalon_info *info)
 
 
 	temp_new = info->temp_sum / info->temp_history_count;
 	temp_new = info->temp_sum / info->temp_history_count;
 
 
-	if (temp_new < 40)
+	if (temp_new < 35)
 		info->fan_pwm = AVALON_DEFAULT_FAN_MIN_PWM;
 		info->fan_pwm = AVALON_DEFAULT_FAN_MIN_PWM;
-	else if (temp_new > 60)
+	else if (temp_new > 55)
 		info->fan_pwm = AVALON_DEFAULT_FAN_MAX_PWM;
 		info->fan_pwm = AVALON_DEFAULT_FAN_MAX_PWM;
-	else if (abs(temp_new - info->temp_old) >= 2) {
-		info->fan_pwm = (temp_new - 40) * 9 + 10;
-		info->temp_old = temp_new;
-	}
+	else if (abs(temp_new - info->temp_old) >= 2)
+		info->fan_pwm = AVALON_DEFAULT_FAN_MIN_PWM + (temp_new - 35) * 6.4;
+
+	info->temp_old = temp_new;
 }
 }
 
 
 static int64_t avalon_scanhash(struct thr_info *thr, struct work **work,
 static int64_t avalon_scanhash(struct thr_info *thr, struct work **work,

+ 2 - 2
driver-avalon.h

@@ -19,8 +19,8 @@
 #define AVALON_RESET_PITCH	(300*1000*1000)
 #define AVALON_RESET_PITCH	(300*1000*1000)
 
 
 #define AVALON_FAN_FACTOR 120
 #define AVALON_FAN_FACTOR 120
-#define AVALON_DEFAULT_FAN_MAX_PWM 0xA0
-#define AVALON_DEFAULT_FAN_MIN_PWM 0x08
+#define AVALON_DEFAULT_FAN_MAX_PWM 0xA0 /* 100% */
+#define AVALON_DEFAULT_FAN_MIN_PWM 0x20 /*  20% */
 #define AVALON_DEFAULT_TIMEOUT 0x32
 #define AVALON_DEFAULT_TIMEOUT 0x32
 #define AVALON_DEFAULT_MINER_NUM 0x20
 #define AVALON_DEFAULT_MINER_NUM 0x20
 #define AVALON_DEFAULT_ASIC_NUM 0xA
 #define AVALON_DEFAULT_ASIC_NUM 0xA