From b0aaf3cc3efe167c8225f808967f45cc2f6c00b0 Mon Sep 17 00:00:00 2001 From: snow Date: Sat, 13 Jun 2020 22:24:16 -0700 Subject: [PATCH] wmgtemp: Actually useful graph (use Celcius instead of Kelvin) --- wmgtemp/src/wmgtemp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wmgtemp/src/wmgtemp.c b/wmgtemp/src/wmgtemp.c index 4db594e..8b69422 100644 --- a/wmgtemp/src/wmgtemp.c +++ b/wmgtemp/src/wmgtemp.c @@ -53,9 +53,9 @@ #define OPT_STRING "g:sS:hH:w:m:M:a:e:u:1:2:tq" -#define TEMPTOFAHRENHEIT(t) ((int)((t * (9.0 / 5.0) - 459.67))) -#define TEMPTOKELVIN(t) ((int)t) -#define TEMPTOCELCIUS(t) ((int)(t - 273.15)) +#define TEMPTOFAHRENHEIT(t) ((int)((t * (9.0 / 5.0) + 32))) +#define TEMPTOKELVIN(t) ((int)(t - 273.15)) +#define TEMPTOCELCIUS(t) ((int)t) #define TEMPTODISPLAYSCALE(temp, display_flags) (IsOn((display_flags), TSCALE_CELCIUS) ? TEMPTOCELCIUS((temp)) : (IsOn((display_flags), TSCALE_KELVIN) ? TEMPTOKELVIN((temp)) : TEMPTOFAHRENHEIT((temp)))) /* Prototypes */ @@ -402,8 +402,8 @@ void update_sensor_data() { } // Read the new values from the sensors into the temperature arrays. - if(IsOn(SENSOR_DISP, SYS)) sys_history[58] = get_stat_int(sys_sensor_name, sys_stat_name) / 1000000.0; - if(IsOn(SENSOR_DISP, CPU)) cpu_history[58] = get_stat_int(cpu_sensor_name, cpu_stat_name) / 1000000.0; + if(IsOn(SENSOR_DISP, SYS)) sys_history[58] = (get_stat_int(sys_sensor_name, sys_stat_name) / 1000000.0) - 273.15; + if(IsOn(SENSOR_DISP, CPU)) cpu_history[58] = (get_stat_int(cpu_sensor_name, cpu_stat_name) / 1000000.0) - 273.15; // Update the run high/low values. if(cpu_high > run_cpu_high)