From d6720ee0aa600b17cc94b42df4199943f3df4bf9 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 27 Apr 2013 00:41:01 +1000 Subject: [PATCH] Damp the temperature display measurement for bflsc since it fluctuates so wildly. --- driver-bflsc.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/driver-bflsc.c b/driver-bflsc.c index 021870c9..ce4736e9 100644 --- a/driver-bflsc.c +++ b/driver-bflsc.c @@ -1111,8 +1111,18 @@ static bool bflsc_get_temp(struct cgpu_info *bflsc, int dev) if (temp1 > 0 || temp2 > 0) { wr_lock(&(sc_info->stat_lock)); - sc_info->sc_devs[dev].temp1 = temp1; - sc_info->sc_devs[dev].temp2 = temp2; + if (unlikely(!sc_info->sc_devs[dev].temp1)) + sc_info->sc_devs[dev].temp1 = temp1; + else { + sc_info->sc_devs[dev].temp1 += temp1 * 0.63; + sc_info->sc_devs[dev].temp1 /= 1.63; + } + if (unlikely(!sc_info->sc_devs[dev].temp2)) + sc_info->sc_devs[dev].temp2 = temp2; + else { + sc_info->sc_devs[dev].temp2 += temp2 * 0.63; + sc_info->sc_devs[dev].temp2 /= 1.63; + } if (temp1 > sc_info->sc_devs[dev].temp1_max) { sc_info->sc_devs[dev].temp1_max = temp1; sc_info->sc_devs[dev].temp1_max_time = time(NULL);