From 0074e0fe1f3585a9eb3b6e852001ebea7c3667e6 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Mon, 28 Apr 2014 18:06:34 +0000 Subject: [PATCH] branch one, another cpu temp adjustment to handle PECI. will need to look at more data sets to see what is safe to do re overrides. --- inxi | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/inxi b/inxi index ffedd0f..db48bb5 100755 --- a/inxi +++ b/inxi @@ -2,8 +2,8 @@ ######################################################################## #### Script Name: inxi #### Version: 2.1.23 -#### Date: 2014-04-27 -#### Patch Number: 02-b1 +#### Date: 2014-04-28 +#### Patch Number: 03-b1 ######################################################################## #### SPECIAL THANKS ######################################################################## @@ -8211,6 +8211,7 @@ get_sensors_data() sysFanString="" temp1="" temp2="" + tempDiff=20 # for C, handled for F after that is determined tempFanType="" # set to 1 or 2 tempUnit="" tempWorking="" @@ -8389,9 +8390,13 @@ get_sensors_data() tempFanType=1 } } + # convert the diff number for F, it needs to be bigger that is + if ( tempUnit == "F" ) { + tempDiff = tempDiff * 1.8 + } if ( cpuTemp != "" ) { # specific hack to handle broken CPUTIN temps with PECI - if ( cpuPeciTemp != "" && ( cpuTemp - cpuPeciTemp ) > 20 ){ + if ( cpuPeciTemp != "" && ( cpuTemp - cpuPeciTemp ) > tempDiff ){ cpuTempReal=cpuPeciTemp } # then get the real cpu temp, best guess is hottest is real @@ -8407,21 +8412,15 @@ get_sensors_data() else { cpuTempReal=temp2 } - # last check for bad data - if ( cpuTempReal != "" && core0Temp != "" && (core0Temp - cpuTempReal) > 10 ) { - cpuTempReal=core0Temp - } } else { - # there are some absurdly wrong temp1: acpitz-virtual-0 temp1: +13.8°C - if ( core0Temp != "" ) { - cpuTempReal=core0Temp - } - else { - cpuTempReal=temp1 # can be null, that is ok - } + cpuTempReal=temp1 # can be null, that is ok } } + # there are some absurdly wrong temp1: acpitz-virtual-0 temp1: +13.8°C + if ( cpuTempReal != "" && core0Temp != "" && (core0Temp - cpuTempReal) > tempDiff ) { + cpuTempReal=core0Temp + } # if all else fails, use core0/peci temp if present and cpu is null if ( cpuTempReal == "" ) { if ( core0Temp != "" ) {