fancontrol
This commit is contained in:
28
fancontrol
28
fancontrol
@@ -335,21 +335,20 @@ function UpdateFanSpeeds {
|
||||
echo "pwmpval=$pwmpval"
|
||||
echo "fanval=$fanval"
|
||||
fi
|
||||
|
||||
if (( $tval <= $offt ))
|
||||
then pwmval=$minpwm # below min temp, use defined min pwm
|
||||
elif (( $tval >= $maxt ))
|
||||
then pwmval=$maxpwm # over max temp, use defined max pwm
|
||||
elif(( $tval > $mint ))
|
||||
then
|
||||
if (( $tval <= $offt )); then
|
||||
pwmval=$minpwm # below min temp, use defined min pwm
|
||||
elif (( $tval >= $maxt )); then
|
||||
pwmval=$maxpwm # over max temp, use defined max pwm
|
||||
elif(( $tval > $mint )); then
|
||||
pwmval=$maxpwm # over max temp, use defined max pwm
|
||||
# calculate the new value from temperature and settings
|
||||
pwmval="(${tval}-${mint})*(${maxpwm}-${minso})/(${maxt}-${mint})+${minso}"
|
||||
if [ $pwmpval -eq 0 -o $fanval -eq 0 ]
|
||||
then # if fan was stopped start it using a safe value
|
||||
echo $minsa > $pwmo
|
||||
# Sleep while still handling signals
|
||||
read < <(exec sleep 1)
|
||||
fi
|
||||
#pwmval="(${tval}-${mint})*(${maxpwm}-${minso})/(${maxt}-${mint})+${minso}"
|
||||
#if [ $pwmpval -eq 0 -o $fanval -eq 0 ]
|
||||
#then # if fan was stopped start it using a safe value
|
||||
# echo $minsa > $pwmo
|
||||
# # Sleep while still handling signals
|
||||
# read < <(exec sleep 1)
|
||||
#fi
|
||||
#else ( > offt and < mint )
|
||||
# keep running on current value
|
||||
fi
|
||||
@@ -382,6 +381,7 @@ do
|
||||
done
|
||||
|
||||
echo 'Starting automatic fan control...'
|
||||
pwmval=$maxpwm
|
||||
|
||||
# main loop calling the main function at specified intervals
|
||||
while true
|
||||
|
||||
Reference in New Issue
Block a user