Browse Source

ztex: Display FPGA clock frequency with only one decimal

Denis Ahrens 13 years ago
parent
commit
4629553ad6
2 changed files with 3 additions and 3 deletions
  1. 1 1
      driver-ztex.c
  2. 2 2
      libztex.c

+ 1 - 1
driver-ztex.c

@@ -348,7 +348,7 @@ static void ztex_statline_before(char *buf, struct cgpu_info *cgpu)
 {
 	if (cgpu->deven == DEV_ENABLED) {
 		tailsprintf(buf, "%s-%d | ", cgpu->device_ztex->snString, cgpu->device_ztex->fpgaNum+1);
-		tailsprintf(buf, "%0.2fMhz | ", cgpu->device_ztex->freqM1 * (cgpu->device_ztex->freqM + 1));
+		tailsprintf(buf, "%0.1fMHz | ", cgpu->device_ztex->freqM1 * (cgpu->device_ztex->freqM + 1));
 	}
 }
 

+ 2 - 2
libztex.c

@@ -383,10 +383,10 @@ int libztex_setFreq(struct libztex_device *ztex, uint16_t freq) {
 	}
 	ztex->freqM = freq;
 	if (oldfreq > ztex->freqMaxM) 
-		applog(LOG_WARNING, "%s: Frequency set to %0.2f Mhz",
+		applog(LOG_WARNING, "%s: Frequency set to %0.1f MHz",
 		       ztex->repr, ztex->freqM1 * (ztex->freqM + 1));
 	else
-		applog(LOG_WARNING, "%s: Frequency change from %0.2f to %0.2f Mhz",
+		applog(LOG_WARNING, "%s: Frequency change from %0.1f to %0.1f MHz",
 		       ztex->repr, ztex->freqM1 * (oldfreq + 1), ztex->freqM1 * (ztex->freqM + 1));
 
 	return 0;