Browse Source

MMQ ensure delta clock can never exceed limits

Kano 13 years ago
parent
commit
f0003055a4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      driver-modminer.c

+ 2 - 2
driver-modminer.c

@@ -623,10 +623,10 @@ static const char *modminer_delta_clock(struct thr_info *thr, int delta, bool te
 	state->hw_errors = 0;
 	state->hw_errors = 0;
 
 
 	// FYI clock drop has little effect on temp
 	// FYI clock drop has little effect on temp
-	if (delta < 0 && modminer->clock <= MODMINER_MIN_CLOCK)
+	if (delta < 0 && (modminer->clock + delta) < MODMINER_MIN_CLOCK)
 		return clocktoolow;
 		return clocktoolow;
 
 
-	if (delta > 0 && modminer->clock >= MODMINER_MAX_CLOCK)
+	if (delta > 0 && (modminer->clock + delta) > MODMINER_MAX_CLOCK)
 		return clocktoohi;
 		return clocktoohi;
 
 
 	if (delta < 0) {
 	if (delta < 0) {