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.

This commit is contained in:
inxi-svn 2014-04-28 18:06:34 +00:00
parent fa39436326
commit 0074e0fe1f

27
inxi
View file

@ -2,8 +2,8 @@
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### Version: 2.1.23 #### Version: 2.1.23
#### Date: 2014-04-27 #### Date: 2014-04-28
#### Patch Number: 02-b1 #### Patch Number: 03-b1
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
######################################################################## ########################################################################
@ -8211,6 +8211,7 @@ get_sensors_data()
sysFanString="" sysFanString=""
temp1="" temp1=""
temp2="" temp2=""
tempDiff=20 # for C, handled for F after that is determined
tempFanType="" # set to 1 or 2 tempFanType="" # set to 1 or 2
tempUnit="" tempUnit=""
tempWorking="" tempWorking=""
@ -8389,9 +8390,13 @@ get_sensors_data()
tempFanType=1 tempFanType=1
} }
} }
# convert the diff number for F, it needs to be bigger that is
if ( tempUnit == "F" ) {
tempDiff = tempDiff * 1.8
}
if ( cpuTemp != "" ) { if ( cpuTemp != "" ) {
# specific hack to handle broken CPUTIN temps with PECI # specific hack to handle broken CPUTIN temps with PECI
if ( cpuPeciTemp != "" && ( cpuTemp - cpuPeciTemp ) > 20 ){ if ( cpuPeciTemp != "" && ( cpuTemp - cpuPeciTemp ) > tempDiff ){
cpuTempReal=cpuPeciTemp cpuTempReal=cpuPeciTemp
} }
# then get the real cpu temp, best guess is hottest is real # then get the real cpu temp, best guess is hottest is real
@ -8407,21 +8412,15 @@ get_sensors_data()
else { else {
cpuTempReal=temp2 cpuTempReal=temp2
} }
# last check for bad data
if ( cpuTempReal != "" && core0Temp != "" && (core0Temp - cpuTempReal) > 10 ) {
cpuTempReal=core0Temp
}
} }
else { else {
# there are some absurdly wrong temp1: acpitz-virtual-0 temp1: +13.8°C cpuTempReal=temp1 # can be null, that is ok
if ( core0Temp != "" ) {
cpuTempReal=core0Temp
}
else {
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 all else fails, use core0/peci temp if present and cpu is null
if ( cpuTempReal == "" ) { if ( cpuTempReal == "" ) {
if ( core0Temp != "" ) { if ( core0Temp != "" ) {