Changeset 4440

Show
Ignore:
Timestamp:
06/12/07 13:34:19 (8 years ago)
Author:
khali
Message:

Cleanups to fancontrol:
* Use let for arithmetic evaluation. Patch taken from the Suse package.
* Kill old commented-out code.

Location:
lm-sensors/branches/lm-sensors-3.0.0
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-3.0.0/CHANGES

    r4434 r4440  
    2020                   Fix Super-I/O exit sequence for Winbond/Fintek chips 
    2121  Program mkpatch: Delete 
     22  Program fancontrol: Use let for arithmetic evaluation 
    2223  Program pwmconfig: Use smaller steps for low PWM values 
    2324  Program rrd: Support only hwmon class devices 
  • lm-sensors/branches/lm-sensors-3.0.0/prog/pwm/fancontrol

    r4286 r4440  
    33# Simple script implementing a temperature dependent fan speed control 
    44# 
    5 # Version 0.63 
     5# Version 0.64 
    66# 
    77# Usage: fancontrol [CONFIGFILE] 
     
    189189                pwmo=${AFCPWM[$fcvcount]} 
    190190                pwmdisable $pwmo 
    191                 fcvcount=$fcvcount+1 
     191                let fcvcount=$fcvcount+1 
    192192        done 
    193193        echo 'Verify fans have returned to full speed' 
     
    288288                        echo "new pwmval=$pwmval" 
    289289                fi 
    290                 fcvcount=$fcvcount+1 
     290                let fcvcount=$fcvcount+1 
    291291        done 
    292292} 
     
    303303                restorefans 
    304304        fi 
    305         fcvcount=$fcvcount+1 
     305        let fcvcount=$fcvcount+1 
    306306done 
    307307 
     
    314314        sleep $INTERVAL 
    315315done 
    316  
    317 # some old stuff/missing features, will clean this up soon 
    318 #if ( test "$regulationtype" = "quad" ) ; then 
    319 #  while true ; do 
    320 #    temp=`cat ${temp1} | cut -b 12-13` 
    321 #    if (( ${temp} < ${mintemp} )) ; 
    322 #       then pwm=0 
    323 #    elif (( ${temp} > ${maxtemp} )) ; 
    324 #       then pwm=255 
    325 #    else 
    326 #       pwm=`calc "((10/(${maxtemp}-${mintemp})*(${temp}-${mintemp}))^2/1000*(${maxtemp}-${mintemp})*(255-${minspeed})+${minspeed})"` 
    327 #       #no optimization here for readability (or sloth :)) 
    328 #    fi ; 
    329 #    echo $pwm > ${pwm1} ; 
    330 # 
    331 #    sleep 10 ; 
    332 #  done ; 
    333  
    334 #elif ( test "$regulationtype" = "exp" ) ; then 
    335   #add support for exponential calculation here 
    336  
    337 #else 
    338 #  pwmconst=$[(255-${minspeed})/(${maxtemp}-${mintemp})] 
    339 #  while true ; do 
    340 #    let temp=`cat temp1 | cut -b 12-13` ; 
    341 #    if (( ${temp} < ${mintemp} )) ; 
    342 #        then pwm=0 
    343 #    elif (( ${temp} > ${maxtemp} )) ; 
    344 #        then pwm=255 
    345 #    else 
    346 #       pwm=$[(${temp}-${mintemp})*${pwmconst}+${minspeed}] 
    347 #    fi ; 
    348 #    echo $pwm > pwm2 ; 
    349 # 
    350 #    sleep 10 ; 
    351 #  done ; 
    352 #fi