From 44f96c64b235b0b1b76d704719fe9eaeb5991225 Mon Sep 17 00:00:00 2001 From: Kano Date: Thu, 10 Oct 2013 07:56:41 +1100 Subject: [PATCH] klondike - display MHz also --- driver-klondike.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/driver-klondike.c b/driver-klondike.c index 797ee377..955c1c61 100644 --- a/driver-klondike.c +++ b/driver-klondike.c @@ -619,7 +619,9 @@ static void get_klondike_statline_before(char *buf, size_t siz, struct cgpu_info struct klondike_info *klninfo = (struct klondike_info *)(klncgpu->device_data); uint8_t temp = 0xFF; uint16_t fan = 0; + uint16_t clock = 0; int dev; + char tmp[16]; if (klninfo->status == NULL) return; @@ -629,11 +631,17 @@ static void get_klondike_statline_before(char *buf, size_t siz, struct cgpu_info if (klninfo->status[dev].temp < temp) temp = klninfo->status[dev].temp; fan += klninfo->cfg[dev].fantarget; + clock += klninfo->cfg[dev].hashclock; } fan /= klninfo->status->slavecount+1; + clock /= klninfo->status->slavecount+1; rd_unlock(&(klninfo->stat_lock)); - tailsprintf(buf, siz, " %3.0fC %3d%% | ", cvtKlnToC(temp), fan*100/255); + snprintf(tmp, sizeof(tmp), "%2.0fC", cvtKlnToC(temp)); + if (strlen(tmp) < 4) + strcat(tmp, " "); + + tailsprintf(buf, siz, "%3dMHz %3d%% %s| ", (int)clock, fan*100/255, tmp); } static struct api_data *klondike_api_stats(struct cgpu_info *klncgpu)