Commit 4629553ad64f8297d0a494e14e87e77c8b21d2b7

Denis Ahrens 2012-11-26T02:34:27

ztex: Display FPGA clock frequency with only one decimal

diff --git a/driver-ztex.c b/driver-ztex.c
index 892009a..5f7cdb3 100644
--- a/driver-ztex.c
+++ b/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));
 	}
 }
 
diff --git a/libztex.c b/libztex.c
index 2cc5053..9a8b11c 100644
--- a/libztex.c
+++ b/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;